Flutter firestore force close (error) in build apk release - android

I got error at firestore stuff when build apk release, the app force close when access that firestore code. But its fine when direct running (debug) in AS/VS code. Any one can explain this?
java.lang.RuntimeException: Internal error in Firestore (19.0.0).
at com.google.firebase.firestore.g.j.a(:379)
at com.google.firebase.firestore.g.g.run(Unknown Source:2)
at android.os.Handler.handleCallback(Handler.java:794)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: java.lang.AbstractMethodError: abstract method "b.b.g.w$d b.b.g.w$d.b(int)"
at b.b.g.r.a(:1319)
at b.b.e.a.da.C(:5440)
at b.b.e.a.da.a(:5509)
at b.b.e.a.da.a(:13)
at b.b.e.a.da$a.a(:6589)
at com.google.firebase.firestore.f.y.b(:730)
at com.google.firebase.firestore.c.h.a(:215)
at com.google.firebase.firestore.c.va.c(:103)
at com.google.firebase.firestore.c.va.a(:142)
at com.google.firebase.firestore.c.t.a(:530)
at com.google.firebase.firestore.c.q.run(Unknown Source:6)
at com.google.firebase.firestore.c.na.a(:180)
at com.google.firebase.firestore.c.t.a(:520)
at com.google.firebase.firestore.b.P.a(:178)
at com.google.firebase.firestore.b.m.a(:91)
at com.google.firebase.firestore.b.z.b(:152)
at com.google.firebase.firestore.b.v.run(Unknown Source:4)
at com.google.firebase.firestore.g.j.a(:311)
at com.google.firebase.firestore.g.f.call(Unknown Source:2)
at com.google.firebase.firestore.g.j.a(:287)
at com.google.firebase.firestore.g.e.run(Unknown Source:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at com.google.firebase.firestore.g.j$a.run(:205)
at java.lang.Thread.run(Thread.java:764)

To fix this error, update android.enableR8=false in gradle.properties. You need to add this row cause default value true.

There seems to be an issue with the resource optimization (shrink code and obfuscation) when dealing with the Firestore package as seen from java.lang.AbstractMethodError: abstract method "b.b.g.w$d b.b.g.w$d.b(int)" which appears to be obfuscated code.
The help message from flutter build apk -h states that
--[no-]shrink Whether to enable code shrinking on release mode.When enabling shrinking, you also benefit from obfuscation, which shortens the names of your app’s classes and members, and optimization, which applies more aggressive strategies to further reduce the size of your app. To learn more, see: https://developer.android.com/studio/build/shrink-code (defaults to on)
You can use the --no-shrink tag when building the apk such as flutter build apk --release --no-shrink to disable shrink code and obfuscation but note that this results in a larger apk.

Related

Android Studio Layout Inspector stuck on Loading

I haven't been able to get the Android Studio Layout Inspector to work for some time on a specific project. I have tried few things found from searching around, like upgrading AS and restoring to the default settings. I am currently using the inspector image for "API 31 and T" I have also tried the others.
Looking in the idea log file, I see this exception when loading the Inspector.
2022-05-19 16:19:35,530 [ 802382] INFO - transport.TransportFileManager - Pushing layoutinspector-view-inspection.jar to /data/local/tmp/perfd/...
2022-05-19 16:19:35,666 [ 802518] INFO - transport.TransportFileManager - Successfully pushed layoutinspector-view-inspection.jar to /data/local/tmp/perfd/.
2022-05-19 16:19:35,989 [ 802841] WARN - ayoutinspector.LayoutInspector - java.lang.NoSuchMethodError: No static method mapNotNull(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence; in class Lkotlin/sequences/SequencesKt; or its super classes (declaration of 'kotlin.sequences.SequencesKt' appears in /data/app/~~O7aoUUFLvI3ubR8HLfx25g==/com.something.android.debug-ZXXoStc-19BHJGftwM6nRw==/base.apk!classes2.dex)
at com.android.tools.agent.appinspection.framework.SkiaQWorkaround.getFieldValue(SkiaQWorkaround.kt:43)
at com.android.tools.agent.appinspection.framework.SkiaQWorkaround.startRenderingCommandsCapture(SkiaQWorkaround.kt:66)
at com.android.tools.agent.appinspection.ViewLayoutInspector.startCapturing(ViewLayoutInspector.kt:371)
at com.android.tools.agent.appinspection.ViewLayoutInspector.access$startCapturing(ViewLayoutInspector.kt:71)
at com.android.tools.agent.appinspection.ViewLayoutInspector$handleStartFetchCommand$3.invoke(ViewLayoutInspector.kt:412)
at com.android.tools.agent.appinspection.ViewLayoutInspector$handleStartFetchCommand$3.invoke(ViewLayoutInspector.kt:410)
at com.android.tools.agent.appinspection.util.ThreadUtils$runOnMainThread$1.run(ThreadUtils.kt:56)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7842)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
I figured from the error that these functions were not being included in the final apk. I wrote some code that would force it to be included like:
fun makeLayoutInspectorHappy() {
sequenceOf("").mapNotNull(null)
(0F).roundToInt()
}
But the list of functions kept growing. Looking into why these functions were not there in the first place, I saw that another developer had enabled minification for the debug build.
debug {
minifyEnabled true
}
I changed it to false and the Layout Inspector now works!

New Jetpack paging library makes app crash - NEW

I've updated the following libraries:
- kotlin.reflect to 1.5.31
- room.paging to 2.4.0-alpha05
- room.ktx to 2.4.0-alpha05
and now all features of my app that use list of Room objects with Flow and Paging (all my RecyclerViews actually) crash with the following vague exception:
java.lang.AbstractMethodError: abstract method "java.lang.Object androidx.paging.PagingDataDiffer.presentNewList(androidx.paging.NullPaddedList, androidx.paging.NullPaddedList, int, kotlin.jvm.functions.Function0, kotlin.coroutines.Continuation)"
at androidx.paging.PagingDataDiffer$collectFrom$2$1$1.invokeSuspend(PagingDataDiffer.kt:151)
at androidx.paging.PagingDataDiffer$collectFrom$2$1$1.invoke(Unknown Source:8)
at androidx.paging.PagingDataDiffer$collectFrom$2$1$1.invoke(Unknown Source:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:165)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
at androidx.paging.PagingDataDiffer$collectFrom$2$invokeSuspend$$inlined$collect$1.emit(Collect.kt:135)
at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:62)
at kotlinx.coroutines.flow.FlowKt__ChannelsKt.access$emitAllImpl(Channels.kt:1)
at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Unknown Source:14)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:69)
at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:244)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:161)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:398)
at kotlinx.coroutines.CancellableContinuationImpl.completeResume(CancellableContinuationImpl.kt:514)
at kotlinx.coroutines.channels.AbstractChannel$ReceiveElement.completeResumeReceive(AbstractChannel.kt:907)
at kotlinx.coroutines.channels.ArrayChannel.offerInternal(ArrayChannel.kt:83)
at kotlinx.coroutines.channels.AbstractSendChannel.send(AbstractChannel.kt:134)
at androidx.paging.PageFetcherSnapshot.doInitialLoad(PageFetcherSnapshot.kt:318)
at androidx.paging.PageFetcherSnapshot.access$doInitialLoad(PageFetcherSnapshot.kt:55)
at androidx.paging.PageFetcherSnapshot$doInitialLoad$1.invokeSuspend(Unknown Source:14)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8512)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
If I restore the previous version of the libraries everything works fine once again. Please help !
NOTE:
Do not bind this question to the following one:
Paging crash
because the answer to that question is not even related to this one because the Compose package is not used or even included in my project, and it doesn't work ( I tested it).
Use Paging 3.1.0-beta01 to fix, or revert Room back to stable 2.3.0.
The Paging library seems to have broken binary compatibility between 3.0.x and 3.1.0, and Room 2.4.0-alpha05+ is using the updated contract.
This is most likely related to the new room-paging library. They talk a lot about new paging interop requirements in the release notes, but I don't see anything which calls out strict version requirements. https://developer.android.com/jetpack/androidx/releases/room#2.4.0-beta01

