"Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined"

Hey,
I try to create a android bundle, but i’ve this message :

jar /opt/local/bin/manifestmergetool.jar --platform android --main /tmp/job6754239728298642910/upload/AndroidManifest.xml  --lib /tmp/job6754239728298642910/upload/extension-iap/manifests/android/AndroidManifest.xml  --lib /tmp/.gradle/unpacked/com.android.billingclient-billing-5.0.0.aar/AndroidManifest.xml  --out /tmp/job6754239728298642910/build/AndroidManifest.xml
Dec 01, 2022 8:38:40 PM com.defold.manifestmergetool.ManifestMergeTool$ILoggerWrapper warning
WARNING: /tmp/job6754239728298642910/upload/AndroidManifest.xml Warning:
	Package name 'com.dropInMusic.todo' used in: AndroidManifest.xml, AndroidManifest.xml.
Dec 01, 2022 8:38:40 PM com.defold.manifestmergetool.ManifestMergeTool$ILoggerWrapper error
SEVERE: /tmp/job6754239728298642910/upload/AndroidManifest.xml Error:
	Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
Dec 01, 2022 8:38:40 PM com.defold.manifestmergetool.ManifestMergeTool$ILoggerWrapper warning
WARNING: 
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

Dec 01, 2022 8:38:40 PM com.defold.manifestmergetool.ManifestMergeTool main
SEVERE: java.lang.RuntimeException: Failed to merge manifests: com.android.manifmerger.MergingReport@1460a8c0

I am not sure what to do to solve this problem.

Here is the android file in build\arm64-android :

<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.dropInMusic.todo"
    android:installLocation="auto"
    android:versionCode="16"
    android:versionName="0.1" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="31" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="com.android.vending.BILLING" />

    <application
        android:name="android.support.multidex.MultiDexApplication"
        android:debuggable="false"
        android:hasCode="true"
        android:icon="@drawable/icon"
        android:label="dropInMusic" >
        <meta-data
            android:name="android.max_aspect"
            android:value="2.1" />
        <meta-data
            android:name="android.notch_support"
            android:value="true" />

        <activity
            android:name="com.dynamo.android.DefoldActivity"
            android:configChanges="fontScale|keyboard|keyboardHidden|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
            android:exported="true"
            android:label="dropInMusic"
            android:launchMode="singleTask"
            android:screenOrientation="landscape"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
            <meta-data
                android:name="android.app.lib_name"
                android:value="dropInMusic" />

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <!-- For Amazon IAP -->
        <receiver
            android:name="com.amazon.device.iap.ResponseReceiver"
            android:exported="true"
            android:permission="com.amazon.inapp.purchasing.Permission.NOTIFY" >
            <intent-filter>
                <action android:name="com.amazon.inapp.purchasing.NOTIFY" />
            </intent-filter>
        </receiver>

        <meta-data
            android:name="com.google.android.play.billingclient.version"
            android:value="5.0.0" />

        <activity
            android:name="com.android.billingclient.api.ProxyBillingActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    </application>

</manifest> <!-- END_INCLUDE(manifest) -->

Or txt file :
AndroidManifest.zip (1.0 KB)

If you have an idea on how to solve this problem, I’m interested.

Thanks for advance. :slight_smile:

Lecricreator

Which version of Defold are you using? 1.4.0?
With 1.4.0 try these steps:

  1. Bundle an empty application for Android. Does it work?
  2. Download the extension-iap project and bundle? Does it work?
  3. Compare your own project with the sample project included with extension-iap. What are the differences?
  4. Scale down your own project by removing extensions one by one. When does it start working and why?

Edit the manifest.

...
<intent-filter>
   <action 
           android:name="android.intent.action.MAIN"
           android:exported="true" />
...
1 Like

Mmmmh, i’ve another problem (i think it’s ridiculous).


aapt2 compile /tmp/job5784487495078431237/upload/packages/com.defold.android/res/drawable-hdpi/icon.png -o /tmp/job5784487495078431237/build/compiledResources/com.defold.android

aapt2 compile /tmp/job5784487495078431237/upload/packages/com.defold.android/res/drawable-ldpi/icon.png -o /tmp/job5784487495078431237/build/compiledResources/com.defold.android

aapt2 compile /tmp/job5784487495078431237/upload/packages/com.defold.android/res/drawable-xhdpi/icon.png -o /tmp/job5784487495078431237/build/compiledResources/com.defold.android

aapt2 compile /tmp/job5784487495078431237/upload/packages/com.defold.android/res/drawable-xxhdpi/icon.png -o /tmp/job5784487495078431237/build/compiledResources/com.defold.android

aapt2 compile /tmp/job5784487495078431237/upload/packages/com.defold.android/res/drawable-mdpi/icon.png -o /tmp/job5784487495078431237/build/compiledResources/com.defold.android

aapt2 link  --proto-format --non-final-ids --auto-add-overlay --manifest /tmp/job5784487495078431237/build/AndroidManifest.xml -I /var/extender/sdk/f4a699eb412a2445e894568f2d7466aba61b4c41/defoldsdk//ext/share/java/android.jar --java /tmp/job5784487495078431237/build/out_java -o /tmp/job5784487495078431237/build/compiledresources.apk --emit-ids /tmp/job5784487495078431237/build/resource_ids.txt -R @/tmp/job5784487495078431237/build/compiledresources.txt
/tmp/job5784487495078431237/build/AndroidManifest.xml:12: error: resource mipmap/ic_launcher (aka com.dropInMusic.todo:mipmap/ic_launcher) not found.
error: failed processing manifest.

What’s the problem ?

Is your game.project still similar to your first post?

Maybe try to put a / at the beginning of your Bundle Resources path. ie. /bundle instead of bundle/.

I’m on Windows also, and I know it works when you start with a slash. Never tried without, but it wouldn’t shock me if that’s the issue.

1 Like

Looks like you are missing an icon (mipmap/ic_launcher)?