在 Android 中更新到 API 26 时,清单合并失败并出现多个错误

2024-06-01

我尝试使用 API 26 更新我的 gradle (安卓工作室2.3.3)。但我在编译项目时遇到以下错误。

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

应用级别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
}

This is my Merged Manifest: enter image description here

如果我删除tools:replace="android:value"来自application标签。我收到以下错误。

enter image description here This is my build.gradle file:

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 file:

    <?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 中添加了谷歌最近引入的新网址。

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


在清单文件中添加以下行应用标签

tools:replace="android:value"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 Android 中更新到 API 26 时,清单合并失败并出现多个错误 的相关文章

随机推荐