Android Question upgrading to sdkversion 35 problem

sdixon

Member
Licensed User
Longtime User
This is the reference in my manifest

<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="35"/>

compiles fine but when it installs using usb debugging I get the following error

Installing file to device. Error
adb.exe: failed to install dtc.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1111540719.tmp/base.apk (at Binary XML file line #169): com.google.android.gms.measurement.AppMeasurementReceiver: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]

What am I missing?
Thanks
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

sdixon

Member
Licensed User
Longtime User
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="35"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@android:style/Theme.DeviceDefault")

'End of default text.

'SetActivityAttribute(main, android:exported, "true")
'SetReceiverAttribute(fileprovider, android:exported, "true")
'SetReceiverAttribute(starter, android:exported, "true")

#IF TRIAL
AddReplacement($ADMOB_APP_ID$, removed code)
#END IF

SetApplicationAttribute(android:theme, "@style/MyAppTheme")

CreateResource(values, theme.xml,
<resources>
<style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#0098FF</item>
<item name="colorPrimaryDark">#007CF5</item>
<item name="colorAccent">#AAAA00</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
</resources>
)
CreateResource(values, theme.xml,
<resources>
<style name="MyAppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
</style>
</resources>
)
AddApplicationText(
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="$PACKAGE$.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
)
CreateResource(xml, provider_paths,
<files-path name="name" path="shared" />
)
AddApplicationText(
<activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="false"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version" />
)


'************ Firebase Base ************
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile("google-services", "google-services.json")
AddPermission(android.permission.ACCESS_NETWORK_STATE)
AddPermission(android.permission.INTERNET)
AddPermission(android.permission.WAKE_LOCK)
AddPermission(com.google.android.c2dm.permission.RECEIVE)
AddPermission(${applicationId}.permission.C2D_MESSAGE)
AddManifestText( <permission android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature" />)
AddApplicationText(
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.measurement.UPLOAD"/>
</intent-filter>
</receiver>

<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false"/>
<provider
android:authorities="${applicationId}.firebaseinitprovider"
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:exported="false"
android:initOrder="100" />
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:exported="false"
android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.measurement.UPLOAD"
android:exported="false"/>
</intent-filter>
</receiver>

<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false"/>
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
<receiver
android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
android:exported="false" />


<service
android:name="com.google.firebase.iid.FirebaseInstanceIdService"
android:exported="true">
<intent-filter android:priority="-500">
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"
android:exported="false" />
</intent-filter>
</service>
)
'************ Firebase Base (end) ************

'************ Firebase Analytics ************
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
AddApplicationText(
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true"
android:exported="false">
<intent-filter>
<action
android:name="com.google.android.gms.measurement.UPLOAD"
android:exported="false"/>
</intent-filter>
</receiver>

<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false"/>

<service
android:name="com.google.firebase.crash.internal.service.FirebaseCrashReceiverService"
android:process=":background_crash"
android:exported="false"/>

<service
android:name="com.google.firebase.crash.internal.service.FirebaseCrashSenderService"
android:process=":background_crash"
android:exported="false"/>
)
'************ Firebase Analytics (end) ************
#IF TRIAL
'************ Firebase Ads ************
CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)
AddApplicationText(
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent"
android:exported="false" />
<activity
android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
android:theme="@style/Theme.IAPTheme"
android:exported="false"/>
)
'************ Firebase Ads (end) ************
#END IF

'************ Firebase Authorizations **************
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
'************ Firebase Authorizations (end) **************
 
Upvote 0

Shelby

Well-Known Member
Licensed User
Longtime User
At some time near 7/16/25, Erel suggested adding the following code to our manifest editors:


SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, theme.xml,
<resources>
<style
name="LightTheme" parent="@android:style/Theme.Material.Light">
<item name="android:actionMenuTextAppearance">@style/LowerCaseMenu</item>
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
</style>
<style name="LowerCaseMenu" parent="android:TextAppearance.Material.Widget.ActionBar.Menu">
<item name="android:textAllCaps">false</item>
</style>
</resources>
)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You are using TWO themedefinitions.
Guess you should use only one of them.
SetApplicationAttribute(android:theme, "@android:style/Theme.DeviceDefault")

SetApplicationAttribute(android:theme, "@style/MyAppTheme")
Probably you should use only MyAppTheme as this is the one you can apply

<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
to. This is needed with sdk 35.
 
Upvote 0

sdixon

Member
Licensed User
Longtime User
I got it working. Thanks.
 
Upvote 0

sdixon

Member
Licensed User
Longtime User
You are using TWO themedefinitions.
Guess you should use only one of them.



Probably you should use only MyAppTheme as this is the one you can apply


to. This is needed with sdk 35.
Thanks for the helpful points.
 
Upvote 0
Top