android - 在 android 中更新到 API 26 时 list 合并失败并出现多个错误

标签 android android-gradle-plugin

我尝试使用 API 26 (Android Studio 2.3.3) 更新我的 gradle。但是在编译项目时出现以下错误。

这是我收到的错误的屏幕截图:

enter image description here

应用层build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath "io.realm:realm-gradle-plugin:3.5.0"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://jitpack.io' }
        maven { url "https://maven.google.com" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

这是我的合并 list : enter image description here

如果我从 application 标签中删除 tools:replace="android:value" 。我遇到错误。

enter image description here 这是我的 build.gradle 文件:

apply plugin: 'com.android.application'
apply plugin: 'realm-android'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "com.ignite.a01hw909350.kolamdemo"
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        ndk {
            abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    aaptOptions {
        noCompress 'KARMarker'
        noCompress 'armodel'
    }

}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile project(':KudanAR')
    compile "com.android.support:support-compat:26.0.2"
    compile 'com.android.support:appcompat-v7:26.0.2'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.volley:volley:1.0.0'
    compile 'nl.dionsegijn:konfetti:1.0.2'
    compile 'me.zhanghai.android.materialprogressbar:library:1.4.1'
    compile 'io.palaima:smoothbluetooth:0.1.0'
    compile 'com.android.support:recyclerview-v7:26.0.2'
    compile 'com.afollestad.material-dialogs:core:0.9.3.0'
    compile 'com.flurgle:camerakit:0.9.17'
    compile 'com.github.zhukic:sectioned-recyclerview:1.0.0'
    compile 'com.android.support:cardview-v7:26.0.2'
    compile 'com.prolificinteractive:material-calendarview:1.4.3'
    compile 'com.github.bumptech.glide:glide:3.8.0'
    compile 'com.android.support:design:26.0.2'
    compile 'com.github.barteksc:android-pdf-viewer:2.4.0'
    compile 'org.rajawali3d:rajawali:1.1.668@aar'
    compile 'com.tapadoo.android:alerter:2.0.0'
    compile 'com.google.android.gms:play-services-location:11.0.4'
    compile 'com.github.GoodieBag:ProtractorView:v1.2'
    compile 'com.android.support:gridlayout-v7:26.0.2'
    compile 'com.stepstone.stepper:material-stepper:3.3.0'
    compile 'pub.devrel:easypermissions:0.4.3'
    compile 'com.intuit.sdp:sdp-android:1.0.4'
    compile 'com.github.apl-devs:appintro:v4.2.2'
    compile 'com.airbnb.android:lottie:2.2.5'
    testCompile 'junit:junit:4.12'
}

这是我的 Manifest.xml 文件:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.ignite.a01hw909350.kolamdemo">

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

    <supports-screens android:requiresSmallestWidthDp="320" />
    <supports-screens android:xlargeScreens="true" />

    <application
        android:name=".AppController"
        android:allowBackup="true"
        tools:replace="android:value"
        android:hardwareAccelerated="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <!-- <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> -->
        <activity
            android:name=".ARCameraActivity"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="fullSensor" />
        <activity
            android:name=".RegistrationActivity"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name=".LoginActivity"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name=".SplashActivity"
            android:screenOrientation="portrait">

            <!-- android:theme="@style/SplashTheme"> -->
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".MenuActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name=".ScanAndDrawActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name=".GalleryActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name=".PdfKolamActivity"
            android:screenOrientation="portrait" />

        <service
            android:name=".BluetoothService"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="com.ignite.a01hw909350.kolamdemo.BluetoothService" />
            </intent-filter>
        </service>

        <receiver
            android:name=".MyScheduleReceiver"
            android:enabled="true">
            <intent-filter>
                <action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
            </intent-filter>
        </receiver>

        <activity
            android:name=".BotDialogActivity"
            android:launchMode="singleInstance"
            android:noHistory="true"
            android:theme="@style/AppTheme" />
        <activity android:name=".ModelActivity" />
        <activity android:name=".PanchangActivity" />
        <activity android:name=".LoadLevelActivity" />

        <receiver
            android:name=".MyStartServiceReceiver"
            android:exported="true" />

        <service
            android:name=".services.AlarmService"
            android:enabled="true">
            <intent-filter>
                <action android:name="NOTIFICATION_SERVICE" />
            </intent-filter>
        </service>

        <receiver
            android:name=".BootReceiver"
            android:enabled="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.intent.action.QUICKBOOT_POWERON" />
            </intent-filter>
        </receiver>
        <activity android:name=".CurrentPanchangActivity" />
        <activity android:name=".FragmentDemoActivity" />
        <activity
            android:name=".VideoPlayerActivity"
            android:screenOrientation="landscape" />
        <activity android:name=".IntroActivity"/>
    </application>

</manifest>

我还在我的应用程序级别 gradle 中添加了谷歌最近引入的新 url。

我的 Manifest.xml 有什么问题。在更新到 API 26 之前,我从未遇到过这样的错误。可能的解决方案是什么?

最佳答案

在 list 文件的应用程序标签

中添加以下行
tools:replace="android:value"

关于android - 在 android 中更新到 API 26 时 list 合并失败并出现多个错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46443975/

相关文章:

Android webView 在后台加载

android - 为什么我的带有 ItemTouchHelper 的 RecyclerView 在重写 getItemViewType() 之后仅在一项后停止拖动?

Android Studio 项目编码错误

groovy - 请解释一下Android build.gradle groovy语法

android - 奇怪的 SQLiteException 并非在所有设备中

android - 一个项目下多个Android应用模块

android - gradle.xml 在平台之间不一致

android - 为什么我应该将 aar 文件中的依赖项添加到我的项目中?

android - 为android中的每种风格替换一个XML文件

android - 运行时配置更改后 DialogFragment 变为 null