我有以下错误,没有指示哪个资源文件是罪魁祸首
任务执行失败':MyGeneralLibrary:processDebugResources'。
错误:''不是有效的资源名称字符
我尝试使用--stacktrace运行构建但是没有告诉我哪个资源文件是问题。
有没有办法找到问题所在?
编辑:
MyGeneralLibrary构建文件:
apply plugin: 'com.android.library'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.apache.commons:commons-lang3:3.4'
implementation 'com.google.android.gms:play-services-maps:11.6.2'
implementation 'com.google.android.gms:play-services-location:11.6.2'
implementation 'com.google.android.gms:play-services-places:11.6.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'//this also complains see below
implementation 'com.android.support:cardview-v7:27.0.2'
implementation 'com.android.support:support-core-utils:27.0.2'
implementation 'com.android.support:support-fragment:27.0.2'
}
android {
compileSdkVersion 27
}
我的项目构建文件:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url 'https://maven.fabric.io/public' }
}
configurations {
implementation.exclude group: 'com.google.guava'
implementation.exclude module: 'guava:19.0-rc2'
all*.exclude group: 'commons-logging', module: 'commons-logging'
androidTestCompile.exclude group: 'com.google.code.findbugs'
androidTestCompile.exclude module: 'jsr305:2.0.1'
}
dependencies {
//project
implementation project(':MyGeneralLibrary')
implementation fileTree(dir: '../libs', include: '*.jar')
implementation 'com.google.android.gms:play-services-maps:11.6.2'
implementation 'com.google.android.gms:play-services-location:11.6.2'
implementation 'com.google.android.gms:play-services-places:11.6.2'
implementation 'com.google.android.gms:play-services-auth:11.6.2'
implementation 'com.google.android.gms:play-services-plus:11.6.2'
implementation 'com.google.maps.android:android-maps-utils:0.5'
implementation 'com.android.support:support-annotations:27.0.2'
implementation 'org.twitter4j:twitter4j-core:4.0.2'
implementation 'com.facebook.android:facebook-android-sdk:4.10.0'
implementation 'com.github.scribejava:scribejava-apis:2.2.2'
implementation('com.twitter.sdk.android:twitter:1.12.1@aar') {
transitive = true
}
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.android.support:support-v4:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.android.support:multidex:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 27
defaultConfig {
minSdkVersion 15
targetSdkVersion 27
multiDexEnabled true
versionCode 1
versionName "0.1"
applicationId "com.chdryra.android.reviewer"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
sourceSets {
main {
res.srcDirs = ['src/main/res', 'src/androidTest/res']
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE.txt'
}
dexOptions {
javaMaxHeapSize "2g"
}
}
AS抱怨:我认为这是无关的,但我在MyGeneralLibrary gradle文件中有关于recyclerview的其中一行下面有一条红线,cardview和support-media-compat有不同的版本。依赖于我首先同步的构建文件,我有时会得到此错误:
Error:java.lang.RuntimeException: Android dependency 'com.android.support:cardview-v7' has different version for the compile (23.4.0) and runtime (27.0.2) classpath. You should manually set the same version via DependencyResolution
在我更新到AS 3.0之前一切正常,所以对于发生的事情感到茫然。任何指针赞赏!
谢谢, RIZ