Home > Mobile >  Unable to instantiate fragment error after renaming android package
Unable to instantiate fragment error after renaming android package

Time:07-12

enter image description hereI renamed my android package from com.example.remote to com.mqtttools.com and my app did not work after that so I tried changing it back but is still does not work. I was following a stackowerflow answer that worked for many people.

I'm getting this "Unable to instantiate fragment mqtttools.remote.FirstFragment: make sure class name exists" error but the thing is that my package name is com.example.com and not mqtttools.remote.

Error trace 1

Error trace 2

CodePudding user response:

Have you defined the fragment in XML? If yes then please check the Fully classified class name in XML. You need to update the package in the XML to resolve this error.

CodePudding user response:

I was able to figure out the cause of the problem but not the solution. Something bad happened while renaming the package name across the myriad of files and it became corrupted. The only way that I was able to fix it is by creating a whole new project and copy/pasting all of the code.

Hope it saves the time for some of you who encounter the same problem.

  • Related