Android Question Solved - Manifest Malformed Error only in Android 12 -B4A 12.20 Java 8 Windows 10 Pro

virpalacios

Active Member
Licensed User
Longtime User
Hi all, i am testing the firebase authenticaton sample, its is working fine with android 10 and android 11, however i got the Manifest Malformed Error when installing in Android 12.
Here is the manifest form the sample. I tried some advices like, thanks very much for any advice about this issue, it is very specific for android 12

Best Regards

Virgilio

1) Adding a "." to a manifest line
2) Deleting Line: CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
3) After trying without results I return the manifest to its original state (add added)
Here is the first part of the app
#Region Project Attributes
#ApplicationLabel: ABW Authorizacion
#VersionCode: 1
#VersionName:
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region

#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#MultiDex: true
' #AdditionalJar: androidx.arch.core:core-runtime
#End Region

FireBaseAuth:
'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="5" android:targetSdkVersion="31"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.
'************ Google Play Services Base ************
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" />
)
'************ Google Play Services Base (end) ************

'************ Firebase Base ************
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)

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: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"/>
    <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" />
            </intent-filter>
        </service>
)
'************ Firebase Base (end) ************

'************ Firebase Auth ************ 
AddApplicationText(
   <activity android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
                  android:theme="@android:style/Theme.Translucent.NoTitleBar"
                  android:excludeFromRecents="true"
                  android:exported="false" />

        <service
            android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
            android:exported="true"
            android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />
)
'************ Firebase Auth (end) ************
 
Last edited:

virpalacios

Active Member
Licensed User
Longtime User
Hi All, I tested the firebase auth sample, it worked fine in android 12, the difference with my app manifest is in this
Sample FirebaseAuth Working
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>
My App Manifest Error
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="31"/>ts

I changed to 5 and 29 and My App is working fine in Android 12 devices, My concern is to learn about this issue is related to google is upgrading to API 33 in a couple of months, I anyone have this issue, welcome to share thoughts.

Best Regards
 
Last edited:
Upvote 0

virpalacios

Active Member
Licensed User
Longtime User
Hi All, I tested the firebaseauth sample, it worked fine in android 12, the difference with my app manifest is in this
Sample FirebaseAuth Working
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>
My App Manifest Error in Manifest
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="31"/>ts

I changed to 5 and 29 and My App is working fine in Android 12 devices, My concern is about to learn about this issue is related to google is upgrading to API 33 in a couple of months, I anyone have this issue, welcome to share thoughts.

Best Regards
I got this info from stack overflow (its is related to android 12, api 31 and manifest)

 
Last edited:
Upvote 0
Top