Android Question FirebaseAdmob problem with targetversion 34

vikingivesterled

Active Member
Licensed User
Longtime User
When I compile a b4a app with FirebaseAdmob and targetversion 34, it compiles ok but when installing it to the device it says:
App not installed as package appears to be invalid

This only happens on my apps that has avertising using Admob so I took all the admob parts out of one and it installed fine.
Then when I put it back in (basically putting the AdMob stuff back in the Manifest, hooking off for library FirebaseAdmob 2, dim an AdView and Load a bannerad. it comes with the message.
Same with both versions of library FirebaseAdmob.
Downloading a new json from Firebase made no difference.


There is about 70 lines of AdMob text in the Manifest that I copied from a sample app years ago.
See details in my reply #2. Do some of that need changing?
 

vikingivesterled

Active Member
Licensed User
Longtime User
These are the AdMob parts in the app Manifest.

'AdMob
AddApplicationText(
<meta-data android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version"/>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
)
'End of AdMob


'************ Firebase Base ************
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 Ads ************
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" />
<activity android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
android:theme="@style/Theme.IAPTheme"/>
)
'************ Firebase Ads (end) ************
 
Upvote 0

asales

Expert
Licensed User
Longtime User
Same with both versions of library FirebaseAdmob.
This is the admob lib that working: FirebaseAdmob2 v.3.00
There is about 70 lines of AdMob text in the Manifest that I copied from a sample app years ago.
The lib uses only one line in the manifest:
B4X:
CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)

Check this example:
 
Upvote 0

vikingivesterled

Active Member
Licensed User
Longtime User
This is the admob lib that working: FirebaseAdmob2 v.3.00

The lib uses only one line in the manifest:
B4X:
CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)

Check this example:

That is the library i am using.
Did the changes to the manifest recommended with just the one line.
It installs but when trying to open the app it just flashes an enlarged icon for a split second and then closes and nothing gets written to the Bridgelogger.

There were a couple of more lines for the manifest in the sample:
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
AddReplacement($ADMOB_APP_ID$, ca-app-pub-3940256099942544~3347511713) 'Sample AdMob app ID

When I addeed them, and corrected the AdMob app id, the app opens and runs.
 
Last edited:
Upvote 0
Top