java.lang.NoClassDefFoundError firebase Firestore android - android

Could not find
class 'com.google.firebase.firestore.QueryListenOptions', referenced from method com.firebase.ui.firestore.FirestoreRecyclerOptions$Builder.setQuery
07-20 18:23:10.220 10100-10100/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.dpvtechnology.zemon, PID: 10100
java.lang.NoClassDefFoundError: com.google.firebase.firestore.QueryListenOptions
at com.firebase.ui.firestore.FirestoreRecyclerOptions$Builder.setQuery(FirestoreRecyclerOptions.java:117)

Did you use progaurd?
If so, these type of problems usually are caused by it. Check your progaurd roles.
you can add this rule to your proguard rules to solve the problem
-keep class com.google.firebase.firestore.QueryListenOptions { *; }

Related

Dynamic feature: Unable to instantiate fragment : make sure class name exists

I'm trying to load my fragment that lives in a dynamic feature module. However, I keep getting a crash:
val f = FragmentFactory().instantiate(classLoader,
"com.myapp.customviewdynamicfeature.CustomFragment")
supportFragmentManager.beginTransaction()
.add(R.id.customFragmentContainer, f).commit()
2022-03-25 11:36:54.020 20732-20732/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myapp.dynamicdeliverysampleapp, PID: 20732
androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.myapp.customviewdynamicfeature.CustomFragment: make sure class name exists
at androidx.fragment.app.FragmentFactory.loadFragmentClass(FragmentFactory.java:97)
at
I also tried adding this to my dynamic module's proguard
-keep class com.myapp.customviewdynamicfeature.** { *; }
I've also tried reflection:
val f = Class.forName("com.myapp.customviewdynamicfeature.CustomFragment").newInstance() as Fragment
but I get a similar error:
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:558)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Caused by: java.lang.reflect.InvocationTargetException
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) 
Caused by: java.lang.ClassNotFoundException: com.myapp.customviewdynamicfeature.CustomFragment
I believe I resolved this by upgrading the AndroidX fragment version to 1.5.0.
https://developer.android.com/jetpack/androidx/releases/fragment#version_15_2

Appsflyer Crash : Fatal Exception: java.lang.NoSuchMethodError for MultipleInstallBroadcastReceiver.java line 43

I am getting a Crash which is reported in Crashlytics for com.appsflyer.MultipleInstallBroadcastReceiver.onReceive in MultipleInstallBroadcastReceiver.java class
This Crash is been reported for few users in all the android verisons
Fatal Exception: java.lang.NoSuchMethodError: No virtual method 藡(Landroid/content/Context;Landroid/content/Intent;)V in class Lcom/appsflyer/AppsFlyerLib; or its super classes (declaration of 'com.appsflyer.AppsFlyerLib' appears in /data/app/com.rapido.passenger-1/base.apk)
at com.appsflyer.MultipleInstallBroadcastReceiver.onReceive(MultipleInstallBroadcastReceiver.java:43)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3112)
at android.app.ActivityThread.-wrap18(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1627)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:165)
at android.app.ActivityThread.main(ActivityThread.java:6375)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
From the stack trace it seems to be an obfuscation issue (looking at the method name 藡)
What is the SDK version being used? Are there any proGuard (or other tool) rules configured for AppsFlyer?
If not I would suggest adding a -keep class com.appsflyer.** { *; } rule.
If you do not wish to share any additional information publicly, you can open a ticket with support#appsflyer.com, with the SDK version, any obfuscation related information and a link to this thread.

Error Unable to instantiate service com.google.firebase.iid.FirebaseInstanceIdService: java.lang.ClassNotFoundException- in Proguard Enabled release

I am getting below mentioned error,
I cleaned the project, also Invalidate and restart done. but still same problem.
Proguard is enabled.-android studio:3.3.1
java.lang.RuntimeException: Unable to instantiate service com.google.firebase.iid.FirebaseInstanceIdService: java.lang.ClassNotFoundException: Didn't find class
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.iid.FirebaseInstanceIdService" on path: DexPathList
Simple add -keep class com.google.firebase.iid.FirebaseInstanceIdService in your ProGuard configuration file.

Indoor Atlas: App build successfully but not run on Nexus 9 Tab(App has stopped working)

Indoor Atlas app is build successfully but there is some error I found on logcat that I post here. Can anyone tell me How can I solved that error and make my app runnable?
03 10:25:48.893 5152-5168/? E/AndroidRuntime: FATAL EXCEPTION: IdaSensorReadingManager
Process: com.test.indoornavigation, PID: 5152
java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/com.test.indoornavigation/files/assetlib.so" is 32-bit instead of 64-bit
at java.lang.Runtime.load0(Runtime.java:897)
at java.lang.System.load(System.java:1505)
at com.indooratlas._internal.db.a(SourceFile:211)
at com.indooratlas.algorithm.ClientProcessingManager.ensureNativeLibrary(SourceFile:174)
at com.indooratlas.algorithm.ClientProcessingManager.<init>(SourceFile:91)
at com.indooratlas.algorithm.ClientProcessingManager.getInstance(SourceFile:98)
at com.indooratlas._internal.an.f(SourceFile:485)
at com.indooratlas._internal.an.a(SourceFile:40)
at com.indooratlas._internal.an$a.handleMessage(SourceFile:774)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
11-03 10:25:48.956 587-1095/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 76) }
Hi I had a similar problem and I found figured out that is related to proguard rules for indoorAtlas, you need to put this in your proguard.pro file:
# Required by IndoorAtlas SDK
-keep public class com.indooratlas.algorithm.ClientProcessingManager { *; }
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
as shown here: https://github.com/IndoorAtlas/android-sdk-examples/blob/master/Basic/proguard-rules.pro
I hope this help you!

Genson with Android - Proguard config

I have a problem with proguard config in Android Project.
I'm using Genson to parse incoming JSON data.
It is fast and there is no need for extra configuration or deserializers, because on the Server-side there is also Genson.
Everything works fine in debug mode, but in release, with proguard it doesn't.
Unfortunately I have some error during runtime:
FATAL EXCEPTION: main
Process: com.es.mobile.meedy, PID: 16650
java.lang.UnsupportedOperationException: Couldn't find parameter at 0 from type interface com.owlike.genson.Converter , you should first locate the parameterized type, expand it and then use typeOf.
at com.owlike.genson.reflect.TypeUtil.typeOf(Unknown Source)
at com.owlike.genson.GensonBuilder.withConverters(Unknown Source)
at com.mypackage.f.k.a(Unknown Source)
at com.a.a.b.n.a(Unknown Source)
at com.a.a.i.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5086)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
It happens even if datamodel is in keep class. I tried all configrations with keep class, classmembers, etc. What else can i do?
EDIT
What else do I know:
I tried keep class with all classes in my project.
I have keep class with genson (-keep class com.owlike.genson.** { *; })
Instanceof with my class shows that it is instance of com.owlike.genson.Converter
The solution to the problem was to add -keepattributes Signature
If annotations are being used then this option should be enabled too -keepattributes *Annotation*
Also the application class being ser/de by Genson must also be provided:
-keep class com.mypackage.model.** { *; }
-keep class com.owlike.genson.*{ *; }
Add that line to your ProGuard configuration.
-keep [,modifier,...] class_specification
Specifies classes and class members (fields and methods) to be preserved as entry points to your
code. For example, in order to keep an application, you can specify
the main class along with its main method. In order to process a
library, you should specify all publicly accessible elements.

Categories

Resources