Barcode scanning is not working with vision API - android

I'm trying to run the barcode-reader example ( https://github.com/googlesamples/android-vision/tree/master/visionSamples/barcode-reader ) as it is on my Nokia 2.1 running Android 8.1.0 and Google Play Services 15.0.90. The camera starts but no barcode is detected and in the logcat I get (continuously while the camera is working) the following error:
2019-02-09 18:17:04.990 3364-3497/com.google.android.gms.samples.vision.barcodereader E/BarcodeNativeHandle: Error Loading module com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module found. Local version is 0 and remote version is 0. at com.google.android.gms.dynamite.DynamiteModule.load(Unknown Source:8) at com.google.android.gms.internal.vision.zzl.zzp(Unknown Source:39) at com.google.android.gms.internal.vision.zzl.isOperational(Unknown Source:0) at com.google.android.gms.vision.barcode.BarcodeDetector.isOperational(Unknown Source:2) at com.google.android.gms.vision.Detector.receiveFrame(Unknown Source:16) at com.google.android.gms.samples.vision.barcodereader.ui.camera.CameraSource$FrameProcessingRunnable.run(CameraSource.java:1205) at java.lang.Thread.run(Thread.java:764)
What can I do to be able to run it?
Thanks!

Facing same issue on Nokia 1 Android 8.1.0 Android Go edition.
Seems to be issue with vision API or Google play service issue as mentioned here https://issuetracker.google.com/issues/80454351
Alternately you can use zing library for barcode/qr code scanning, you can try following example, it worked for me.
https://www.androidtutorialpoint.com/basics/learn-by-doing/android-qr-code-scanner-app-tutorial-using-zxing-library/

Related

Can't solve error regarding 'org.codeaurora.qcamera3.exposure_metering.exposure_metering_mode'

I am working on an android application with AR elements. When it is redirecting me from the onboarding screen to the AR screen it crashes with the following error.
java.lang.IllegalArgumentException: Could not find tag for key 'org.codeaurora.qcamera3.exposure_metering.exposure_metering_mode')
at android.hardware.camera2.impl.CameraMetadataNative.nativeGetTagFromKeyLocal(Native Method)
at android.hardware.camera2.impl.CameraMetadataNative.setBase(CameraMetadataNative.java:1389)
at android.hardware.camera2.impl.CameraMetadataNative.set(CameraMetadataNative.java:459)
at android.hardware.camera2.impl.CameraMetadataNative.set(CameraMetadataNative.java:463)
at android.hardware.camera2.CaptureRequest$Builder.set(CaptureRequest.java:848)
at dez.a(PG:49)
at gtf.g(PG:104)
at det.a(Unknown Source:12)
at gjw.e(PG:5)
at gnx.run(PG:12)
at gsa.run(PG:2)
at gtc.run(PG:1)
at gsw.f(PG:2)
at gsv.run(PG:6)
Suppressed: gnv: [gpc{Cancelling}#66fb9dc, Dispatchers.IO]
It works fine on android API level 31 and the crash only happens on level 29. Does anybody have any idea what is causing this error?
Apparently it is a device dependent problem and the issue is reported on ARCore github.
https://github.com/google-ar/arcore-android-sdk/issues/1261

Trying to TestFlight my Unity Game on Google play Store. Everything uploads but when it goes for review, it fails and it gives be stability error

Error Detected on 1 device during testing
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.apps.messaging/com.google.android.apps.messaging.ui.conversationlist.ShareIntentActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f08014a
More info about this..... This expands this..
FATAL EXCEPTION: main
Process: com.google.android.apps.messaging, PID: 26814
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.apps.messaging/com.google.android.apps.messaging.ui.conversationlist.ShareIntentActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f08014a
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2805)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2883)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1613)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f08014a
at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:229)
at android.content.res.Resources.getDrawableForDensity(Resources.java:876)
at android.content.res.Resources.getDrawable(Resources.java:819)
at android.content.Context.getDrawable(Context.java:605)
at ym.a(PG:15)
at com.google.android.apps.messaging.ui.common.ListEmptyView.a(PG:5)
at nog.c(PG:20)
at cy.b(PG:48)
at nol.b(PG:15)
at android.support.v4.app.Fragment.g(PG:120)
at em.f(PG:71)
at ee.a(PG:447)
at ee.c(PG:436)
at ee.d(PG:395)
at ee.a(PG:427)
at ee.b(PG:327)
at ee.a(PG:535)
at ee.c(PG:217)
at ee.c(PG:109)
at ee.i(PG:61)
at di.onStart(PG:114)
at ma.onStart(PG:128)
at vit.onStart(PG:60)
at lkx.onStart(PG:33)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1334)
at android.app.Activity.performStart(Activity.java:7033)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2768)
... 9 more
Error Detected on 1 device during testing
Fatal AndroidRuntime Exception detected.
Error Detected on 1 device during testing
Native crash of com.Tom.Fireg
4 issues on Android 9 (SDK 28)
I don't know how to fix this, please help me. I got my TestFlight running on AppleStore but it crashes when I play too much so I am trying to fix that. However, on Google PlayStore, I can't even upload due to these errors. Help me please. When I click on android stimulator to run on my unity platform it works fine, just uploading it gives me errors.
I followed this YouTube video how to upload on google playstore. I changed Scripting Backend to IL2CPP in order to enable ARM64. ARMv7 was automatically selected. Just changed Scripting backend and enabled ARM64. Made a key manager to create a key and selected release under Minify. Create symbols.zip on video it said to choose enable. However, I had these options, disabled, public, or debugging. I choose publish since this released map and zip to use on google play. I don't think I did anything wrong here but help me out, please.
Check the packages you have included in the project. They probably weren't included in the Android Manifest.
Android uses the file called Android Manifest within your app to define some basic information.
Among the information he seeks are dependences.
For example if you have implemented a function to send a notification, it will need to be included in the Manifest file.
If there are no dependencies, the app will crash.
Try exporting your game to Android Studio and running it from there. It should show you all the problems.

