Error in meta-data in android manifest while integrating firebase_admob

583

Yesterday i got the same error while adding firebase_admob. In my case, i updated this

from :

classpath 'com.android.tools.build:gradle:3.5.0'

to :

classpath 'com.android.tools.build:gradle:3.5.4'

in my android/build.gradle, and it worked perfectly!

Share:
583
Ajit Kumar Dutta
Author by

Ajit Kumar Dutta

Updated on December 27, 2022

Comments

  • Ajit Kumar Dutta
    Ajit Kumar Dutta over 1 year

    I am using the

    firebase_admob: ^0.11.0+1
    

    I added the meta-data in the manifest file as follows (in the last):

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.aa_store">
        
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
        <application
            android:name="io.flutter.app.FlutterApplication"
            android:label="AA Store"
            android:icon="@mipmap/ic_launcher">
            <provider
        android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
        android:authorities="${applicationId}.flutter_downloader.provider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/provider_paths"/>
    </provider>
            <activity
                android:name=".MainActivity"
                android:launchMode="singleTop"
                android:theme="@style/LaunchTheme"
                android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
                android:hardwareAccelerated="true"
                android:windowSoftInputMode="adjustResize">
                
                <meta-data
                  android:name="io.flutter.embedding.android.NormalTheme"
                  android:resource="@style/NormalTheme"
                  />
                
                <meta-data
                  android:name="io.flutter.embedding.android.SplashScreenDrawable"
                  android:resource="@drawable/launch_background"
                  />
                <intent-filter>
                    <action android:name="android.intent.action.MAIN"/>
                    <category android:name="android.intent.category.LAUNCHER"/>
                </intent-filter>
            </activity>
            <!-- Don't delete the meta-data below.
                 This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
            <meta-data
                android:name="flutterEmbedding"
                android:value="2" />
              <meta-data
                android:name="com.google.android.gms.ads.APPLICATION_ID"
                android:value="here I used my admob id like ca-app-pub- and so"/>
        </application>
    </manifest>
    
    

    While building the app I am getting the following error message in the debug console.

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':app:processDebugResources'.

    A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource linking failed C:\Users\admin.gradle\caches\transforms-2\files-2.1\3159b380b6099786f8f1e3b5a96c779b\play-services-ads-lite-19.7.0\AndroidManifest.xml:27:5-43:15: AAPT: error: unexpected element found in .

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 3m 26s The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility. Building plugin connectivity...

    FAILURE: Build failed with an exception.

    • What went wrong: Task 'assembleAarRelease' not found in root project 'connectivity'.

    • Try: Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 12s

    Exception: The plugin connectivity could not be built due to the issue above.

    I also added the google-services json file in the app level griddle. Please anyone help me to resolve this problem. Thank you