gpt4 book ai didi

android - 生成签名 Apk - 任务 ':app:transformClassesWithDexForRelease' 执行失败

转载 作者:行者123 更新时间:2023-11-29 19:45:13 25 4
gpt4 key购买 nike

当我切换到 Debug模式时,我能够运行我的应用程序,但当我切换到 Release模式时,它失败了。

错误:

Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. java.io.IOException: Please correct the above warnings first.

-

build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'

defaultConfig {
applicationId "com.application.app"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"

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

dexOptions {
incremental true
javaMaxHeapSize "4g"
}
}

dependencies {
compile 'com.sromku:simple-storage:1.2.0'
compile 'com.google.android.gms:play-services-analytics:9.0.2'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services:9.0.2'
compile project(':yandexmapkitlibrary')
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1@aar'
compile 'com.daimajia.androidanimations:library:1.1.3@aar'
compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
compile 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile group: 'org.apache.httpcomponents', name: 'httpclient-android', version: '4.3.5.1'
compile 'com.google.code.gson:gson:2.6.2'

compile 'com.github.bumptech.glide:glide:3.7.0'
}

编辑:如您所见,我的 build.gradle 文件中启用了 multidex。

编辑 2:

App.java

public class App extends MultiDexApplication {

public static GoogleAnalytics analytics;
public static Tracker tracker;

@Override
public void onCreate() {
super.onCreate();
MultiDex.install(this);

analytics = GoogleAnalytics.getInstance(this);
analytics.setLocalDispatchPeriod(1800);
tracker = analytics.newTracker("myAnalyticsId");
tracker.enableExceptionReporting(true);
tracker.enableAdvertisingIdCollection(true);
}

}

list

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.application.app" android:installLocation="preferExternal">

<!--permissions-->

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:logo="@mipmap/ic_launcher"
android:name="android.support.multidex.MultiDexApplication"
android:theme="@style/AppTheme">

<!--...-->

</application>
</manifest>

最佳答案

问题出在使用 com.google.android.gms:play-services:9.0.2而不是使用所有谷歌播放服务尝试使用你需要的东西

是的,你正在使用

compile 'com.google.android.gms:play-services-analytics:9.0.2'

然后

compile 'com.google.android.gms:play-services:9.0.2'

play-services-analytics:9.0.2 包含在 play-services:9.0.2

只是删除

com.google.android.gms:play-services:9.0.2

关于android - 生成签名 Apk - 任务 ':app:transformClassesWithDexForRelease' 执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37879367/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com