Android Code Snippet [B4X] CameraExClass- QrCode/Barcode Reader fix new SDK

Hi everyone,
today I updated all the packages with the SDK Manager.
After that, the app was crashing on a line about the QrCode reader made using the CameraEx class (there is a tutorial in the forum).
Reading the logs I found out that now you must have the following line in the manifest to get it working again.

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

Maybe this can be useful to someone in the future.
 

Beja

Expert
Licensed User
Longtime User
Hi Mike,
Would you pls provide the link for the original post? is there an example project?
 

asales

Expert
Licensed User
Longtime User
today I updated all the packages with the SDK Manager.
Maybe this can be useful to someone in the future.
1 - Thanks. I have the same problem (when update the SDK) and was solved with your tip.
The error is:
B4X:
java.lang.reflect.InvocationTargetException
Caused by: com.google.android.gms.common.GooglePlayServicesMissingManifestValueException: A required meta-data tag in your app's AndroidManifest.xml does not exist.  You must have the following declaration within the <application> element:     <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

2 - The error don't happen if uses the SDK from Erel.
 

TILogistic

Expert
Licensed User
Longtime User
Hi everyone,
today I updated all the packages with the SDK Manager.
After that, the app was crashing on a line about the QrCode reader made using the CameraEx class (there is a tutorial in the forum).
Reading the logs I found out that now you must have the following line in the manifest to get it working again.

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

Maybe this can be useful to someone in the future.
correct use in manifest:
B4X:
'************ Google Play Services Base ************

CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)

'************ Service Camera Barcode ************

AddApplicationText(
    <meta-data
        android:name="com.google.android.gms.vision.DEPENDENCIES"
        android:value="barcode,,face" />
)

See:
 

rogeriosca

Member
Licensed User
Longtime User
Hi everyone,
today I updated all the packages with the SDK Manager.
After that, the app was crashing on a line about the QrCode reader made using the CameraEx class (there is a tutorial in the forum).
Reading the logs I found out that now you must have the following line in the manifest to get it working again.

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

Maybe this can be useful to someone in the future.
Thank you!
 
Top