android - 未找到 com.google.android.gms.internal.zu 的类文件
问题描述
将所有依赖项更新到最新版本后,错误仍然存在。
构建 Gradle(应用程序):
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public'}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.0.1'
}
Build.gradle(项目):
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.android.support:design:27.1.1'
implementation 'com.firebaseui:firebase-ui:2.0.1'
implementation 'com.google.android.gms:play-services-analytics:16.0.3'
}
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = trueapply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
构建项目后的错误:
error: cannot access zu
class file for com.google.android.gms.internal.zu not found
解决方案
降级某些版本并在两个存储库中添加 maven url。
构建 Gradle(应用程序):
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public'}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public'}
}
}
Build.gradle(项目):
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.**.******"
minSdkVersion 23
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-auth:10.0.1'
implementation 'com.firebaseui:firebase-ui:1.1.1'
implementation 'com.android.support:design:27.1.1'
}
在清单文件中:
android:supportsRtl="false"
推荐阅读
- python - 使用 Django SocialAuth 应用程序时出现模板渲染错误
- javascript - 反应:没有在 {{URL}} 解析样式表,因为在严格模式下不允许非 CSS MIME 类型 & SyntaxError: Unexpected Token '<'
- c++ - 在模板中
It 是一个迭代器的函数,我可以让 It::value_type 对 vector::iterators 和 array::iterators 都有效吗? - javascript - 当局部变量之一包含指定值时,DevTools 是否可以破坏站点 JS?
- javascript - 如何在 React 组件中插入使用 js 创建的 iframe
- c++ - IO 缓冲区有限制吗?
- latex - 防止不必要的乳胶格式化?
- node.js - 创建 nodejs 文件,将数据从 airtable 添加到谷歌表格
- javascript - 使用 HTML 和 Javascript 检测第二个下拉列表(级联)的变化
- javascript - React - 同步路由之间的帖子删除