大家好,我刚刚打开了我的安卓工作室,得到了这些问题,尝试了研究,但没有找到解决这个问题的方法,请帮帮我。
选项“android.enableAapt2”已弃用,不应再使用。使用'android.enableAapt2=true‘删除此警告。它将在2018年底被移除。无法解决: ch.acra:acra:4.9.0在项目结构中显示文件对话框中显示无法解决: com.astuetz:pagerslidingtabstrip:1.0.1在项目结构中显示文件对话框中显示失败解决:uk.co.chrisjenx:书法:2.3.0在项目结构中显示文件对话框中显示失败解决失败: com.mcxiaoke.volley:library:1.0.19在项目结构中显示文件对话框中显示失败解决: com.itextpdf:itextg:5.5.9在项目结构中显示文件对话框中显示失败要解决的问题:org.greenbot:eventbus:3.0.0在项目结构中显示文件对话框中显示失败解决失败: com.adeel:easyFTP:1.0在项目结构中显示文件对话框中显示解决失败: cz.msebera.android:httpclient:4.4.1.2在项目结构中打开文件显示对话框解决失败:com.github.umptech.glide:glide:3.7.0在项目结构对话框中打开文件显示失败解决失败: com.squareup:javawriter:2.1.1在项目结构中打开文件显示对话框失败用法: javax.inject:javax.inject:1在项目结构对话框中打开文件显示失败解决方法失败:org.hamcrest参数:hamcrest-library:1.3在项目结构对话框中打开文件显示失败解决方法失败: org.hamcrest:hamcrest-integration:1.3在项目结构对话框中打开文件显示失败解决: com.google.code.findbugs:jsr305:2.0.1在项目结构对话框中打开文件显示失败解决方法: javax.annotation:javax.annotation-api:1.2在项目结构对话框中打开文件显示失败解决方法: junit:junit:4.12在项目结构对话框中显示文件
这里是我的gradle文件
//顶级构建文件,可以添加所有子项目/模块通用的配置选项。
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url 'https://maven.google.com'
}
/*jcenter()
google()*/
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是应用程序级别的
应用插件:'com.android.application‘
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
multiDexEnabled true
applicationId "com.t4s.apl_test"
minSdkVersion 17
targetSdkVersion 26
versionCode 16
versionName "1.6.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
}
repositories {
maven { url "http://jzaccone.github.io/SlidingMenu-aar" }
maven { url "https://jitpack.io" }
}
}
configurations.all {
// Check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// Volley (HTTP library)
// Crash Reports Library (ACRA)
implementation('ch.acra:acra:4.9.0') {
exclude group: 'org.json'
}
// Volley (HTTP library)
// Volley (HTTP library)
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.3.0'
//compile 'com.jeremyfeinstein.slidingmenu:library:1.3@aar'
implementation 'com.android.support:support-v4:26.3.0'
implementation 'com.android.support:cardview-v7:26.3.0'
implementation 'com.astuetz:pagerslidingtabstrip:1.0.1'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.google.code.gson:gson:2.7'
implementation 'com.mcxiaoke.volley:library:1.0.19'
// compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
implementation 'com.github.PhilJay:MPAndroidChart:v2.1.6'
implementation 'com.itextpdf:itextg:5.5.9'
implementation 'org.greenrobot:eventbus:3.0.0'
testImplementation 'junit:junit:4.12'
//Image Picker
implementation 'com.github.esafirm.android-image-picker:imagepicker:1.7.5'
implementation 'com.adeel:easyFTP:1.0'
implementation files('libs/simpleftp.jar')
implementation group: 'cz.msebera.android' , name: 'httpclient' , version: '4.4.1.2'
implementation 'com.android.support:multidex:1.0.3'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.3.0'
}
}
}
}
发布于 2018-07-10 00:17:21
最后找到一个解决方案。
刚刚添加了这两行
jcenter()
mavenCentral()
在App level gradel和gradle.properties中
android.enableAapt2 = false
发布于 2018-07-07 02:29:01
在位于项目根文件夹中的gradle.properties文件中,尝试替换以下行
android.enableAapt2 = false
使用
android.enableAapt2 = true
希望这能有所帮助。
https://stackoverflow.com/questions/51215739
复制相似问题