简体   繁体   English

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

[英]Android SDK upgrade from 23 to 26 build error

My application was running fine when using SDK version 23. I tried to upgrade it to SDK version 26 but got build errors. 使用SDK版本23时,我的应用程序运行良好。我尝试将其升级到SDK版本26,但出现构建错误。 The build gradle file: 构建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'

The build error I got: 我得到的构建错误:

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. 构建失败8s 664ms运行构建8s 531ms加载构建12ms配置构建110ms计算任务图98ms运行任务8s 307ms指定的Android SDK构建工具版本(26.0.0)被忽略,因为它低于受支持的最低版本(26.0.2)适用于Android Gradle插件3.0.1。 Android SDK Build Tools 26.0.2 will be used. 将使用Android SDK Build Tools 26.0.2。 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. 要取消显示此警告,请从build.gradle文件中删除“ buildToolsVersion '26 .0.0'”,因为每个版本的Android Gradle插件现在都具有默认版本的构建工具。 resource style/TextAppearance.Compat.Notification.Info (aka com.app.application:style/TextAppearance.Compat.Notification.Info) not found. 找不到资源样式/TextAppearance.Compat.Notification.Info(又名com.app.application:style / TextAppearance.Compat.Notification.Info)。 resource style/TextAppearance.Compat.Notification (aka com.app.application:style/TextAppearance.Compat.Notification) not found. 找不到资源样式/TextAppearance.Compat.Notification(又名com.app.application:style / TextAppearance.Compat.Notification)。 resource style/TextAppearance.Compat.Notification.Time (aka com.app.application:style/TextAppearance.Compat.Notification.Time) not found. 找不到资源样式/TextAppearance.Compat.Notification.Time(又名com.app.application:style / TextAppearance.Compat.Notification.Time)。 resource style/TextAppearance.Compat.Notification.Title (aka com.app.application:style/TextAppearance.Compat.Notification.Title) not found. 找不到资源样式/TextAppearance.Compat.Notification.Title(又名com.app.application:style / TextAppearance.Compat.Notification.Title)。 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 java.util.concurrent.ExecutionException:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT2错误:检查日志以获取详细信息java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception :AAPT2错误:检查日志以获取详细信息com.android.tools.aapt2.Aapt2Exception:AAPT2错误:检查日志以获取详细信息

I have read some posts but couldn't fix this issue: Android SDK 26 build error , Failed to resolve: com.android.support:appcompat-v7:27.+ (Dependency Error) 我已经阅读了一些帖子,但无法解决此问题: Android SDK 26构建错误无法解决:com.android.support:appcompat-v7:27。+(依赖关系错误)

How can I resolve this issue? 我该如何解决这个问题?

The problem is in the following line. 问题在下面的行中。

all*.exclude module: 'support-compat'

Remove it and use the following code to exclude support-v4 library. 删除它,并使用以下代码排除support-v4库。

all*.exclude module: 'support-v4'  

or 要么

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

You can also exclude support-v4 from specific library as below: 您还可以从特定库中排除support-v4,如下所示:

compile ('com.jakewharton:butterknife:8.5.1'){
        exclude group: 'com.android.support', module:'support-v4'
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Ionic 3 中的 Android SDK Platform 26 许可证错误 - Android SDK Platform 26 license error in Ionic 3 在Android SDK 23中的Windows 7上启动AVD时出错 - Error in Launching AVD on Windows 7 in Android SDK 23 如何在Ionic Cordova中将Android-SDK 23更新为26? - How can I update Android-SDK 23 to 26 in Ionic Cordova? 从sdk 23降级到22 android - downgrading from sdk 23 to 22 android Android无法完成会话:-26新目标SDK 22不支持运行时权限,但旧目标SDK 23支持运行时权限 - Android Failed to finalize session : -26 new target SDK 22 doesn't support runtime permissions but the old target SDK 23 does Cordova构建(Android SDK平台26,Android SDK构建工具26.0.2) - Cordova build (Android SDK Platform 26, Android SDK Build-Tools 26.0.2) 安装Android SDK 23 - installing android sdk 23 SDK上的Android指纹&lt;23 - Android fingerprint on SDK<23 Android:从API 22升级到API 23后功能中断 - Android: Broken functionality after upgrade from API 22 to API 23 当我们将compileSdkVersion和targetSdkVersion从26更改为23时,为什么Android Studio会在清单文件中引发错误? - Why does Android Studio throw errors in the manifest file when we change the compileSdkVersion and targetSdkVersion from 26 to 23?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM