1

每次我尝试在手机上运行我的应用程序时,我都会收到此消息

它崩溃了。我不知道如何修复它,我已经取消选中 Instant Run 并安装了 ADB Idea 但仍然没有运气。有什么帮助吗?

编辑(build.gradle):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.fretshot.ihc.sapp"
        minSdkVersion 22
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        resValue "string", "google_maps_key", (project.findProperty("GOOGLE_MAPS_API_KEY") ?: "")
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.0'
    implementation 'com.google.android.gms:play-services-location:15.0.0'
    implementation 'com.ncorti:slidetoact:0.3.0'
}
4

1 回答 1

-1

您是否在 AndroidManifest.xml 中导出了启动器活动?看到您通过 adb 启动它,您需要添加:

<activity
    android:name=".yourpackagename.YourActivity"
    android:exported="true"/>

为了使您的活动可以 adb-launchable。默认情况下会导出带有意图过滤器的活动。

于 2018-04-25T08:18:23.733 回答