2017-05-09 65 views
0

Android工作室構建問題Google登錄和Firebase最新版本10.2.4 谷歌登錄工作正常,直到我已將Firebase jar放入gradle並投擲「錯誤:(149,28)無法在源文件,導入的插件庫或類路徑中找到com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable類型「 下面是應用程序級別構建 apply plugin:'com .android.application」Android工作室構建問題Google登錄和Firebase最新版本10.2.4

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "viksit.com.viksit.pro.viksitpro" 
     minSdkVersion 15 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
     jackOptions { 
      enabled true 
     } 
     compileOptions { 
      sourceCompatibility JavaVersion.VERSION_1_8 
      targetCompatibility JavaVersion.VERSION_1_8 
     } 
    } 

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

    dependencies { 
     compile fileTree(include: ['*.jar'], dir: 'libs') 
     androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') { 
      exclude group: 'com.android.support', module: 'support-annotations' 
     } 

     android { 
      useLibrary 'org.apache.http.legacy' 
     } 
     compile project(':linkedin-sdk') 

     compile(group: 'org.simpleframework', name: 'simple-xml', version: '2.7.1') { 
      exclude group: 'xpp3', module: 'xpp3' 
     } 

     compile('com.udojava:EvalEx:1.0') { 
      exclude group: 'junit', module: 'junit' 
     } 


     compile 'com.google.code.gson:gson:2.8.0' 
     compile 'com.android.support:appcompat-v7:25.0.2' 
     compile 'com.android.support.constraint:constraint-layout:1.0.2' 
     compile 'com.squareup.picasso:picasso:2.5.2' 
     compile 'com.facebook.android:facebook-android-sdk:4.18.0' 
     compile 'com.afollestad.material-dialogs:commons:0.9.4.2' 
     compile 'com.google.firebase:firebase-database:10.2.4' 
     compile 'com.google.firebase:firebase-core:10.2.4' 
     compile 'com.google.firebase:firebase-auth:10.2.4' 
     compile 'com.google.android.gms:play-services-auth:10.2.4' 
     compile 'com.google.gms:google-services:3.0.0' 
     compile 'com.android.support:support-v4:25.0.2' 
     compile 'com.felipecsl:gifimageview:2.1.0' 
     compile 'me.itangqi.waveloadingview:library:0.3.5' 
     compile 'org.apache.directory.studio:org.apache.commons.io:2.4' 
     compile 'com.github.siyamed:android-shape-imageview:[email protected]' 
     compile 'com.android.support:design:25.3.0' 
     compile 'com.github.vipulasri:timelineview:1.0.5' 
     compile 'com.jaredrummler:material-spinner:1.1.0' 
     compile 'com.bignerdranch.android:expandablerecyclerview:3.0.0-RC1' 
     compile 'com.truizlop.sectionedrecyclerview:library:1.2.0' 
     compile 'com.github.castorflex.verticalviewpager:library:19.0.1' 
     compile 'link.fls:swipestack:0.3.0' 
     compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.3' 
     compile 'com.github.bumptech.glide:glide:3.7.0' 
     compile 'com.mikhaellopez:circularimageview:3.0.2' 
     compile 'com.theartofdev.edmodo:android-image-cropper:2.3.+' 
     testCompile 'junit:junit:4.12' 
    } 
下面

是項目級的build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.1' 
     classpath 'com.google.gms:google-services:3.0.0' 


    } 
} 

allprojects { 
    repositories { 
     jcenter() 

    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 
+0

你把'gms:google-services:3.0.0''放在錯誤的地方......它不是應用程序依賴。它在底部。並且您的支持庫版本不匹配 –

回答

2

看起來你跳過這一步

apply plugin: 'com.google.gms.google-services' line be at the bottom of your app/build.gradle file

https://developers.google.com/android/guides/google-services-plugin

旁註:您有Glide和Picasso,雙向gif可繪製庫以及兩個異形圖像庫。每一對都做同樣的事情。清理你的依賴關係,以減少你的應用程序大小和出錯的機率

+0

嘗試但面臨同樣的問題:( –

+0

錯誤:(149,28)com.google類型。 android.gms.common.internal.safeparcel.AbstractSafeParcelable無法在源文件,導入的插孔庫或類路徑中找到 –

+0

嗯,我認爲問題並非Firebase。'android.gms.common'不是Firebase包 –

0

我與昨天火力點一個類似的問題,這爲我工作: 只需將它添加到gradle這個文件,並重建它:

android { 
.... 
dexOptions { 
    // Prevent OutOfMemory with MultiDex during the build phase 
    javaMaxHeapSize "4g" 
    } 
} 
+1

得到此錯誤:(149,28)在源文件,導入的插座庫或類路徑中找不到類型com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable –

+0

該庫沒有被正確下載,這是一個firebase框架問題,試試我的解決方案,如果可能的話,清理並重建一次.. –