androidx.fragment.app.Fragment $ InstantiationException в Playstore - PullRequest
1 голос
/ 26 марта 2020

В магазине Play Store есть несколько журналов cra sh, которые я не могу воспроизвести:

Как и в журналах ниже MyActivity расширяет BaseActivity, BaseActivity расширяет AppCompatActivity и получает называется onCreate of androidx AppCompatActivity

используемая зависимость implementation 'androidx.appcompat:appcompat:1.1.0'

public class AppCompatActivity extends FragmentActivity implements AppCompatCallback,
        TaskStackBuilder.SupportParentable, ActionBarDrawerToggle.DelegateProvider {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
    final AppCompatDelegate delegate = getDelegate();
    delegate.installViewFactory();
    delegate.onCreate(savedInstanceState);
    super.onCreate(savedInstanceState);
  } 
}
java.lang.RuntimeException: 
    at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3270)
    at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3409)
    at android.app.ActivityThread.handleRelaunchActivityInner (ActivityThread.java:5279)
    at android.app.ActivityThread.handleRelaunchActivity (ActivityThread.java:5187)
    at android.app.servertransaction.ActivityRelaunchItem.execute (ActivityRelaunchItem.java:69)
    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:2016)
    at android.os.Handler.dispatchMessage (Handler.java:107)
    at android.os.Looper.loop (Looper.java:214)
    at android.app.ActivityThread.main (ActivityThread.java:7356)
    at java.lang.reflect.Method.invoke (Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
    at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:930)
    Caused by: androidx.fragment.app.Fragment$InstantiationException: 
    at androidx.fragment.app.Fragment.instantiate (Fragment.java:563)
    at androidx.fragment.app.FragmentContainer.instantiate (FragmentContainer.java:57)
    at androidx.fragment.app.FragmentManager$3.instantiate (FragmentManager.java:394)
    at androidx.fragment.app.FragmentStateManager.<init> (FragmentStateManager.java:72)
    at androidx.fragment.app.FragmentManager.restoreSaveState (FragmentManager.java:2666)
    at androidx.fragment.app.FragmentController.restoreSaveState (FragmentController.java:196)
    at androidx.fragment.app.FragmentActivity.onCreate (FragmentActivity.java:287)
    at androidx.appcompat.app.AppCompatActivity.onCreate (AppCompatActivity.java:106)
    **at com.activities.BaseActivity.onCreate (BaseActivity.java:162)
    at com.activities.MyOwnActivity.onCreate (MyActivity.java:65)**
    at android.app.Activity.performCreate (Activity.java:7825)
    at android.app.Activity.performCreate (Activity.java:7814)
    at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1306)
    at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3245)
    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:548)

Есть ли у нас какое-либо решение для этого?

...