ML Kit Dynamic module feature crashed and showing resource not found on release build opened after forcefully closed app

We are developing an app that has a feature translation. We want to implement a translation feature on-demand using com.google.mlkit:playstore-dynamic-feature-support:16.0.0-beta2 with google MLkit com.google.mlkit:translate:17.0.0
It is working perfectly on debug build. It has also worked on the release build after the on-demand dynamic feature installation was done until the app forcefully stopped. After the app stopped forcefully and open again that time on-demand feature doesn't work and threw an exception like resource not found exception.
Here is the exception message:
android.content.res.Resources$NotFoundException: Resource ID #0x7e030000
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:292)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2390)
at android.content.res.Resources.getXml(Resources.java:1392)
at com.google.android.gms.internal.mlkit_translate.zzpi.zza(com.google.mlkit:translate##17.0.0:4)
at com.google.android.gms.internal.mlkit_translate.zzpp.zzi(com.google.mlkit:translate##17.0.0:1)
at com.google.mlkit.nl.translate.internal.zzad.<init>(com.google.mlkit:translate##17.0.0:1)
at com.google.mlkit.nl.translate.zzg.create(com.google.mlkit:translate##17.0.0:2)
at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0$com-google-firebase-components-ComponentRuntime(ComponentRuntime.java:132)
at com.google.firebase.components.ComponentRuntime$$ExternalSyntheticLambda1.get(Unknown Source:4)
at com.google.firebase.components.Lazy.get(Lazy.java:53)
at com.google.firebase.components.AbstractComponentContainer.get(AbstractComponentContainer.java:27)
at com.google.firebase.components.ComponentRuntime.get(ComponentRuntime.java:45)
at com.google.firebase.components.RestrictedComponentContainer.get(RestrictedComponentContainer.java:89)
at com.google.mlkit.nl.translate.zzd.create(com.google.mlkit:translate##17.0.0:2)
at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0$com-google-firebase-components-ComponentRuntime(ComponentRuntime.java:132)
at com.google.firebase.components.ComponentRuntime$$ExternalSyntheticLambda1.get(Unknown Source:4)
at com.google.firebase.components.Lazy.get(Lazy.java:53)
at com.google.firebase.components.AbstractComponentContainer.get(AbstractComponentContainer.java:27)
at com.google.firebase.components.ComponentRuntime.get(ComponentRuntime.java:45)
at com.google.firebase.components.RestrictedComponentContainer.get(RestrictedComponentContainer.java:89)
at com.google.mlkit.nl.translate.zze.create(com.google.mlkit:translate##17.0.0:2)
at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0$com-google-firebase-components-ComponentRuntime(ComponentRuntime.java:132)
at com.google.firebase.components.ComponentRuntime$$ExternalSyntheticLambda1.get(Unknown Source:4)
at com.google.firebase.components.Lazy.get(Lazy.java:53)
at com.google.firebase.components.AbstractComponentContainer.get(AbstractComponentContainer.java:27)
at com.google.firebase.components.ComponentRuntime.get(ComponentRuntime.java:45)
at com.google.mlkit.common.sdkinternal.MlKitContext.get(com.google.mlkit:common##18.0.0:3)
at com.google.mlkit.nl.translate.Translation.getClient(com.google.mlkit:translate##17.0.0:1)
It will again work when I update another version from the play store.
Anyone can help, It will be appreciated.

E/com.facebook.appevents.RestrictiveDataManager: updateRulesFromSetting failed

When I launch my app from Android Studio, with Facebook SDK installed on my device, Xiaomi Mi A2, it triggers the same error trhee times. It does not stop the app, but I don't know if I am missing something or simply, it is not important, but in the end, it is an error and I want to clarify it.
I am using Android Studio 3.4.1, Android 9 on the Xiaomi A2 and the new clause in build.gradle file is implementation 'com.facebook.android:facebook-android-sdk:5.1.0'. Error has not appeared before upgrading Facebook SDK.
This is what appears in Logcat:
2019-06-24 18:24:31.202 25105-25136/com.myapp
E/com.facebook.appevents.RestrictiveDataManager:
updateRulesFromSetting failed
org.json.JSONException: End of input at character 0 of
at org.json.JSONTokener.syntaxError(JSONTokener.java:449)
at org.json.JSONTokener.nextValue(JSONTokener.java:97)
at org.json.JSONArray.(JSONArray.java:92)
at org.json.JSONArray.(JSONArray.java:108)
at com.facebook.appevents.RestrictiveDataManager.updateFromSetting(RestrictiveDataManager.java:32)
at com.facebook.internal.FetchedAppSettingsManager.parseAppSettingsFromJSON(FetchedAppSettingsManager.java:323)
at com.facebook.internal.FetchedAppSettingsManager.access$000(FetchedAppSettingsManager.java:63)
at com.facebook.internal.FetchedAppSettingsManager$1.run(FetchedAppSettingsManager.java:181)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
EDIT
The issue has been fixed in version 5.1.1.
Revert to 5.0.3 to get rid of this.
5.1.0 is actually crashing in production at this method (there's a bug report here). GitHub commits of this file show its rather flawed, the method is called from multiple threads concluding to a concurrency crash because it's using a static ArrayList.
Lately the core FB SDK is kinda bloated with useless stuff and low-quality code. The codeless stuff "feature" that simply can't even be turned off is especially a horror to look at. If you don't strictly need the FB SDK in your app, I'd avoid it until they get their shit figured out.

Mapbox crash Android 8 (Oreo)

I have been using Mapbox version 4.2.2 as I am not yet prepared to move to Mapbox 5 as a few features from version 4 don't seem to be supported. (In specific Camera Tracking)
I have found that I am getting crashes regarding Android 8 devices.
Caused by java.lang.IllegalStateException: Not allowed to start service Intent { cmp=com.sctaylor.map/com.mapbox.mapboxsdk.telemetry.TelemetryService }: app is in background uid UidRecord{3534d78 u0a235 CEM idle procs:1 seq(0,0,0)}
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1512)
at android.app.ContextImpl.startService(ContextImpl.java:1468)
at android.content.ContextWrapper.startService(ContextWrapper.java:644)
at com.mapbox.mapboxsdk.telemetry.MapboxEventManager.setTelemetryEnabled(MapboxEventManager.java:252)
at com.mapbox.mapboxsdk.telemetry.MapboxEventManager.initialize(MapboxEventManager.java:146)
at com.mapbox.mapboxsdk.MapboxAccountManager.start(MapboxAccountManager.java:50)
at com.sctaylor.map.AnalyticsApplication.onCreate(AnalyticsApplication.java:44)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5821)
at android.app.ActivityThread.-wrap1(Unknown Source)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1669)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:251)
at android.app.ActivityThread.main(ActivityThread.java:6580)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
It looks like this is an issue with Android 8's background service restrictions (Need to use a job scheduler). Is there a way to fix this without upgrading to Mapbox 5?
It looks like this is an issue with Android 8's background service
restrictions (Need to use a job scheduler). Is there a way to fix this
without upgrading to Mapbox 5?
You are completely right about the cause of the issue.
The issue was reported here on GitHub, updates will be propagated here.
The clean fix is for Mapbox to implement JobScheduler. However, they have not released the fix yet and I don't know if they will fix it for versions 4.x
As a contemporary fix, they just caught the IllegalStateException while Mapbox still seems to work.
Using the try/catch approach around MapboxAccountManager.start() does not seem to be a good idea because code subsequent to setTelemetryEnabled() would not be executed.
The only workaround I see is degrading the targetSdkVersion to 25.

Categories

Resources