大家好,我只是打开我的android工作室,遇到了这些问题,尝试进行研究,但没有找到摆脱这种情况的方法,请帮帮我。
这是我的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
}
这是应用级gradle
应用插件:“ 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'
}
}
}
}
答案 0 :(得分:0)
在项目根文件夹中的gradle.properties文件中,尝试替换以下行
android.enableAapt2 = false
使用
android.enableAapt2 = true
希望这会有所帮助。
答案 1 :(得分:0)
最后找到一个解决方案。
只需添加这两行
jcenter()
mavenCentral()
在App等级Gradel中 并在gradle.properties中
android.enableAapt2 = false