简体   繁体   中英

Unable to instantiate fragment com.example.Fragments.r: make sure class name exists, is public, and has an empty constructor that is public

I'm working on an issue discovered through Crashlytics, crash reporting service.

This app is using fragments. My activity:

    @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
}

When the super.onCreate line runs, I see this error on crash:

Unable to instantiate fragment com.example.Fragments.r: make sure class name exists, is public, and has an empty constructor that is public

Look close at what file it's looking for com.example.Fragments.r. What the heck file is "r". I do have a package named Fragments and have many fragment classes in there. I don't have a file named r.java in the Fragments package though, nor have I ever tried to instantiate a class that would be in r.java.

Like I said this is a crash that Crashlytics found and I'm not able to reproduce it, but it is happening a lot. Another funny thing is that the majority of crashes seem to be on Samsung Galaxy phones and the HTC One.

All my existing fragments are public and have empty public constructors, especially the ones called by this activity.

Thanks for your help!

db

"r" is probably the name of one of your Fragment classes after being processed by Proguard. And the issue may be that you didn't configure the Proguard correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM