gpt4 book ai didi

android - Android SDK从23升级到26构建错误

转载 作者:行者123 更新时间:2023-12-03 05:09:06 30 4
gpt4 key购买 nike

使用SDK版本23时,我的应用程序运行良好。我尝试将其升级到SDK版本26,但出现构建错误。构建gradle文件:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion '26.0.0'
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/CHANGES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
defaultConfig {
applicationId "com.futuremobilitylabs.incentrip"
minSdkVersion 19
targetSdkVersion 26
versionCode 82
versionName "0.8.113"
multiDexEnabled true
testInstrumentationRunner "com.android.test.runner.MultiDexTestRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "2048M"
}
configurations {
all*.exclude module: 'mediarouter-v7'
all*.exclude module: 'support-compat'
compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}
productFlavors {
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
// http://jakewharton.github.io/butterknife/
// https://github.com/daimajia/AndroidSwipeLayout
//compile "com.daimajia.swipelayout:library:1.2.0@aar"
compile 'ch.acra:acra:4.9.1'
compile 'com.android.support:appcompat-v7:26.0.0'
compile 'com.android.support:design:26.0.0'
compile 'com.android.support:recyclerview-v7:26.0.0'
compile 'com.android.support:support-v4:26.0.0'
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.android.gms:play-services:10.2.0'
compile 'com.google.android.gms:play-services-gcm:10.2.0'
compile 'com.google.android.gms:play-services-ads:10.2.0'
compile 'com.google.android.gms:play-services-auth:10.2.0'
compile 'com.google.maps.android:android-maps-utils:0.3.+'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.jakewharton:butterknife:8.5.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.uber.sdk:rides-android:0.5.3'
compile 'com.google.code.gson:gson:2.8.1'
compile 'org.jsoup:jsoup:1.10.3'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
}




apply plugin: 'com.google.gms.google-services'

我得到的构建错误:

build failed 8s 664ms Run build 8s 531ms Load build 12ms Configure build 110ms Calculate task graph 98ms Run tasks 8s 307ms The specified Android SDK Build Tools version (26.0.0) is ignored, as it is below the minimum supported version (26.0.2) for Android Gradle Plugin 3.0.1. Android SDK Build Tools 26.0.2 will be used. To suppress this warning, remove "buildToolsVersion '26.0.0'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools. resource style/TextAppearance.Compat.Notification.Info (aka com.app.application:style/TextAppearance.Compat.Notification.Info) not found. resource style/TextAppearance.Compat.Notification (aka com.app.application:style/TextAppearance.Compat.Notification) not found. resource style/TextAppearance.Compat.Notification.Time (aka com.app.application:style/TextAppearance.Compat.Notification.Time) not found. resource style/TextAppearance.Compat.Notification.Title (aka com.app.application:style/TextAppearance.Compat.Notification.Title) not found. failed linking references.
java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details



我已经阅读了一些帖子,但无法解决此问题: Android SDK 26 build errorFailed to resolve: com.android.support:appcompat-v7:27.+ (Dependency Error)

我该如何解决这个问题?

最佳答案

问题在下面的行中。

all*.exclude module: 'support-compat'

删除它,并使用以下代码排除support-v4库。
all*.exclude module: 'support-v4'  

要么
all*.exclude group: 'com.android.support', module: 'support-v4'  

您还可以从特定库中排除support-v4,如下所示:
compile ('com.jakewharton:butterknife:8.5.1'){
exclude group: 'com.android.support', module:'support-v4'
}

关于android - Android SDK从23升级到26构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51246306/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com