Lil*_*a J 9 android gradle firebase google-play-services
每当我尝试在Android Studio 3.1.2中运行程序时,我都会收到此错误.
已存在的程序类型:com.google.android.gms.common.util.VisibleForTesting消息{kind = ERROR,text =程序类型已存在:com.google.android.gms.common.util.VisibleForTesting,sources = [未知来源文件],工具名称= Optional.of(D8)}
我的gradle模块应用程序:
buildscript {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Run Code Online (Sandbox Code Playgroud)
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
maven {
url "https://maven.fabric.io/public"
}
}
Run Code Online (Sandbox Code Playgroud)
}
task clean(type: Delete) {
delete rootProject.buildDir
Run Code Online (Sandbox Code Playgroud)
}
这是我的Gradle模块应用程序
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "myproject"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Run Code Online (Sandbox Code Playgroud)
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
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'enter code here
// FirebaseUI for Firebase Auth
implementation 'com.firebaseui:firebase-ui-auth:3.3.1'
implementation 'com.google.firebase:firebase-auth:15.0.0'
//Firebase RealTime Database
implementation 'com.google.firebase:firebase-database:15.0.0'
// FirebaseUI for Cloud Storage
implementation 'com.firebaseui:firebase-ui-storage:3.3.1'
implementation 'com.google.firebase:firebase-storage:15.0.0'
//circleimageView
implementation 'de.hdodenhof:circleimageview:2.1.0'
//Libreria utilizada para medir dimension de layout de chat cuando cambia de tamaño
implementation 'net.the4thdimension:android-utils:2.0.4'
//To scale every screen sizes , sp
implementation 'com.intuit.sdp:sdp-android:1.0.5'
//authenticacion para formato de numero de telefono
implementation 'com.googlecode.libphonenumber:libphonenumber:8.4.2'
implementation 'com.weiwangcn.betterspinner:library-material:1.1.0'
implementation 'com.amitshekhar.android:android-networking:1.0.0'
//Volley
implementation 'com.android.volley:volley:1.0.+'
implementation 'org.apache.commons:commons-lang3:3.6'
Run Code Online (Sandbox Code Playgroud)
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
小智 7
如果更新谷歌的gradle玩插件版本到最新版本后问题依然存在,搜索在使用Android Studio的文件搜索整个项目指定的文件,并查找具有相同的包名称的搜索。问题在于,具有相同软件包和文件名的文件存在于两个不同的jar中(在我的情况下,其中一个jar是旧的google Analytics(分析)服务jar,已手动下载并添加为项目中的库)。请检查图像的清晰度。我们必须解决此冲突(由于不再需要我已删除了旧的jar),因此该项目得以建立。
Firebase Android SDK现在具有独立的版本号,允许更频繁、灵活的更新。
将google play gradle插件版本更新到最新版本,目前为3.3.0。
classpath 'com.google.gms:google-services:3.3.0'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8755 次 |
| 最近记录: |