Android Question Barcode Reader Getting Error java.lang.reflect.InvocationTargetException

Ajws

Member
Licensed User
Hai please help, i get error when try to combine this project to my project

link project (barcode reader) https://www.b4x.com/android/forum/threads/b4x-b4xpages-barcode-reader.120417/#content

error:
Error occurred on line: 127 (ScanQRCode)
java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:132)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:205)
    at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
    at b4a.example.scanqrcode._createdetector(scanqrcode.java:417)
    at b4a.example.scanqrcode._activity_create(scanqrcode.java:383)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
    at b4a.example.scanqrcode.afterFirstLayout(scanqrcode.java:105)
    at b4a.example.scanqrcode.access$000(scanqrcode.java:17)
    at b4a.example.scanqrcode$WaitForLayout.run(scanqrcode.java:83)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:210)
    at android.os.Looper.loop(Looper.java:299)
    at android.app.ActivityThread.main(ActivityThread.java:8309)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)
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" />
    at com.google.android.gms.common.GooglePlayServicesUtilLight.isGooglePlayServicesAvailable(com.google.android.gms:play-services-basement@@18.1.0:8)
    at com.google.android.gms.common.GoogleApiAvailabilityLight.isGooglePlayServicesAvailable(com.google.android.gms:play-services-basement@@18.1.0:2)
    at com.google.android.gms.dynamite.DynamiteModule.zzf(com.google.android.gms:play-services-basement@@18.1.0:6)
    at com.google.android.gms.dynamite.DynamiteModule.zza(com.google.android.gms:play-services-basement@@18.1.0:8)
    at com.google.android.gms.dynamite.zze.zzb(com.google.android.gms:play-services-basement@@18.1.0:1)
    at com.google.android.gms.dynamite.zzk.selectModule(com.google.android.gms:play-services-basement@@18.1.0:2)
    at com.google.android.gms.dynamite.DynamiteModule.load(com.google.android.gms:play-services-basement@@18.1.0:5)
    at com.google.android.gms.internal.vision.zzt.zzd(com.google.android.gms:play-services-vision-common@@19.1.3:24)
    at com.google.android.gms.internal.vision.zzm.<init>(com.google.android.gms:play-services-vision@@20.1.3:3)
    at com.google.android.gms.vision.barcode.BarcodeDetector$Builder.build(com.google.android.gms:play-services-vision@@20.1.3:7)
    ... 29 more

please help.
 
Solution
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" />
Add this in yout Manifest:
B4X:
AddApplicationText(<meta-data
    android:name="com.google.android.gms.vision.DEPENDENCIES"
    android:value="barcode,,face" />
)
and this in Main
B4X:
#AdditionalJar: com.google.android.gms:play-services-vision
as in example

MarcoRome

Expert
Licensed User
Longtime User
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" />
Add this in yout Manifest:
B4X:
AddApplicationText(<meta-data
    android:name="com.google.android.gms.vision.DEPENDENCIES"
    android:value="barcode,,face" />
)
and this in Main
B4X:
#AdditionalJar: com.google.android.gms:play-services-vision
as in example
 
Upvote 0
Solution

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Ajws

Member
Licensed User
solved !
Add this in yout Manifest:
B4X:
AddApplicationText(<meta-data
    android:name="com.google.android.gms.vision.DEPENDENCIES"
    android:value="barcode,,face" />
)
and this in Main
B4X:
#AdditionalJar: com.google.android.gms:play-services-vision
as in example
thank you so much, you are real expert
 
Upvote 0
Top