-1

The current error is "Unable to instantiate activity ComponentInfo". However, the error I was getting before was NullPointException. Researching the possible answers the site provides, the ViewPager has been checked and tried a few different options given by Android Developer and tried the PagerTitleStrip with no success. The code is linked below. Before it's destroyed even more please let me know what there is to do and maybe an explanation if possible. I am new to posting on StackOverFlow so I am open to how I can optimize my questions.

Error Message:

FATAL EXCEPTION: main
      Process: chris.smellslikebacon, PID: 2458
          java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{chris.smellslikebacon/chris.smellslikebacon.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "chris.smellslikebacon.MainActivity" on path: DexPathList[[zip file "/data/app/chris.smellslikebacon-2/base.apk"],nativeLibraryDirectories=[/data/app/chris.smellslikebacon-2/lib/x86, /vendor/lib, /system/lib]]
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)

I have not tried rewriting the entire code as yet, and trying to refrain from it, however, the error was pointing to NullPointerException to my viewPager in the fragment_viewpager layout file. It is being pointed to from the ViewPagerFragment java class.

https://github.com/stringerc/SmellsLikeBacon

shmakova
  • 6,076
  • 3
  • 28
  • 44
  • 1
    Please edit your question to provide a [mcve]. This would include the Java stack trace associated with your crash ([copied from LogCat](https://stackoverflow.com/questions/23353173/unfortunately-myapp-has-stopped-how-can-i-solve-this)), along with the relevant pieces of Java code that are triggering the crash. – CommonsWare Mar 21 '17 at 12:54

1 Answers1

0

You should move your java/chris/smellslikebacon from app folder to app/src/main

After that you should change id of RecyclerView from @+id/recycleView to @+id/listRecyclerView in fragment_recyclerview.xml and it will work

shmakova
  • 6,076
  • 3
  • 28
  • 44