1

私はデバッグモードに変更するとアプリを実行できますが、リリースモードに切り替えると失敗します。Signed Apkを生成 - ':app:transformClassesWithDexForRelease'タスクの実行に失敗しました

エラー:

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:[email protected]' 
compile 'com.daimajia.androidanimations:library:[email protected]' 
compile 'com.github.navasmdc:MaterialDesign:[email protected]' 
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' 
} 

EDIT: あなたはmultidexが私のbuild.gradleで有効になって見ることができるようにファイル。

EDIT 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); 
} 

} 

マニフェスト

<?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> 
+0

[Android:Lollipopでは実行時にアプリをロードするライブラリですが、IceCreamSandwichでは使用できません](http://stackoverflow.com/questions/32407985/android-app-loading-library-at-runtime-on-lollipop-but-not) -icecreamsandwich) – Devrim

+0

@DevrimTuncerご覧のとおり、multidexはbuild.gradleファイルで有効になっています。 –

+0

マニフェストクラスとアプリケーションクラスはどうですか?私が共有したリンクの回答を確認してください。 – Devrim

答えて

2

問題がcom.google.android.gms:play-services:9.0.2 を使用しての代わりに、すべてのGoogleは、サービスのトンを再生利用していますただ削除ryはあなたが

を必要なものだけを使用することにするとはい、あなたは

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

play-services-analytics:9.0.2play-services:9.0.2

に含まれて、その後

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

を使用している

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

このソリューションは私のために働いた! – Mrinmoy

関連する問題