将库导入旧项目并在Android Studio中出错

时间:2017-07-16 14:03:01

标签: android android-studio android-gradle

我将ui-library导入android studio中的旧项目。一切顺利,直到我将compile project(':Android Library'添加到我的app模块的build.gradle中。以下是app和library的build.gradle中的设置。

应用

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
    applicationId "com.chimaera.AppName"
    minSdkVersion 18
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-core-ui:25.3.1'
compile 'com.android.support:design:25.3.1'
compile project(':MaterialDesign')
testCompile 'junit:junit:4.12'

图书馆模块

android {
compileSdkVersion 22
buildToolsVersion '25.0.0'

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
dependencies {
compile 'com.nineoldandroids:library:2.4.+'
compile 'com.android.support:support-v4:22.+'
compile fileTree(dir: 'libs', include: '*.jar')

(我忘了粘贴错误。)以下是错误提示。

enter image description here

enter image description here

它跳转到value.xml似乎与此错误无关。 我将minifyEnabled设置为false以便发布,但将调试设置保持为空白。我是否也需要设置调试。版本设置是否有任何错误导致导入错误?

0 个答案:

没有答案