Firebase not working com.google.firebase.installations.FirebaseInstallationsException

I am working on an Android app, I was in a situation that I want to move the app to a new firebase project, so I removed the old firebase project and created a new one, then I added my app to that project. After that, no firebase functionalities are working.
I have firebase cloud messaging in my app, it was working but it's not working now, I am not receiving FirebaseMessagingService$onNewTokenand also I am using firestore as my back-end database. Inside my .addOnSuccessListener I am getting 0 documents back. It's not failing but returning no documents.
I thought might be a problem with firebase, so I created a test app in node.js and I try to fetch documents from firestore it's working fine.
The android app is not crashing, but checked the error log, and I am seeing the following log.
java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
at com.google.firebase.iid.zzs.zzb(com.google.firebase:firebase-iid##20.1.1:54)
at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid##20.1.1:89)
at com.google.firebase.iid.zzv.run(Unknown Source:12)
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)
Caused by: com.google.firebase.installations.FirebaseInstallationsException
at com.google.firebase.installations.FirebaseInstallations.doRegistrationInternal(com.google.firebase:firebase-installations##16.0.0:333)
at com.google.firebase.installations.FirebaseInstallations.doGetId(com.google.firebase:firebase-installations##16.0.0:280)
at com.google.firebase.installations.FirebaseInstallations.access$lambda$0(Unknown Source:0)
at com.google.firebase.installations.FirebaseInstallations$$Lambda$1.run(Unknown Source:2)
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) 
2020-03-05 21:18:49.022 23658-23666/app.spidy.cyberwire E/spidy.cyberwir: Something went wrong getting fds from adb. Retry!: Success
2020-03-05 21:20:11.198 23658-24183/app.spidy.cyberwire E/FirebaseInstanceId: Failed to get FIS auth token
java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
at com.google.firebase.iid.zzs.zzb(com.google.firebase:firebase-iid##20.1.1:54)
at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid##20.1.1:89)
at com.google.firebase.iid.zzv.run(Unknown Source:12)
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)
Caused by: com.google.firebase.installations.FirebaseInstallationsException
at com.google.firebase.installations.FirebaseInstallations.doRegistrationInternal(com.google.firebase:firebase-installations##16.0.0:333)
at com.google.firebase.installations.FirebaseInstallations.doGetId(com.google.firebase:firebase-installations##16.0.0:280)
at com.google.firebase.installations.FirebaseInstallations.access$lambda$0(Unknown Source:0)
at com.google.firebase.installations.FirebaseInstallations$$Lambda$1.run(Unknown Source:2)
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) 
2020-03-05 21:22:41.287 23658-24278/app.spidy.cyberwire E/FirebaseInstanceId: Failed to get FIS auth token
java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
at com.google.firebase.iid.zzs.zzb(com.google.firebase:firebase-iid##20.1.1:54)
at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid##20.1.1:89)
at com.google.firebase.iid.zzv.run(Unknown Source:12)
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)
Caused by: com.google.firebase.installations.FirebaseInstallationsException
at com.google.firebase.installations.FirebaseInstallations.doRegistrationInternal(com.google.firebase:firebase-installations##16.0.0:333)
at com.google.firebase.installations.FirebaseInstallations.doGetId(com.google.firebase:firebase-installations##16.0.0:280)
at com.google.firebase.installations.FirebaseInstallations.access$lambda$0(Unknown Source:0)
at com.google.firebase.installations.FirebaseInstallations$$Lambda$1.run(Unknown Source:2)
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) 
2020-03-05 21:27:11.330 23658-24399/app.spidy.cyberwire E/FirebaseInstanceId: Failed to get FIS auth token
java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException
at com.google.android.gms.tasks.Tasks.zzb(Unknown Source:61)
at com.google.android.gms.tasks.Tasks.await(Unknown Source:23)
at com.google.firebase.iid.zzs.zzb(com.google.firebase:firebase-iid##20.1.1:54)
at com.google.firebase.iid.zzs.zza(com.google.firebase:firebase-iid##20.1.1:89)
at com.google.firebase.iid.zzv.run(Unknown Source:12)
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)
Caused by: com.google.firebase.installations.FirebaseInstallationsException
at com.google.firebase.installations.FirebaseInstallations.doRegistrationInternal(com.google.firebase:firebase-installations##16.0.0:333)
at com.google.firebase.installations.FirebaseInstallations.doGetId(com.google.firebase:firebase-installations##16.0.0:280)
at com.google.firebase.installations.FirebaseInstallations.access$lambda$0(Unknown Source:0)
at com.google.firebase.installations.FirebaseInstallations$$Lambda$1.run(Unknown Source:2)
If you have recently change your google-services.json file then just delete build folder from android project and re-build your project.
I had the same problem because access to internet (wifi and mobile) was disabled
I had the same problem (Failed to get FIS auth token) with firebase-messaging version 20.1.1 and 20.1.2. I've solved it by downgrading to 20.1.0.
It looks like Firebase team has some problems with these versions according to Release Notes:
Warning: The following two library versions released with this update have known issues and should not be used: firebase-messaging v20.1.1 and firebase-iid v20.1.0.
Firebase Android SDK updates on February 27 (M65) and afterwards introduced a new infrastructure service, the Firebase Installations SDK which comes with a dependency on the Firebase Installations API.
Firebase Installations requires valid Firebase options API key, project ID, and application ID (a.k.a. "appId") in order to successfully communicate with Firebase servers.
Errors during communication with the Firebase Installations API indicate invalid Firebase options or misconfigurations regarding API keys.
To mitigate the issue
make sure that your application is using valid Firebase options from the latest google-services.json file from your Firebase console:
Firebase options: instructions and background.
If you use API restrictions, make sure that the API key used by your application is white-listed for the Firebase Installations API (and for your application):
API restrictions: instructions and background
Regarding Application restrictions: Either set the radio button to None or make sure that your app is white-listed (with the correct SHA-1 certificate).
For details, please visit:
https://firebase.google.com/support/privacy/init-options
I had the same issue and in my case, my android emulator didn't have Google Play Services added. Created a new one with Google Play Services services and it worked.
Instead of downgrading, enable Firebase Installation API to your firebase key from
Firebase: 403 PERMISSION_DENIED (FirebaseError: Installations): Requests are blocked, after updating SDKs (FirebaseInstallationsService)
Solution 1
If you made any configuration changes in the firebase console - Redownload and update google-services.json file in the project.
Solution 2
If You are using a Real device Check your Internet connection.
If you are using android studio Emulator - Establish an internet connection by resetting the emulator.
2.1. Open Tools -> AVD manager
2.2. Wipe Data of the emulator
Run Project using fresh emulator.
just delete the google-services.json file form the project ,clean project, after that rebuild the project
There could be multiple reasons for the above error. The one which I have faced is due to SHA-1 certificate fingerprint restrictions.
Was facing the above issue for the Android in the store build due to restrictions.
Steps to avoid this error.
Add your SHA-1 certificate fingerprint to the firebase project setup
Also add the same SHA-1 certificate fingerprint in Google Cloud Console.
Steps to add SHA-1 certificate fingerprint to Google Cloud Console:
Open Google Cloud Console & Select your project
Click API`s & Services Tab
Then Select Creditionals
Then go API Section
And Finally, check your SHA-1 Key is added on Restrict usage to your Android apps section or not. If not add it with the package name and SHA-1 Key.
I had the same issue and in my case, so i run two commands "flutter clean" and then "flutter pub get" and it works for me.
I tried all the solutions. Nothing worked. Ultimately I had to delete the Application from the Firebase project, re-create it and add the newly generated google-services.json.
While at it, I also changed the Firebase-flutter dependencies to
firebase_core: ^1.5.0
firebase_messaging: ^10.0.5
And android dependencies to
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:28.3.1')
implementation "com.google.firebase:firebase-messaging:21.0.1"
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.android.support:multidex:1.0.3'
My issue had started after I added the SHA-1 code after setting up the application.
I encountered this on my Flutter app but none of the solutions I found online works. After a dozen hair-pulling hours, what works for me is to run it in release mode via.
flutter build apk
and install it via adb
adb install project/build/app/outputs/flutter-apk/app-release.apk
Replace google-services.json file
Delete project in Firebase console & re-create again
Deleting Generated & Build files
Flutter clean
Non of above worked for me.
I had to change the application id & re-created firebase app again
We also encountered the same issue, while checking the google-services.json file, we found two entries of same key "api_key" .. removing the duplicate entry got the project working.
(Maybe it was due to corrupted json file download from console, which might be solved if downloaded again, as mentioned in the previous answers)
Make sure that your date and time on emulator are correct. It fixes the issue for me.

Cannot load custom model from ML Kit: FirebaseMLException: The load task failed

I am following the Codelab: https://codelabs.developers.google.com/codelabs/mlkit-android-custom-model/#0 and it works as it is, but as soon as I remove the provided local model to force using the cloud model, I get an obscure error.
What I do different to the codelab is:
// manager.registerLocalModelSource(localModelSource)
manager.registerCloudModelSource(cloudSource)
return FirebaseModelOptions.Builder()
.setCloudModelName(HOSTED_MODEL_NAME)
// .setLocalModelName("asset")
.build()
Commenting out the "local" model configuration, so I force the project to use the hosted ML Kit model.
However, I get the following error when running my model:
E/MainActivity: com.google.firebase.ml.common.FirebaseMLException: The load task failed
com.google.android.gms.tasks.RuntimeExecutionException: com.google.firebase.ml.common.FirebaseMLException: The load task failed
at com.google.android.gms.tasks.zzu.getResult(Unknown Source:17)
at work.beltran.mlkitcustommodelcodelab.MainActivity$onCreate$$inlined$use$lambda$1.then(MainActivity.kt:61)
at com.google.android.gms.tasks.zzd.run(Unknown Source:26)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:172)
at android.app.ActivityThread.main(ActivityThread.java:6590)
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:807)
Caused by: com.google.firebase.ml.common.FirebaseMLException: The load task failed
at com.google.android.gms.internal.firebase_ml.zzgy.zzf(Unknown Source:75)
at com.google.android.gms.internal.firebase_ml.zzgu.call(Unknown Source:8)
at com.google.android.gms.internal.firebase_ml.zzgp.zza(Unknown Source:0)
at com.google.android.gms.internal.firebase_ml.zzgq.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:172)
at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: com.google.firebase.ml.common.FirebaseMLException: Cannot load custom model
at com.google.android.gms.internal.firebase_ml.zzhn.zzey(Unknown Source:148)
at com.google.android.gms.internal.firebase_ml.zzha.zzfb(Unknown Source:75)
at com.google.android.gms.internal.firebase_ml.zzha.call(Unknown Source:0)
at com.google.android.gms.internal.firebase_ml.zzgp.zza(Unknown Source:0) 
at com.google.android.gms.internal.firebase_ml.zzgq.run(Unknown Source:4) 
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:172) 
at android.os.HandlerThread.run(HandlerThread.java:65) 
My project can be found here: https://github.com/miquelbeltran/codelab-mlkit-android-custom-model/tree/4aa336d9efca6eafcd01acc9417ad194aa12233e
Some stuff I tried:
My project has internet permission and Firebase Analytics works, as I can see events on the DebugView.
The local model is the same as the hosted model in ML Kit.
The model name is correct.
Running on a rooted emulator, navigating to the app data folder, I can find my models folder named like this:
/data/data/work.beltran.mlkitcustommodelcodelab/no_backup/com.google.firebase.ml.custom.models/W0RFRkFVTFRd+MTo2ODI2MzU4OTg3OTY6YW5kcm9pZDozMGYwZDA3MmQ5NDBjODEx/mobilenet
However the folder is empty
My only guess: Firebase decides to not to download the model for some reason, can't figure out why.
I had to add the SHA certificate fingerprints to make it work.
If you are missing that step, the ML model will not be downloaded.
Follow the instructions here to generate the SHA for your certificates: https://developers.google.com/android/guides/client-auth
And introduce the output on your device project settings.

Installation apk in android 8.0 error

I have benn trying for many days to install an app on any device using android oreo either in debug mode with android studio either by creating apk, but I still fail. At the beggining I had issue described here install_failed_no_matching_abis failed to extract native libraries res=-113 after updating to android 8.0 oreo
and while I am trying to solve this I get different errors all the time.
When I set android.enableAapt2=true I get this error
when I set android.enableAapt2=false I get warning
The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
I`t will be removed at the end of 2018..`
and finally this error comes up
and this in log Mesagges
04-17 01:37:27.331 9763-11258/? E/xiy: Job(ItemMessageAttachmentsCacheEvictorJob#0.126) Enqueued job 'ItemMessageAttachmentsCacheEvictorJob' failed
java.lang.IllegalArgumentException: Attachment cache cannot be null.
at piu.a(Unknown Source:4)
at pki.a(Unknown Source:17)
at yik.a(SourceFile:1)
at xik.b(SourceFile:2)
at xil.a(Unknown Source:4)
at yik.a(SourceFile:1)
at yhr.run(SourceFile:1)
at wzc.run(Unknown Source:3)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:782)
Either way I cannot install my app on any device running oreo although it works fine up to nougat.Even if I buld apk ig get error parsing apk file.

Categories

Resources