WrathChaos / MediaPickerLib

Kotlin based media picker library, to pick multiple images and/or vidoes from built-in gallery. Easy to implement and use :)
https://www.freakycoder.com
MIT License
49 stars 16 forks source link

Version 0.1.4 throws exception when trying to open #6

Closed sierra-delta closed 5 years ago

sierra-delta commented 5 years ago

Stacktrace when trying to run. I'm running it from a Java class. Don't know if that makes a difference.

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp/com.coursion.freakycoder.mediapicker.galleries.Gallery}: java.lang.IllegalStateException: findViewById(R.id.fab) must not be null at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2951) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6718) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.IllegalStateException: findViewById(R.id.fab) must not be null at com.coursion.freakycoder.mediapicker.galleries.Gallery.onCreate(Gallery.kt:38) at android.app.Activity.performCreate(Activity.java:7144) at android.app.Activity.performCreate(Activity.java:7135) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2931) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:6718)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 

WrathChaos commented 5 years ago

Hello @ninja-tortoise, Can you provide a small example to let me check what is wrong ?

sierra-delta commented 5 years ago

Apologies, I don't have the code I used anymore, but it was simply just starting the gallery activity

WrathChaos commented 5 years ago

Hello @ninja-tortoise, I'm going to make a new project to test the library and try to reproduce this problem. However, can you tell me which Android version are you working on?

sierra-delta commented 5 years ago

I'm on Pixel 2 XL with Android 9

WrathChaos commented 5 years ago

Hello @ninja-tortoise, I've updated the project's gradle and kotlin version. Also tested the lib on the Pixel 3 XL with Android 9. Can you please re-try the lib on another device? For now, I closed the issue. If there is still an error, please re-open the issue.