User Tag List

Results 1 to 4 of 4

Thread: Can't export using Android API 31. android:exported error

  1. #1
    Clicker Fusion 2.5Android Export ModuleiOS Export ModuleSWF Export Module
    leightonw87's Avatar
    Join Date
    Jan 2012
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Can't export using Android API 31. android:exported error

    Hi, does anyone know how to fix this, I'm trying to export my app as an Android bundle targeting API 31 and it gives me a manifest error.

    Code:
    Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
    Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
    Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
    Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
    Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
    Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
    Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
    Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
    > Task :app:preBuild UP-TO-DATE
    > Task :app:preReleaseBuild UP-TO-DATE
    > Task :app:compileReleaseAidl NO-SOURCE
    > Task :app:compileReleaseRenderscript NO-SOURCE
    > Task :app:generateReleaseBuildConfig
    > Task :app:javaPreCompileRelease
    > Task :app:writeReleaseApplicationId
    > Task :app:analyticsRecordingRelease
    > Task :app:checkReleaseAarMetadata
    > Task :app:generateReleaseResValues
    > Task :app:generateReleaseResources
    > Task :app:createReleaseCompatibleScreenManifests
    > Task :app:extractDeepLinksRelease
    
    > Task :app:processReleaseMainManifest FAILED
    C:\Users\willi\AppData\Local\Temp\And5398.tmp\app\src\main\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.
    
    See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
    
    
    > Task :app:mergeReleaseResources
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:processReleaseMainManifest'.
    > Manifest merger failed : 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.
    
    * 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 8s
    10 actionable tasks: 10 executed
    I've checked the manifest in the runtime folder and android:exported="true" is already included, I'm using build API 33, targeting API 31 and minimum is API 24.

    I have been told on discord about a Android manifest extension but can't find it where I have searched and don't know how to fix this.

    Google requires apps targeting API 31 and I can't upload it to the Play Store.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    VBEinc's Avatar
    Join Date
    Oct 2015
    Posts
    986
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by leightonw87 View Post
    Hi, does anyone know how to fix this...
    I know when I had to reinstall Fusion again. I had issues similar to this, Thanks to the Latest Android Studio Version not working properly out of the box. It took me awhile to track down the issue, but it was the Latest version of the Android Studio that caused mine. I simply uninstalled that version and ran an older version to install the proper Android Files.

    I am running Android Studio Dolphin | 2021.3.1 Beta 1Build #AI-213.7172.25.2113.8565817, built on May 10, 2022
    Runtime version: 11.0.13+0-b1751.21-8125866 amd64
    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
    Windows 10 10.0
    GC: G1 Young Generation, G1 Old Generation
    Memory: 1280M
    Cores: 4
    Registry:
    external.system.auto.import.disabled=true
    ide.text.editor.with.preview.show.floating.toolbar =false

    I am building with MMF2.5DEV 294.14
    BUILD API 33
    Minimum Android 4.4
    Target 12

    I also Installed the Latest Android Exporter update as well.
    293.1 Android Exporter

    That fixed my issues and I was able to build .aab and .apk with no problems afterwards.

  3. #3
    Clicker Fusion 2.5Android Export ModuleiOS Export ModuleSWF Export Module
    leightonw87's Avatar
    Join Date
    Jan 2012
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Found the issue

    I found what was causing the issue, turns out it was the Amazon in-app purchases extension causing the issue, I took a look at the generated AndroidManifest.xml file and it had intent-filter without the android:exported line.

    Code:
    <?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="indie.lwcreations.ballblock2"
          android:versionCode="1"
          android:versionName="1.0.0"
          android:installLocation="auto">
    	  
        <uses-feature android:name="android.software.leanback" android:required="false" />
    
    	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <!-- Permissions -->
        
    			<supports-screens android:smallScreens="false"
    			
    			android:largeScreens="true"
    			android:xlargeScreens="true"
    			android:requiresSmallestWidthDp="320"
    		android:anyDensity="true"
    		android:resizeable="true"
     />
    <application android:icon="@mipmap/ic_launcher" android:largeHeap="true" android:allowBackup="false"
    		android:networkSecurityConfig="@xml/network_security_config"
    		android:hardwareAccelerated="true"
    		android:exported="true"
    		android:requestLegacyExternalStorage="${Legacy}"
    		android:theme="@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen"
    		android:label="@string/app_name" android:allowTaskReparenting="true">
    	
            	<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID"
    	      	android:value="ca-app-pub-3924118543082711~3967361402" />
    <activity
    			android:name=".Main"
    			android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize"
    			android:label="@string/app_name"
    			android:exported="true"
    			android:launchMode="singleTask"
    			android:screenOrientation="portrait"
    			android:theme="@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen"> 
    			<intent-filter>
    				android:exported="true"
    				<action android:name="android.intent.action.MAIN" />
    				<category android:name="android.intent.category.LAUNCHER"/>
    				<!-- Launcher_Intent -->
    				<category android:name="tv.ouya.intent.category.GAME"/>
         				<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
    				<!-- M_Intent -->
    			</intent-filter>
    		<!-- Main -->
    		</activity>
    		<!-- Activities -->
    		<meta-data android:name="FUSION_ID" android:value="34526289112" />
    		<provider
    			android:name="androidx.core.content.FileProvider"
    			android:authorities="${applicationId}.provider"
    			android:exported="true"
    			android:grantUriPermissions="true">
    			<meta-data
    				android:name="android.support.FILE_PROVIDER_PATHS"
    				android:resource="@xml/provider_paths"/>
    		</provider>
    		<!-- Provider -->
    
    	<activity android:name="com.chartboost.sdk.CBImpressionActivity"
    				android:excludeFromRecents="true"
    				android:hardwareAccelerated="true"
    				android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
    				android:configChanges="keyboardHidden|orientation|screenSize"/>
    <receiver android:name = "com.amazon.device.iap.ResponseReceiver" >
    	<intent-filter>
    		<action android:name = "com.amazon.inapp.purchasing.NOTIFY"
    				android:permission = "com.amazon.inapp.purchasing.Permission.NOTIFY" />
    	</intent-filter>
    	</receiver>
    </application>
    </manifest> 
    <!-- IsAndroidX -->
    Looking through the extension files and looks like it's something I can't fix myself, perhaps my extension needs updating.

    EDIT: I checked on Clickstore and the Amazon in-app purchases extension hasn't been updated in awhile.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    VBEinc's Avatar
    Join Date
    Oct 2015
    Posts
    986
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by leightonw87 View Post
    I found what was causing the issue
    Seems about right. I am having an Issue with the Bluetooth Object. I was told there is a new version, yet I have no way to download it from the clickstore.
    I even put in a Support ticket. No luck yet!
    Days like these that make a Developer want try other Engines. Unreal 5.2 for example.

Similar Threads

  1. Export Error Android
    By ciaciosacchetti in forum Android Export Module 2.5
    Replies: 14
    Last Post: 29th January 2022, 05:18 PM
  2. Export To Android Error
    By Microline_Games in forum Fusion 2.5
    Replies: 7
    Last Post: 22nd October 2016, 12:22 PM
  3. Error to export on Android (APK)
    By salih in forum Android Export Module 2.5
    Replies: 20
    Last Post: 2nd October 2016, 12:14 AM
  4. error on android export
    By chubbybarbarian in forum Android Export Module 2.5
    Replies: 1
    Last Post: 2nd September 2016, 02:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •