Ich habe - wie viele Entwickler, Probleme mit den berüchtigten androiden 65000 Methoden zu begrenzen. Ich bin bereits Multi-Dexing meiner App, aber ich möchte es irgendwie irgendwie leichter machen.android gms große Methoden zählen. Wie man es vermeidet?
Dies ist die Grafik der Methoden meiner App (genommen mit dexcount plugin: https://github.com/KeepSafe/dexcount-gradle-plugin).
Wie Sie sehen können, kommen die meisten Methoden aus dem com.google.android.gms Paket. Dies ist die Liste der Abhängigkeiten von build.gradle Datei:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
compile project(':libs:cip-library:cip-library')
compile project(':libs:android-times-square')
compile files('../libs/mobile.connect-android-1.7.6.jar')
compile files('../libs/dtapl-2.1.1.jar')
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'com.nhaarman.listviewanimations:lib-core:[email protected]'
compile 'com.nhaarman.listviewanimations:lib-manipulation:[email protected]'
compile 'com.nhaarman.listviewanimations:lib-core-slh:[email protected]'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.google.code.gson:gson:2.4'
compile 'de.greenrobot:greendao:2.0.0'
compile 'com.pnikosis:materialish-progress:1.5'
compile 'org.adw.library:discrete-seekbar:1.0.0'
compile 'com.android.support:design:24.2.1'
compile 'net.fredericosilva:showTipsView:1.0.4'
compile 'com.google.maps.android:android-maps-utils:0.4.4'
compile 'com.robohorse.gpversionchecker:gpversionchecker:1.0.8'
compile 'net.danlew:android.joda:2.9.4.1'
compile 'com.android.support:support-annotations:24.2.1'
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') {
transitive = true;
}
compile('com.mikepenz:aboutlibraries:[email protected]') {
transitive = true
}
}
Nun, ich weiß, dass diese Abhängigkeiten sind nicht wenige, aber was ich nicht verstehe, ist speziell die man - und wie - auslöst, die Abhängigkeit von Pakete wie com.google.android.gms.internal.games, während meine App kein Spiel ist, com.google.android.gms.internal.cast oder com.google.android.gms.internal.fitness. Und - vor allem - wie könnte ich diese Abhängigkeiten jemals loswerden?
Vielen Dank Marco
Führen Sie einen [Gradle-Abhängigkeitsbericht] (https://docs.gradle.org/current/userguide/tutorial_gradle_command_line.html#sec:listing_dependencies) aus, um festzustellen, woher Ihre unerwarteten Abhängigkeiten kommen. – CommonsWare