Android vision - Face detector dependencies are not yet available - android

I am trying to test the google mobile vision api, for face detection, so I started with the demos from GitHub mobile vision. I tried both apps, FaceTracker and photo-demo, and the same issue rises with downloading the native face detector library.
For Nexus 5x, Galaxy S6 Edge not working, Galaxy S4, Galaxy Alpha is working.
What I see in the logs, when not working is:
For the app:
05-19 17:52:07.301 14909-14909/com.google.android.gms.samples.vision.face.photo W/System: ClassLoader referenced unknown path: /data/app/com.google.android.gms.samples.vision.face.photo-1/lib/arm64
05-19 17:52:07.725 14909-14909/com.google.android.gms.samples.vision.face.photo W/System: ClassLoader referenced unknown path: /data/app/com.google.android.gms.samples.vision.face.photo-1/lib/arm64
05-19 17:52:08.043 14909-14909/com.google.android.gms.samples.vision.face.photo D/ChimeraCfgMgr: Reading stored module config
05-19 17:52:08.068 14909-14909/com.google.android.gms.samples.vision.face.photo W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000001/n/arm64-v8a
05-19 17:52:08.077 14909-14909/com.google.android.gms.samples.vision.face.photo D/ChimeraFileApk: Primary ABI of requesting process is arm64-v8a
05-19 17:52:08.079 14909-14909/com.google.android.gms.samples.vision.face.photo D/ChimeraFileApk: Classloading successful. Optimized code found.
05-19 17:52:08.105 14909-14909/com.google.android.gms.samples.vision.face.photo I/FaceDetectorCreatorImpl: Requesting download for vision face detector
05-19 17:52:08.107 14909-14909/com.google.android.gms.samples.vision.face.photo W/FaceDetectorHandle: Native face detector not yet available. Reverting to no-op detection.
05-19 17:52:08.253 14909-14909/com.google.android.gms.samples.vision.face.photo W/PhotoViewerActivity: Face detector dependencies are not yet available.
05-19 17:52:08.263 14909-14941/com.google.android.gms.samples.vision.face.photo D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
05-19 17:52:08.312 14909-14941/com.google.android.gms.samples.vision.face.photo I/Adreno: QUALCOMM build : 63c06b2, I8366cd0437
Build Date : 12/06/15
OpenGL ES Shader Compiler Version: XE031.05.13.02
Local Branch : mybranch17112971
Remote Branch : quic/LA.BF64.1.2.9_v2
Remote Branch : NONE
Reconstruct Branch : NOTHING
05-19 17:52:08.317 14909-14941/com.google.android.gms.samples.vision.face.photo I/OpenGLRenderer: Initialized EGL, version 1.4
After doing some digging in the logs, by applying the vision filter for tags I see:
05-19 17:52:08.124 10421-10526/? I/Vision: Attempting to open download_details.json in com.google.android.gms.vision
05-19 17:52:08.125 10421-10526/? W/Vision: Failed to open download_details.json in com.google.android.gms.vision: android.content.pm.PackageManager$NameNotFoundException: com.google.android.gms.vision
05-19 17:52:08.126 10421-10526/? I/Vision: Attempting to open download_details.json in com.google.android.gms.policy_ccocr_vision
05-19 17:52:08.127 10421-10526/? W/Vision: Failed to open download_details.json in com.google.android.gms.policy_ccocr_vision: android.content.pm.PackageManager$NameNotFoundException: com.google.android.gms.policy_ccocr_vision
05-19 17:52:08.127 10421-10526/? W/Vision: Reading download details from hard-coded Java
05-19 17:52:08.443 10421-10526/? E/Vision: Download Failed: Status{statusCode=Download errored: The download was configured incorrectly., resolution=null}
Similar questions:
Google Vision barcode library not found
FaceDetectorHandle﹕ Native face detector not yet available. Reverting to no-op detection
Tried the solution with freeing up space, clearing cache, no result.
What can I do next ? Is it possible to manually download the libraries ? Does anyone have a clear indication why is the library not downloading ?
EDIT
So it looks like there is an issue with the Mobile Vision api https://github.com/googlesamples/android-vision/issues/98. Hope the developers come with a solution soon.
EDIT
The issue has been resolved by updating the play service library.

