Gradle控制台说Build是成功的,但有错误,应用程序无法运行

时间:2017-09-22 01:12:50

标签: android gradle build.gradle

好的,这是一个奇怪的错误:

  • 该应用程序一个月前工作正常,我今天需要引入一个修复程序,它没有运行。在我可以想到的唯一区别之间是几个Android Studio升级。但其他应用仍然可以完美运行。
  • 该应用可以清除项目,重建项目和生成签名APK,没有错误
  • 当我尝试在模拟器上运行或调试应用程序时出现问题
    • 帖子底部的完全gradle控制台和build.gradle
    • 我没有选择设备来运行'窗口,它在
    • 之前停止
    • Build说BUILD SUCCESFUL,但也说682错误
    • 在Gradle Console中,它以ASCII
    • 打印依赖关系树
  • 另一件事:生成的APK可以安装在模拟器上并且完美无缺

有没有人遇到过这样的错误?

提前致谢!

的build.gradle

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}


android {
    compileSdkVersion 25
    buildToolsVersion '25.0.2'

    defaultConfig {
        applicationId "uy.com.hermes.tugentman.stecnico"
        minSdkVersion 17
        targetSdkVersion 21
        versionCode 1007
        versionName "v1.0.07"
        setProperty("archivesBaseName", "Hermes_Tugentman_STecnico_7inch_$versionCode")
    }
    buildTypes {
        release {
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    applicationVariants.all { variant ->
        variant.resValue "string", "app_ver", variant.versionName
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile files('libs/mapquest-android-sdk-1.0.5.jar')
    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    compile('com.mapbox.mapboxsdk:mapbox-android-sdk:4.1.1@aar') {
        transitive = true;
    }
    compile('io.fabric.sdk.android:fabric:1.3.10@aar') {
        transitive = true;
    }
}

Gradle Console

Executing tasks: [androidDependencies]

Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:app:androidDependencies
debug
+--- com.android.support:appcompat-v7:25.3.1@aar
|    +--- com.android.support:support-annotations:25.3.1@jar
|    +--- com.android.support:support-v4:25.3.1@aar
|    |    +--- com.android.support:support-compat:25.3.1@aar
|    |    |    \--- com.android.support:support-annotations:25.3.1@jar
|    |    +--- com.android.support:support-media-compat:25.3.1@aar
|    |    |    +--- com.android.support:support-annotations:25.3.1@jar
|    |    |    \--- com.android.support:support-compat:25.3.1@aar
|    |    |         \--- com.android.support:support-annotations:25.3.1@jar
|    |    +--- com.android.support:support-core-utils:25.3.1@aar
|    |    |    +--- com.android.support:support-annotations:25.3.1@jar
... lines removed to fit SO post limit, they are all in this format, full file can be made available if someone need to see it ...
|    |         \--- com.android.support:support-core-utils:25.3.1@aar
|    |              +--- com.android.support:support-annotations:25.3.1@jar
|    |              \--- com.android.support:support-compat:25.3.1@aar
|    |                   \--- com.android.support:support-annotations:25.3.1@jar
|    \--- com.squareup.okhttp3:okhttp:3.3.0@jar
|         \--- com.squareup.okio:okio:1.8.0@jar
+--- io.fabric.sdk.android:fabric:1.3.17@aar
+--- __local_jars__:F:\Dropbox\Workspaces\AndroidStudio\Tugentman_STecnico_v1\app\libs\mapquest-android-sdk-1.0.5.jar:unspecified@jar
\--- __local_jars__:F:\Dropbox\Workspaces\AndroidStudio\Tugentman_STecnico_v1\app\libs\mapquest-android-sdk-1.0.5.jar:unspecified@jar

debugAndroidTest
No dependencies

debugUnitTest
No dependencies

release
+--- com.android.support:appcompat-v7:25.3.1@aar
|    +--- com.android.support:support-annotations:25.3.1@jar
|    +--- com.android.support:support-v4:25.3.1@aar
|    |    +--- com.android.support:support-compat:25.3.1@aar
|    |    |    \--- com.android.support:support-annotations:25.3.1@jar
|    |    +--- com.android.support:support-media-compat:25.3.1@aar
|    |    |    +--- com.android.support:support-annotations:25.3.1@jar
|    |    |    \--- com.android.support:support-compat:25.3.1@aar
|    |    |         \--- com.android.support:support-annotations:25.3.1@jar
|    |    +--- com.android.support:support-core-utils:25.3.1@aar
|    |    |    +--- com.android.support:support-annotations:25.3.1@jar
|    |    |    \--- com.android.support:support-compat:25.3.1@aar
|    |    |         \--- com.android.support:support-annotations:25.3.1@jar
|    |    +--- com.android.support:support-core-ui:25.3.1@aar
|    |    |    +--- com.android.support:support-annotations:25.3.1@jar
|    |    |    \--- com.android.support:support-compat:25.3.1@aar
|    |    |         \--- com.android.support:support-annotations:25.3.1@jar
|    |    \--- com.android.support:support-fragment:25.3.1@aar
|    |         +--- com.android.support:support-compat:25.3.1@aar
... lines removed to fit SO post limit, they are all in this format, full file can be made available if someone need to see it ...
|    |         +--- com.android.support:support-core-ui:25.3.1@aar
|    |         |    +--- com.android.support:support-annotations:25.3.1@jar
|    |         |    \--- com.android.support:support-compat:25.3.1@aar
|    |         |         \--- com.android.support:support-annotations:25.3.1@jar
|    |         \--- com.android.support:support-core-utils:25.3.1@aar
|    |              +--- com.android.support:support-annotations:25.3.1@jar
|    |              \--- com.android.support:support-compat:25.3.1@aar
|    |                   \--- com.android.support:support-annotations:25.3.1@jar
|    \--- com.squareup.okhttp3:okhttp:3.3.0@jar
|         \--- com.squareup.okio:okio:1.8.0@jar
+--- io.fabric.sdk.android:fabric:1.3.17@aar
+--- __local_jars__:F:\Dropbox\Workspaces\AndroidStudio\Tugentman_STecnico_v1\app\libs\mapquest-android-sdk-1.0.5.jar:unspecified@jar
\--- __local_jars__:F:\Dropbox\Workspaces\AndroidStudio\Tugentman_STecnico_v1\app\libs\mapquest-android-sdk-1.0.5.jar:unspecified@jar

releaseUnitTest
No dependencies

BUILD SUCCESSFUL

Total time: 0.466 secs

1 个答案:

答案 0 :(得分:1)

试试此代码

buildTypes {
    release {
        shrinkResources true
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}