Android Question [SOLVED] google_play_services_version not found

paragkini

Member
Licensed User
Longtime User
Hi,
I am using Erel's barcode reader example and it works absolutely fine as-it-is. That is when use that project, it compiles very well and runs fine on my android phone.
However, when I used the same code (barcode reader code with CameraEx class) in my existing B4A project and trying to compile it, it is giving below error.

google_play_services_version not found:
B4A Version: 12.80
Parsing code.    (0.41s)
    Java Version: 11
Building folders structure.    (3.34s)
Running custom action.    (1.61s)
Compiling code.    (1.07s)
Compiling layouts code.    (0.22s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (1.84s)
Linking resources    Error
AndroidManifest.xml:32: error: resource integer/google_play_services_version (aka com.ctl.paragkini.b4xa.qnaclient:integer/google_play_services_version) not found.
error: failed processing manifest.

I have checked 2 solutions. One mentions to follow instructions to set-up B4A correctly ( link to post ). While I haven't done that yet, I don't think it is a problem because Erel's project works just fine without any error.
I have compared both manifest and have replicated them.
Also tried adding the line given in this post but still giving error.

Request help.

Giving manifest below.

Manifest:
'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: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="21" 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.
AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:minSdkVersion="21" />
)
CreateResourceFromFile(Macro, Core.NetworkClearText)
'Below was for QR Reader. But not working
AddApplicationText(<meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode,,face" />)
AddApplicationText(<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
 
Last edited:
Solution
Got it working. It was a silly mistake to ignore below line in Erel's example.
AdditionalJar:
#AdditionalJar: com.google.android.gms:play-services-vision

Worked now. Found this mistake while going through this post.
However, it does need below text to be added in manifest.

Manifest Text:
AddApplicationText(<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>)

DonManfred

Expert
Licensed User
Longtime User
this is the manifesteditortext from the example

B4X:
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$")
CreateResourceFromFile(Macro, Themes.LightTheme)
'End of default text.
AddApplicationText(<meta-data
    android:name="com.google.android.gms.vision.DEPENDENCIES"
    android:value="barcode,,face" />
)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)

where does the
B4X:
AddApplicationText(<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>)
comes from?
 
Upvote 1

paragkini

Member
Licensed User
Longtime User
where does the
B4X:
AddApplicationText(<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>)
comes from?
From below link. Mike1970 was one facing same problem and solved with this line. Mentioned in below link. I also tried with original one but doesn't work in my project. Re-iterating : The original code by Erel works fine. Only when I embed it in my project, it gives this error.
 
Upvote 0

paragkini

Member
Licensed User
Longtime User
Got it working. It was a silly mistake to ignore below line in Erel's example.
AdditionalJar:
#AdditionalJar: com.google.android.gms:play-services-vision

Worked now. Found this mistake while going through this post.
However, it does need below text to be added in manifest.

Manifest Text:
AddApplicationText(<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>)
 
Upvote 0
Solution
Top