2016-10-13 1 views
0

私は、多くの開発者が、悪名高いアンドロイド65000のメソッド制限に問題があることを知っています。私はすでに私のアプリをマルチデクシングしていますが、何とか軽くしたいと思っています。アンドロイドgmsビッグメソッドカウント。それを避ける方法は?

これは私のアプリの方法のグラフです(dexcountプラグインで取得:https://github.com/KeepSafe/dexcount-gradle-plugin)。

enter image description here

あなたが見ることができるように、メソッドのほとんどはcom.google.android.gmsパッケージから来ます。そしてどのように - - に依存してトリガされた私は、これらの依存関係は数ではありません知っているが、私は理解していないことは、特にその一つであり、今

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 
    } 
} 

:これはbuild.gradleファイルから依存関係のリストですcom.google.android.gms.internal.gamesのようなパッケージです。私のアプリはゲームではありませんが、com.google.android.gms.internal.castまたはcom.google.android.gms.internal.fitnessです。そして、何よりも、私はどうしてこれらの依存関係を取り除くことができますか?

ありがとうございました マルコ

+1

[Gradle dependency report](https://docs.gradle.org/current/userguide/tutorial_gradle_command_line.html#sec:listing_dependencies)を実行して、予期しない依存関係の原因を特定します。 – CommonsWare

答えて

2

特定の依存関係は、アプリケーションのモジュールのdependencies Gradleのタスクを実行して、どこから来た理解するために。

./gradlew -q :app:dependencies 

出力はすべて推移的な依存が含まれている必要があり、ライブラリはあなたがを取り除きたいものをドラッグしているかを確認するために簡単なはずです。その後、コマンドは次のようになります、あなたのアプリケーションのモジュールがappと呼ばれていると仮定。

+0

ありがとうございました、これは多くの助けになりました! –

+0

@MarcoZanetti、もちろん、よろしいですか? – Egor

関連する問題