-1

出现以下错误:

错误:(209, 62) 错误:无法访问 com.google.android.gms.internal.zzbgl 的 zzbgl 类文件未找到

模块分级:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
useLibrary 'org.apache.http.legacy'
defaultConfig {
    applicationId "com.qltech.ql.yupit"
    minSdkVersion 19
    targetSdkVersion 26
    versionCode 7
    versionName "7.0"
    multiDexEnabled true
    testInstrumentationRunner 
    "android.support.test.runner.AndroidJUnitRunner"
}
dexOptions {
    javaMaxHeapSize "4g"
}

buildTypes {
    build {
        ndk {
            abiFilters "arm64-v8a", "armeabi-v7a"
        }
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    release {
        ndk {
            abiFilters "arm64-v8a", "armeabi-v7a"
        }
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    targetCompatibility 1.8
    sourceCompatibility 1.8
}
}
dependencies {
implementation  fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{
    exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation  'com.facebook.android:facebook-login:4.28.0'
implementation  'com.android.support:appcompat-v7:26.+'
implementation  'pl.droidsonroids.gif:android-gif-drawable:1.2.2'
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.android.gms:play-services-analytics:16.0.5"
implementation  'com.pixplicity.easyprefs:library:1.8.1@aar'
implementation  'com.wang.avi:library:2.1.3'
implementation  'com.android.volley:volley:1.0.0'
implementation  'com.android.support:recyclerview-v7:23.2.1'
implementation  'com.android.support:cardview-v7:23.4.0'
implementation  'com.google.code.gson:gson:2.7'
implementation  'de.hdodenhof:circleimageview:2.2.0'
implementation  'com.android.support:design:27.1.1'
implementation  'com.github.bumptech.glide:glide:3.7.0'
implementation  'com.stripe:stripe-android:2.0.2'
implementation  'com.google.firebase:firebase-auth:16.0.6'
implementation  'com.google.firebase:firebase-core:16.0.6'
implementation  'com.squareup.okhttp:okhttp:2.0.0'
implementation  'com.squareup.retrofit:retrofit:1.9.0'
implementation  'com.google.android:flexbox:0.3.0'
implementation  'com.github.lzyzsd:circleprogress:1.2.1'
implementation  'net.gotev:uploadservice:2.1'
implementation  'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
implementation 'com.github.faruktoptas:FancyShowCaseView:1.0.1'
implementation  'com.google.android.gms:play-services-analytics:16.0.1'
implementation  'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
implementation  "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
 apply plugin: 'com.google.gms.google-services'
 repositories {
mavenCentral()
 }

应用程序.gradle;

buildscript {
ext.kotlin_version = '1.2.41'
repositories {
    jcenter()
    google()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.2.0-alpha18'
    classpath 'com.google.gms:google-services:4.2.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
    maven { url "https://jitpack.io" }
    google()
}
}

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

1 回答 1

1

要解决此问题,请将所有compile关键字更改为implementation. 根据我对这篇文章的回答,请评论/删除以下代码行:

//compile 'com.google.android.gms:play-services:12.0.1'

并且只使用:

implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.android.gms:play-services-analytics:16.0.5"

这是有关个人 API 和相应 build.gradle 描述的官方文档。

根据您编辑的问题,还请更改:

classpath 'com.android.tools.build:gradle:3.2.0-alpha18'

classpath 'com.android.tools.build:gradle:3.2.1'

implementation 'com.google.firebase:firebase-core:16.0.5'

implementation "com.google.firebase:firebase-core:16.0.6"
于 2018-12-13T10:39:13.860 回答