Android Question Firebase problem - No resource found that matches the given name

achapman

Member
Licensed User
Longtime User
I'm trying to test the new Google Maps support under Firebase, following this tutorial

https://www.b4x.com/android/forum/threads/integrating-firebase-services.67692/

As soon as I add this to the project Manifest file:

'************ 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) ************

When compiling, I get:

AndroidManifest.xml:25: error: Error: No resource found that matches the given name (at 'value' with value '@Integer/google_play_services_version').

A few points that might help with diagnosis:

- I upgraded from B4A 5.5 to 6.0;
- I updated the Android SDK to the latest of everything;
- I ensured that "Android Support Repository" and "Google Repository" were both installed;
- I created a project using the Firebase console and set the app package name to be the same as the Firebase project;
- I installed the empty/dummy google-play-services.jar file mentioned in another thread (I couldn't find a real copy of this in the Android SDK).

I tried creating a new project from scratch and added the line in the Manifest there too - same error.

Any thoughts?
Thanks for your help!
 

DonManfred

Expert
Licensed User
Longtime User
AndroidManifest.xml:25: error: Error: No resource found that matches the given name (at 'value' with value '@Integer/google_play_services_version').

As soon as I add this to the project Manifest file:

please post you manifest text...

I guess the firebase- BASE snippet is missing (which creates the resource from the json file)
 
Upvote 0

achapman

Member
Licensed User
Longtime User
Thanks Erel. Adding the additional Jar file did the trick, however now the app crashes on boot. I can't even put a debug break-point on the first line of the Main.

The complete Manifest is:

'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="14" android:targetSdkVersion="22"/>
<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.Holo.Light")
AddPermission(android.permission.CALL_PHONE)
'End of default text.

'************ 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) ************

'************ 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) ************

AddApplicationText(
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDoXX5kAf8M9SpxGlUSJ8essSERHGXXXXX"/>
)

Note the XXXXX at the end of the API_KEY is masked for privacy.
 
Upvote 0

achapman

Member
Licensed User
Longtime User
Sorry Erel, today it is working perfectly. Literally all I did was reboot. Very odd. :) Sorry for any inconvenience.
 
Upvote 0
Top