我已完成所有操作,但无法解决此错误。 我已经做了,
1-使缓存无效/重新启动。
2-从.AndroidStudio / system / caches删除缓存文件夹
3-更新android studio
4-清理构建并重新启动项目。
没有帮助。
build.gradle(app)
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.agent.Application"
minSdkVersion 19
targetSdkVersion 28
versionCode 68
versionName "3.46"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
dexOptions {
javaMaxHeapSize "4g"
}
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
jcenter()
maven {
url 'https://maven.google.com'
}
}
defaultConfig {
// ...
// resConfigs "auto"
}
}
apply plugin: 'com.android.application'
repositories {
mavenCentral()
maven { url 'http://hypertrack-android-sdk.s3-website-us-west-2.amazonaws.com/' }
maven { url 'https://maven.fabric.io/public' }
google()
jcenter()
maven {
url 'https://maven.google.com'
}
flatDir {
dirs 'libs'
}
maven { url "https://jitpack.io" }
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.github.wangjiegulu:rfab:2.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation project(':framework')
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.github.gcacace:signature-pad:1.2.1'
implementation 'com.github.smart-fun:XmlToJson:1.4.4'
implementation files('libs/eKYC_SDK.aar')
implementation('com.hypertrack:android:0.7.34@aar') {
transitive = true;
}
implementation 'com.weiwangcn.betterspinner:library-material:1.1.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.2@aar') {
transitive = true;
}
implementation 'com.github.douglasjunior.AndroidBluetoothLibrary:BluetoothClassicLibrary:0.3.5'
implementation 'gun0912.ted:tedpermission:1.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.esafirm.android-image-picker:imagepicker:1.10.0'
}
apply plugin: 'com.google.gms.google-services'
这是我的项目级别构建gradle。也可以尝试通过更改google()和jcenter()的顺序来解决该问题
build.gradle(项目)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:3.2.0'
classpath "io.realm:realm-gradle-plugin:5.7.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
maven {
url 'https://maven.google.com/'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
}
}
}
帮助我解决此问题。