According to the release notes of Google Play Services v9.0 there was a bug in the service and it was disabled.
In release v9.2 it was enabled again. Check out the release notes:
https://developers.google.com/vision/release-notes#bug_fixes

My problem was with text (TextRecognizer) not face and the problem was storage, I had 300MB free but it needed 10% of my phone according to this link
When is the intent ACTION_DEVICE_STORAGE_LOW broadcasted?

Related

React-native-webview: net::ERR_FAILED

Bug description:
The first time I open my app the website loads correctly in the WebView. Then I go to the homescreen and after a while I return to the app and gets the following error:
Website not available
The website at https://www.example.com?param=value could not be loaded because:
net::ERR_FAILED
Has anyone seen this error before?
Here is some logs from Android Studio that may or my not be related/useful.
2019-06-24 10:59:11.233 16101-16166/? W/cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.android.chrome, sandboxed = true
2019-06-24 10:59:11.237 16101-16101/? I/cr_BrowserStartup: Initializing chromium process, singleProcess=false
2019-06-24 10:59:11.239 16101-16101/? W/ResourceType: Failure getting entry for 0x7f130537 (t=18 e=1335) (error -2147483647)
2019-06-24 10:59:11.241 16169-16169/? E//system/bin/webview_zygote32: failed to make and chown /acct/uid_99051: Permission denied
2019-06-24 10:59:11.241 16169-16169/? E/Zygote: createProcessGroup(99051, 0) failed: Permission denied
2019-06-24 10:59:11.244 16169-16169/? W//system/bin/webview_zygote32: Using default instruction set features for ARM CPU variant (cortex-a9) using conservative defaults
2019-06-24 10:59:11.248 1700-6616/? I/ActivityManager: Start proc 16169:com.android.chrome:sandboxed_process0/u0i51 for webview_service dk.MYAPPNAME.app/org.chromium.content.app.SandboxedProcessService0
2019-06-24 10:59:11.264 1991-1991/? I/chatty: uid=10016(u0_a16) com.android.systemui identical 1 line
2019-06-24 10:59:11.265 16169-16169/? I/SamplingProfilerIntegration: Profiling disabled.
2019-06-24 10:59:11.289 16197-16197/? E/asset: setgid: Operation not permitted
To Reproduce:
I have only been able to reproduce this error in release - not in debug. This error happens after loading the app the first time, then leaving it and return to the app after a few hours.
Maybe it is related to cache.
The problem persist when I force quit the app. If I reinstall the app it is working for a while.
Expected behavior:
Website should fully load.
Screenshots/Videos:
Environment:
- OS: Android (Huawei P20 Pro and multiple other Android phones)
- OS version: Android 8
- react-native version: 59.3
- react-native-webview version: 5.6.2
I found a fix for this issue!
It looks like a broken service worker stalled the website.
I solved it by using the injectedJavascript prop in my WebView to inject the following lines of code:
navigator.serviceWorker.getRegistrations().then(function(registrations) {
for (let registration of registrations) {
registration.unregister();
}
});
It is a bug in Google Chrome 75.

My app restarted itself, log shows ChimeraModuleLdr: Module config changed, forcing restart due to module

I was testing my app and I saw it restart itself, was really weird. I looked and looked on the logs and I couldn't find anything odd except for this line ChimeraModuleLdr: Module config changed, forcing restart due to module. This is on a Pixel XL with Oreo.
Here are the last few lines of the log and the start up of the app after it was killed.
10-18 22:49:31.262 8379 8379 I ChimeraModuleLdr: Module config changed, forcing restart due to module
10-18 22:49:31.262 8379 8379 I Process : Sending signal. PID: 8379 SIG: 9
--------- beginning of main
10-18 22:49:31.641 13717 13717 I MultiDex: VM with version 2.1.0 has multidex support
10-18 22:49:31.641 13717 13717 I MultiDex: install
10-18 22:49:31.641 13717 13717 I MultiDex: VM has multidex support, MultiDex support library is disabled.
Any idea about what triggered this?
It seems that the ChimeraModule (or Dynamite) is the dynamic module loading system used by the Google Play Services (more details here).
I guess that, if your app is using a specific module from the Google Play Services, when that specific module is updated your app is restarted as well.
Adding to what #bonnyz already said, I fixed it by removing all references to the libraries updated by the module, in my case the android vision library.
Adding further,
In context of Xamarin Forms project, the error you describe was caused by the Xamarin.Forms.GoogleMaps V4 package. reverting to V3.x.x solved the problem for me.

