cafebazaar / BazaarPay

https://bazaarpay.ir
Apache License 2.0
14 stars 0 forks source link

java.lang.ClassNotFoundException at ActivityBazaarPayBinding.java:44 #18

Closed BasetEsmaeili closed 1 year ago

BasetEsmaeili commented 1 year ago

Hello 👋🏻. Describe the bug When we launched the BazaarPay Activity, the library crashed with this Stacktrcae:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nazdika.app/ir.cafebazaar.bazaarpay.BazaarPayActivity}: android.view.InflateException: Binary XML file line #31 in com.nazdika.app:layout/activity_bazaar_pay: Binary XML file line #31 in com.nazdika.app:layout/activity_bazaar_pay: Error inflating class fragment at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3683) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3840) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:105) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:136) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2252) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7941) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:553) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) Caused by: android.view.InflateException: Binary XML file line #31 in com.nazdika.app:layout/activity_bazaar_pay: Binary XML file line #31 in com.nazdika.app:layout/activity_bazaar_pay: Error inflating class fragment Caused by: android.view.InflateException: Binary XML file line #31 in com.nazdika.app:layout/activity_bazaar_pay: Error inflating class fragment Caused by: java.lang.RuntimeException: Exception inflating com.nazdika.app:navigation/bazaarpay_nav_graph line 102 at androidx.navigation.NavInflater.inflate(NavInflater.kt:70) at androidx.navigation.NavController.setGraph(NavController.kt:1039) at androidx.navigation.fragment.NavHostFragment.onCreate(NavHostFragment.kt:155) at androidx.fragment.app.Fragment.performCreate(Fragment.java:3090) at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475) at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:257) at androidx.fragment.app.FragmentLayoutInflaterFactory.onCreateView(FragmentLayoutInflaterFactory.java:142) at androidx.fragment.app.FragmentController.onCreateView(FragmentController.java:136) at androidx.fragment.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:248) at androidx.fragment.app.FragmentActivity.onCreateView(FragmentActivity.java:227) at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1073) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1001) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965) at android.view.LayoutInflater.rInflate(LayoutInflater.java:1127) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088) at android.view.LayoutInflater.inflate(LayoutInflater.java:686) at android.view.LayoutInflater.inflate(LayoutInflater.java:538) at ir.cafebazaar.bazaarpay.databinding.ActivityBazaarPayBinding.inflate(ActivityBazaarPayBinding.java:44) at ir.cafebazaar.bazaarpay.databinding.ActivityBazaarPayBinding.inflate(ActivityBazaarPayBinding.java:38) at ir.cafebazaar.bazaarpay.BazaarPayActivity.onCreate(BazaarPayActivity.kt:28) at android.app.Activity.performCreate(Activity.java:8060) at android.app.Activity.performCreate(Activity.java:8040) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3653) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3840) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:105) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:136) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2252) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7941) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:553) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: ir.cafebazaar.bazaarpay.data.bazaar.models.ErrorModel at androidx.navigation.NavType$Companion.fromArgType(NavType.kt:163) at androidx.navigation.NavInflater.inflateArgument(NavInflater.kt:165) at androidx.navigation.NavInflater.inflateArgumentForDestination(NavInflater.kt:130) at androidx.navigation.NavInflater.inflate(NavInflater.kt:103) at androidx.navigation.NavInflater.inflate(NavInflater.kt:114) at androidx.navigation.NavInflater.inflate(NavInflater.kt:64) ... 35 more Caused by: java.lang.ClassNotFoundException: ir.cafebazaar.bazaarpay.data.bazaar.models.ErrorModel at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:454) at java.lang.Class.forName(Class.java:379) at androidx.navigation.NavType$Companion.fromArgType(NavType.kt:146) ... 40 more Caused by: java.lang.ClassNotFoundException: ir.cafebazaar.bazaarpay.data.bazaar.models.ErrorModel ... 44 more

To Reproduce Just launch BazaarPay Activity.

Screenshots

image

This report is just for one day.

Versions

alibagherifam commented 1 year ago

@BasetEsmaeili Can you reproduce it in version 4.0.0? It could be related to the obfuscation of ErrorModel as a Parcelable/Serializable navigation argument type. After setting minifyEnabled to false in this commit, everything should be fine.

hamidrezasahraei commented 1 year ago

@BasetEsmaeili @alibagherifam It has been fixed in the 3.0.0 version.