Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

173
Views
Cordova Android with Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported`

I am compiling an update for my app for devices with android version 12.

I am making use of Cordova/phonegap

When i increase the API Level to 31 and compile I get an exception

Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported`

When reting to compile for android 12

and so I had a google search to see what the error meant

I found the below link which a gives a solution as to what the error is and how it can be solved

Explicitly define the android:exported attribute on the Activty within the AndroidManifest.

https://github.com/apache/cordova-android/pull/1372

and so I carried out this process of updating my AndroidManifest with "android:exported"

see as below

<?xml version='1.0' encoding='utf-8'?>
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:exported="true" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@style/Theme.AppCompat.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    
    
    </application>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

But then came with a much more bigger error

**An exception has occurred in the compiler (1.8.0_265). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates.**

Next error after updating android manifest file

please how can compile my app for android 12 without these errors?

I'm working with cordova 11.0.0

 <preference name="phonegap-version" value="cli-11.0.0" />     <preference name="android-minSdkVersion" value="22" />     <preference name="android-maxSdkVersion" value="31" />     <preference name="android-targetSdkVersion" value="31" />

Please help

7 months ago ยท Juan Pablo Isaza
Answer question
Find remote jobs