akexorcist / Localization

[Android] In-app language changing library
Apache License 2.0
983 stars 154 forks source link

java.lang.NoSuchMethodException: #90

Closed filipstojakovic closed 3 years ago

filipstojakovic commented 3 years ago

Sometimes i get this error...i was using 1.2.4 version

java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3308) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3457) at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2044) at android.os.Handler.dispatchMessage (Handler.java:107) at android.os.Looper.loop (Looper.java:223) at android.app.ActivityThread.main (ActivityThread.java:7562) at java.lang.reflect.Method.invoke (Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:950) Caused by: androidx.fragment.app.Fragment$InstantiationException: at androidx.fragment.app.Fragment.instantiate (Fragment.java:3) at androidx.fragment.app.FragmentContainer.instantiate (FragmentContainer.java:3) at androidx.fragment.app.FragmentManager$3.instantiate (FragmentManager.java:3) at androidx.fragment.app.FragmentStateManager. (FragmentStateManager.java:10) at androidx.fragment.app.FragmentManager.restoreSaveState (FragmentManager.java:6) at androidx.fragment.app.FragmentController.restoreSaveState (FragmentController.java:3) at androidx.fragment.app.FragmentActivity.onCreate (FragmentActivity.java:3) at androidx.appcompat.app.AppCompatActivity.onCreate (AppCompatActivity.java:10) at com.akexorcist.localizationactivity.ui.LocalizationActivity.onCreate (LocalizationActivity.java:5) at com.example.MapActivity.onCreate (MapActivity.java:5) at android.app.Activity.performCreate (Activity.java:7893) at android.app.Activity.performCreate (Activity.java:7880) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1307) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3283) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3457) at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2044) at android.os.Handler.dispatchMessage (Handler.java:107) at android.os.Looper.loop (Looper.java:223) at android.app.ActivityThread.main (ActivityThread.java:7562) at java.lang.reflect.Method.invoke (Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:950) Caused by: java.lang.NoSuchMethodException: at java.lang.Class.getConstructor0 (Class.java:2332) at java.lang.Class.getConstructor (Class.java:1728) at androidx.fragment.app.Fragment.instantiate (Fragment.java:3) at androidx.fragment.app.FragmentContainer.instantiate (FragmentContainer.java:3) at androidx.fragment.app.FragmentManager$3.instantiate (FragmentManager.java:3) at androidx.fragment.app.FragmentStateManager. (FragmentStateManager.java:10) at androidx.fragment.app.FragmentManager.restoreSaveState (FragmentManager.java:6) at androidx.fragment.app.FragmentController.restoreSaveState (FragmentController.java:3) at androidx.fragment.app.FragmentActivity.onCreate (FragmentActivity.java:3) at androidx.appcompat.app.AppCompatActivity.onCreate (AppCompatActivity.java:10) at com.akexorcist.localizationactivity.ui.LocalizationActivity.onCreate (LocalizationActivity.java:5) at com.example.MapActivity.onCreate (MapActivity.java:5) at android.app.Activity.performCreate (Activity.java:7893) at android.app.Activity.performCreate (Activity.java:7880) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1307) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3283) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3457) at android.app.servertransaction.LaunchActivityItem.execute (LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2044) at android.os.Handler.dispatchMessage (Handler.java:107) at android.os.Looper.loop (Looper.java:223) at android.app.ActivityThread.main (ActivityThread.java:7562) at java.lang.reflect.Method.invoke (Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:950)

akexorcist commented 3 years ago

Could you update the library version to 1.2.6? There's many changes from 1.2.4.

filipstojakovic commented 3 years ago

Again, but now with new version 1.2.6. It doesn't happen often, but it happens.

java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2638) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2720) at android.app.ActivityThread.access$900 (ActivityThread.java:196) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1538) at android.os.Handler.dispatchMessage (Handler.java:111) at android.os.Looper.loop (Looper.java:210) at android.app.ActivityThread.main (ActivityThread.java:5982) at java.lang.reflect.Method.invoke (Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:852) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:742) Caused by: androidx.fragment.app.Fragment$InstantiationException: at androidx.fragment.app.Fragment.instantiate (Fragment.java:3) at androidx.fragment.app.FragmentContainer.instantiate (FragmentContainer.java:3) at androidx.fragment.app.FragmentManager$3.instantiate (FragmentManager.java:3) at androidx.fragment.app.FragmentStateManager. (FragmentStateManager.java) at androidx.fragment.app.FragmentManager.restoreSaveState (FragmentManager.java:6) at androidx.fragment.app.FragmentController.restoreSaveState (FragmentController.java:3) at androidx.fragment.app.FragmentActivity.onCreate (FragmentActivity.java:3) at androidx.appcompat.app.AppCompatActivity.onCreate (AppCompatActivity.java) at com.akexorcist.localizationactivity.ui.LocalizationActivity.onCreate (LocalizationActivity.java:5) at com.example.MapActivity.onCreate (MapActivity.java:5) at android.app.Activity.performCreate (Activity.java:6444) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1116) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2585) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2720) at android.app.ActivityThread.access$900 (ActivityThread.java:196) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1538) at android.os.Handler.dispatchMessage (Handler.java:111) at android.os.Looper.loop (Looper.java:210) at android.app.ActivityThread.main (ActivityThread.java:5982) at java.lang.reflect.Method.invoke (Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:852) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:742) Caused by: java.lang.NoSuchMethodException: at java.lang.Class.getConstructor (Class.java:528) at java.lang.Class.getConstructor (Class.java:492) at androidx.fragment.app.Fragment.instantiate (Fragment.java:3) at androidx.fragment.app.FragmentContainer.instantiate (FragmentContainer.java:3) at androidx.fragment.app.FragmentManager$3.instantiate (FragmentManager.java:3) at androidx.fragment.app.FragmentStateManager. (FragmentStateManager.java) at androidx.fragment.app.FragmentManager.restoreSaveState (FragmentManager.java:6) at androidx.fragment.app.FragmentController.restoreSaveState (FragmentController.java:3) at androidx.fragment.app.FragmentActivity.onCreate (FragmentActivity.java:3) at androidx.appcompat.app.AppCompatActivity.onCreate (AppCompatActivity.java) at com.akexorcist.localizationactivity.ui.LocalizationActivity.onCreate (LocalizationActivity.java:5) at com.example.MapActivity.onCreate (MapActivity.java:5) at android.app.Activity.performCreate (Activity.java:6444) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1116) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2585) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2720) at android.app.ActivityThread.access$900 (ActivityThread.java:196) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1538) at android.os.Handler.dispatchMessage (Handler.java:111) at android.os.Looper.loop (Looper.java:210) at android.app.ActivityThread.main (ActivityThread.java:5982) at java.lang.reflect.Method.invoke (Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:852) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:742)

akexorcist commented 3 years ago

@filipstojakovic

akexorcist commented 3 years ago

Refer to java.lang.NoSuchMethodException for onCreate. I think this gonna caused by your implementation. Because this is not direct exception from my library but coming from Fragment.instantiate method.

filipstojakovic commented 3 years ago

It happend on Huawei y6 2017 (Android 6). Thank you, i will take a look.