question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash on SearchActivity

See original GitHub issue

Issue / Feature - Issue FolioReader version - 0.4.2 FolioReader Stock / Modified - Stock Android SDK - 7.0 Mobile / Tablet / Emulator Info - Samsung Galaxy J7 (2016) Crash / Error - Crash

Steps to reproduce / Describe in detail -

App crash when I tap search. The library is included as module.

Here is the message i get.

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.karv.lxphlaws/com.folioreader.ui.folio.activity.SearchActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.Toolbar.addOnLayoutChangeListener(android.view.View$OnLayoutChangeListener)' on a null object reference
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2984)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
                      at android.app.ActivityThread.-wrap14(ActivityThread.java)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:154)
                      at android.app.ActivityThread.main(ActivityThread.java:6776)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.Toolbar.addOnLayoutChangeListener(android.view.View$OnLayoutChangeListener)' on a null object reference
                      at com.folioreader.ui.folio.activity.SearchActivity.init(SearchActivity.kt:113)
                      at com.folioreader.ui.folio.activity.SearchActivity.onCreate(SearchActivity.kt:106)
                      at android.app.Activity.performCreate(Activity.java:6956)
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045) 
                      at android.app.ActivityThread.-wrap14(ActivityThread.java) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642) 
                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                      at android.os.Looper.loop(Looper.java:154) 
                      at android.app.ActivityThread.main(ActivityThread.java:6776) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408) 

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MrOluGbengacommented, Nov 2, 2018

@hrishikesh-kadam @lekhrajtiwari So I found the issue. The source of the problem is at com.folioreader.ui.folio.activity.SearchActivity.init(SearchActivity.kt:113)

“SearchActivity.java” was created when I added a search functionality to my app. I simply renamed the activity and the related “activity_search.xml” file and now it’s working again.

Thanks guys

0reactions
losscommandcommented, Nov 2, 2018

Must be a different case. Good to know that there’s another solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does my activity crash when trying to search recycler view?
The only way to not get the crash is to wait for around 4 seconds and scroll a little bit till it fully...
Read more >
Detect and diagnose crashes - Android Developers
Solving crashes can be difficult. However, if you can identify the root cause of the crash, most likely you can find a solution...
Read more >
Manage Crash Detection on iPhone 14 models - Apple Support
Use iPhone to detect a Crash Detection event. ... crash and gives them your latitudinal and longitudinal coordinates with an approximate search radius....
Read more >
How to see activity history that may have caused a Windows ...
How to see activity history that may have caused a Windows crash or restart?
Read more >
App crash in android Q(Activity top position already set to ...
The app's initial activity is coming up and showing as expected. Now, when pressing a button to bring up a second activity on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found