NativeLibraryUtils: java.lang.UnsatisfiedLinkError: dlopen failed: 32-bit instead of 64-bit

I got this error when I deploy my Android APK onto a device. The same error is reported by the Google Play Pre-launch report:
11-03 16:50:34.845: W/NativeLibraryUtils(14918): Unable to load native
code from existing library
/data/app/com.google.android.gms-1/lib/arm/libgmscore.so
11-03 16:50:34.845: W/NativeLibraryUtils(14918):
java.lang.UnsatisfiedLinkError: dlopen failed:
"/data/app/com.google.android.gms-1/lib/arm/libgmscore.so" is 32-bit
instead of 64-bit
11-03 16:50:34.845: W/NativeLibraryUtils(14918): at
java.lang.Runtime.load0(Runtime.java:908)
11-03 16:50:34.845:
W/NativeLibraryUtils(14918): at
java.lang.System.load(System.java:1505)
11-03 16:50:34.845:
W/NativeLibraryUtils(14918): at
mpy.b(:com.google.android.gms#11509430:9)
11-03 16:50:34.845:
W/NativeLibraryUtils(14918): at
com.google.android.gms.common.security.ProviderInstallerImpl.a(:com.google.android.gms#11509430:1)
...
There are some others with the same problem, but they are often related to Swift Android development. For instance, a similar (the same?) issue has been reported here: “dlopen failed: is 32-bit instead of 64-bit” in tests only. I am on Xamarin. The error makes no sense to me nor does anything related to what I am reading.
I tried all sorts of solutions such as, but not limited to:
different linker options (None, SDK only etc.)
recompile of all custom assemblies
clean builds, forced NuGet package download etc.
different supported ABI settings
If I run the code in debug mode on my emulator, everything is fine. The version built in release mode via VSTS and deployed onto Google Play doesn't work.
Any tip, hint and wild guess will be appreciated.

Google Mobile Vision library not downloading

I am trying to implement the Google Mobile Vision TextRecogniser API into my app, to read text off a given Image. When I try to use the feature, I get this error:
W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found.
I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:801
I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 801
W/System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/00000005/n/arm64-v8a
D/ApplicationLoaders: ignored Vulkan layer search path /data/app/com.google.android.gms-1/lib/arm64:/system/fake-libs64:/data/app/com.google.android.gms-1/base.apk!/lib/arm64-v8a for namespace 0x7a2e8c60f0
I/Vision: Loading libocr library
I/Vision: libocr load status: false
I/TextRecognizerCreatorImpl: Requesting download for native text recognizer
W/TextNativeHandle: Native handle not yet available. Reverting to no-op handle.
Meaning, I believe, that the library wasnt downloaded to the phone.
I have troubleshooted for common error sources, including missing internet connection, lack of memory, missing dependencies, rebooting the phone, updating Google play services, waiting a while etc. Google repository and Play services are also updated in Android studio.
Yet, I still get the same error, even when trying my App on different devices.
I believe that the download is performed by the Google Play Service App. The Libraries are downloaded as a zip file in the folder
/data/data/com.google.android.gms/cache/downloadservice
and are extracted to
/data/data/com.google.android.gms/files/com.google.android.gms.vision
and our app always check for the library in path
06-02 22:43:53.379 30258-30419/pzy64.searchbot I/Vision: Loading library libocr.so
which shows the error if the files are absent
06-02 22:43:53.475 30258-30419/pzy64.searchbot I/Vision: libocr.so library load status: false
otherwise
06-03 09:42:33.372 23451-24679/pzy64.searchbot I/Vision: libocr.so library load status: true
After download,
In my case (ARM) the folder size of
/data/data/com.google.android.gms/files/com.google.android.gms.vision
is around 5MB.(So the file downloaded is less than this size, The size may vary for different architecture .It took more time to download in my Asus Phone (x86)).
See my Logcat - (filter using 'Vision').
06-02 22:45:45.489 14970-31705/? I/Vision: Registration status ocr_armeabi_v7a.zip: The download is in progress.
06-02 22:45:45.542 14970-31705/? I/Vision: Download status ocr_armeabi_v7a.zip: The download is in progress.
06-02 22:43:53.379 30258-30419/pzy64.searchbot I/Vision: Loading library libocr.so
06-02 22:43:53.387 30258-30419/pzy64.searchbot I/Vision: libocr.so library load status: false
06-02 22:43:53.410 30258-30419/pzy64.searchbot I/Vision: Loading library libocr.so
06-02 22:43:53.411 30258-30419/pzy64.searchbot I/Vision: libocr.so library load status: false
06-02 22:43:53.475 30258-30419/pzy64.searchbot I/Vision: Loading library libocr.so
06-02 22:43:53.475 30258-30419/pzy64.searchbot I/Vision: libocr.so library load status: false
................... ..............
................... ..............
06-02 22:51:08.364 14970-3424/? I/Vision: Finished download ocr_armeabi_v7a.zip
06-02 22:51:08.421 14970-3424/? I/Vision: Unzipping /data/data/com.google.android.gms/cache/downloadservice/ocr_armeabi_v7a.zip to /data/data/com.google.android.gms/files/com.google.android.gms.vision/ocr
06-02 22:51:08.645 14970-3424/? I/Vision: Time to download ocr: 436558
06-02 22:51:09.142 3303-3489/pzy64.searchbot I/Vision: Loading library libocr.so
06-02 22:51:09.149 3303-3489/pzy64.searchbot I/Vision: libocr.so library load status: true
06-02 22:51:09.149 3303-3489/pzy64.searchbot I/Vision: Reading ocr models from /data/data/com.google.android.gms/files/com.google.android.gms.vision/ocr/data/models
The app i'm working on
I do "Clear Data" of the Google Play Service app and it works!
I think you missed out adding the "meta-data" tag in manifest file of your application. This meta-data tag tells your application to download and integrate the library to your application. Try adding a meta-data tag in your "application" tag above "activity" tag in the manifest file. See below:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version"/>
<meta-data android:name="com.google.android.gms.vision.DEPENDENCIES" android:value="barcode"/>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
This might solve your issue.
I don't know if I am too late, but guys, after hours of challenges for me the problem was solved by Updating Google Play Services to version (12.6.85). I restarted the device and guess what? The app worked fine.
For updating this Google play service these instructions.
after some trials I figured out that in the gradle file you have to add these lines, too:
compile 'com.android.support:support-v4:24+'
compile 'com.android.support:design:24+'
So apart from this one
compile 'com.google.android.gms:play-services-vision:10.2.1'
the other two lines are important, too.
I had the exact same problem. As soon as I logged in to Google Play service then it downloaded and the barcode detector worked in the camera.

Android app becomes slow after adding Firebase Analytics and Crash Reporting

Before adding firebase analytics my app worked really fast. It has a lot of request which are sequential.
However, as soon as I added firebase analytics my app's internet requests froze and I got a lot of logs which consume time for no purpose.
W/System: ClassLoader referenced unknown path: /data/app/my.project.-1/lib/arm64
W/art: Verification of void my.project.App.<init>() took 133.425ms
D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
D/FirebaseApp: Initialized class com.google.firebase.iid.FirebaseInstanceId.
V/GoogleSignatureVerifier: com.google.android.gms signature not valid. Found: <Some big sequence of characters>
I/FA: Tag Manager is not found and thus will not be used
D/ChimeraCfgMgr: Reading stored module config
I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:2
D/ChimeraFileApk: Primary ABI of requesting process is arm64-v8a
D/FirebaseCrashReceiverServiceImpl: onCreate
I/DynamiteModule: Selected remote version of com.google.android.gms.flags, version >= 1
This is quite important, because I wait about 5-6 seconds until my own requests start to execute.

Categories

Resources