Android Question Error Google Play API 31 broadcast receiver Filter Intent

hoshin

Member
Hello.
When I changed the targetSdkVersion to work with api 31, I started to show the following message when I did the
Uploading the app to Google Play:

You've uploaded an APK or Android App Bundle that has an activity, activity alias, service, or broadcast receiver with an intent filter, but no "android:exported" property defined. The file cannot be installed on Android 12 or newer. Visit: developer.android.com/about/versions/12/behavior-changes-12#exported

But if I go to the Manifest, there is the android:exported option defined.
Has anyone experienced this problem?

Below is the Manifest for you to take a look at. See that Manifest is simple, because the app is simple. I don't use anything else on it.

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
AddManifestText(
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:exported="false"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
 
Solution
I performed the B4A update, everything working. But the problem continues. After reading several posts here on the forum about other problems, I discovered that with the line of code below, I managed to solve the problem that api 31 asks and now the app has uploaded to Google Play.

B4X:
SetActivityAttribute(main, android:exported, "true")

Thank you all for your help.

DonManfred

Expert
Licensed User
Longtime User
Note that you need to install a new SDK TOO for the newest B4A Version.

 
Upvote 0

hoshin

Member
I performed the B4A update, everything working. But the problem continues. After reading several posts here on the forum about other problems, I discovered that with the line of code below, I managed to solve the problem that api 31 asks and now the app has uploaded to Google Play.

B4X:
SetActivityAttribute(main, android:exported, "true")

Thank you all for your help.
 
Upvote 0
Solution

Erel

B4X founder
Staff member
Licensed User
Longtime User
The default manifest editor code should be:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="30"/>
<supports-screens android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
 
Upvote 0
Top