Ошибка слияния с несколькими ошибками123

Когда я пытаюсь перестроить проект, андроид-студия дает ошибку: я не мог решить эту проблему в течение 2 дней, пожалуйста, помогите. Какие изменения я должен внести?

`` Выполнение не выполнено для задачи ': app: processDebugManifest'.

Я пробовал все решения для подобных проблем:

введите ссылку здесь

введите ссылку здесь

мой градиент построения

    buildscript {
    repositories {
        maven { url 'https://plugins.gradle.org/m2/'}
    }
    dependencies {
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.11.0, 0.99.99]'
    }
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

repositories {
    maven { url 'https://maven.google.com' }
}


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

android {
    //the compression of webp file during build causes problem with FileDescriptor in ContentProvider.
    aaptOptions {
        noCompress "webp"
    }
    signingConfigs {
        signing_config {
            keyAlias 'abc'
            keyPassword 飓'
        }
    }
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.whatsapp.fenerstickers"
        minSdkVersion 18
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        def contentProviderAuthority = applicationId + ".stickercontentprovider"
        // Creates a placeholder property to use in the manifest.
        manifestPlaceholders =
                [
                        onesignal_app_id: 'XXXXXXX',
                        // Project number pulled from dashboard, local value is ignored.
                        onesignal_google_project_number: 'REMOTE'
                ]
                [contentProviderAuthority: contentProviderAuthority]
        // Adds a new field for the authority to the BuildConfig class.
        buildConfigField("String",
                "CONTENT_PROVIDER_AUTHORITY",
                ""${contentProviderAuthority}"")
    }
    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

task checkDebug {
    doLast {
        println("checkDebug")
        if (android.defaultConfig.applicationId.startsWith("com.whatsapp")) {
            throw new GradleException("applicationId in defaultConfig cannot start with com.whatsapp, please change your applicationId in app/build.gradle");
        }
        checkApplicationIdInDebug()
    }
}

private void checkApplicationIdInDebug() {
    Properties properties = new Properties()
    properties.load(project.rootProject.file('local.properties').newDataInputStream())
    def ignoreApplicationIdCheck = properties.getProperty('ignoreApplicationIdCheck')
    if (ignoreApplicationIdCheck == null) {

    } else {
        println("application id check ignored")
    }
}


task checkRelease {
    doLast {
        println("checkRelease")
        if (android.defaultConfig.applicationId.startsWith("com.example")) {
            throw new GradleException("applicationId in defaultConfig cannot start with com.example, please change your applicationId in app/build.gradle");
        }
    }
}

tasks.whenTaskAdded { task ->
    println(task.name)
    if (task.name.contains("assembleDebug")) {
        task.dependsOn checkDebug
    }
    if (task.name.contains("assembleRelease")) {
        task.dependsOn checkRelease
    }
}


dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.facebook.fresco:fresco:1.10.0'
    implementation 'com.facebook.fresco:webpsupport:1.10.0'
    implementation 'com.facebook.fresco:animated-webp:1.10.0'
    implementation 'com.facebook.fresco:webpsupport:1.10.0'
    implementation 'com.google.android.gms:play-services-ads:11.8.0'
    implementation 'com.google.firebase:firebase-ads:11.8.0'
    implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'


}

мои проявления

<?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.main.berk">


    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>


    <application
        android:allowBackup="false"
        android:fullBackupContent="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:ignore="GoogleAppIndexingWarning">
        <activity android:name=".EntryActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".StickerPackListActivity"
            android:label="@string/title_activity_sticker_packs_list" />
        <activity
            android:name=".StickerPackDetailsActivity"
            android:parentActivityName=".StickerPackListActivity"
            tools:ignore="UnusedAttribute">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.main.berk.StickerPackListActivity" />
        </activity>
        <activity
            android:name=".StickerPackInfoActivity"
            android:label="@string/title_activity_sticker_pack_info"
            android:parentActivityName=".StickerPackDetailsActivity"
            tools:ignore="UnusedAttribute">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.main.berk.StickerPackDetailsActivity" />
        </activity>

        <provider
            android:name=".StickerContentProvider"
            android:authorities="${contentProviderAuthority}"
            android:enabled="true"
            android:exported="true"
            android:readPermission="com.whatsapp.sticker.READ" />
    </application>
</manifest>

Слияние ошибок:

Error: Attribute provider#com.main.berk.StickerContentProvider@authorities at AndroidManifest.xml:48:13-62 requires a placeholder substitution but no value for <contentProviderAuthority> is provided. app main manifest (this file), line 47 Error: Validation failed, exiting app main manifest (this file)

Всего 1 ответ


Вам просто нужно объединить несколько массивов manifestPlaceholders в одном подобном

manifestPlaceholders =
            [
                    // WhatsApp Placeholder
                    contentProviderAuthority: contentProviderAuthority,
                    onesignal_app_id: 'XXXXXXX',
                    // Project number pulled from dashboard, local value is ignored.
                    onesignal_google_project_number: 'REMOTE'
            ]

Есть идеи?

10000