2016-11-16 6 views
0

キットカットにこのエラーをRecevingと下位バージョンGCMを受け取るために、必要なすべてのjarsファイルとFirebase jsonファイルが含まれていました。com.google.firebase.provider.FirebaseInitProvider:java.lang.ClassNotFoundExceptionが:ロリポップにして、私が持っている <p></p>上で完璧に動作com.google.firebase.provider.FirebaseInitProvider

私のアプリのGradleの

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

android { 
    compileSdkVersion 23 
    buildToolsVersion "24.0.0" 
    defaultConfig { 
     applicationId "" 
     minSdkVersion 13 
     targetSdkVersion 23 
     versionCode 6 
     versionName "1.6" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    defaultConfig { 
     multiDexEnabled true 
    } 
    useLibrary 'org.apache.http.legacy' 
} 


dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 

    compile project(':httpmime-4.2.5') 
    compile project(':universal-image-loader-1.9.3') 
    compile project(':universal-image-loader-1.9.3') 
    compile group: 'org.apache.httpcomponents', name: 'httpclient-android', version: '4.3.3' 

    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.loopj.android:android-async-http:1.4.9' 
    compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+' 

    compile 'com.android.support:design:23.4.0' 
    compile 'com.google.android.gms:play-services:9.0.0' 
    testCompile 'junit:junit:4.12' 
} 

答えて

4

...それがお役に立てば幸いfirebase依存関係を更新してくださいサービスAPI:

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

これはアプリが65Kのメソッド参照制限を超過する可能性が非常に高いため、Multidexを使用してLollipopより前のデバイスで実行する必要があります。

2つの選択肢があります。実際に必要なPlay Services APIのみを含めることができます。 のセクションのlist is here実行可能ファイルにAPIを選択的にコンパイルする。または、instructions hereの後にMultidexを有効にすることもできます。 build.gradleファイルにはmultiDexEnabled trueがありますが、これはMultidexの設定に必要な3つの手順のうちの1つに過ぎません。依存関係としてライブラリをインクルードし、マニフェストを更新する必要もあります。

Androidスタジオ2.2.2を使用している場合は、APK Analyzerを使用してアプリ内にあるメソッド参照の数を確認できます。メニューバーからBuild> Analyze APKを選択します。 APKはフォルダ.../app/build/outputs/apkにあります。 APKファイルを選択し、結果のウィンドウでclasses.dexをクリックすると、メソッドとメソッド参照の数が表示されます。

+1

私は実際に必要なGoogle Playサービスのみを含んでいます...問題を解決しました...ありがとうございます –

0

dependencies { 
    ... 
    compile 'com.google.firebase:firebase-messaging:9.6.0' 
    ... 
} 
apply plugin: 'com.google.gms.google-services' 

は、この依存関係は、Google Playでのすべてのためのコードが含まれて

+0

ご返信ありがとうございますが、私の問題は解決しませんでした –

関連する問題