首页 文章

无法使用Fused提供程序启动应用程序?

提问于
浏览
0

我正在构建一个应用程序,我在本教程链接中使用Fused提供程序的代码,但是当我想运行我的应用程序时,我收到此错误:

Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.

com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'command'/ usr / lib / jvm / java-7- openjdk-amd64 / bin / java''以非零退出值1结束

这是我的Gradle文件:

apply plugin: 'com.android.application'

android {compileSdkVersion 23 buildToolsVersion“24.0.0”dexOptions {javaMaxHeapSize“4g”}

defaultConfig {
    applicationId "com.example.dev3.fusedtutorial"
    minSdkVersion 9
    targetSdkVersion 23
    multiDexEnabled true
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies {compile fileTree(include:['* .jar'],dir:'libs')testCompile'junit:junit:4.12'compile'com.android.support:appcompat-v7:23.4.0'compile'com.google .android.gms:播放服务:9.2.0'}

谁能帮我?

1 回答

  • 0

    将以下内容添加到应用级别的build.gradle:

    android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    
    
    defaultConfig {
         applicationId "com.example.dev3.fusedtutorial"
         minSdkVersion 9
         targetSdkVersion 23
         multiDexEnabled true
         versionCode 1
         versionName "1.0"
    
    }
    
    dexOptions {
        incremental true
        javaMaxHeapSize "4g"
    }
    }
    

    或者添加一个Application类,如下所示:

    public class MyApplication extends Application {
    
    @Override
    public void onCreate() {
        MultiDex.install(getApplicationContext());
        super.onCreate();
    
        }
     }
    

    并且不要忘记在清单中编辑您的应用程序名称 .

    <application
        android:name=".MyApplication"
        ................
     </application>
    

相关问题