NullPointerException @ CropImageActivity.onCreate
See original GitHub issueHi, I get this exception… I can not recreate it because it is taken from a crashlytics. on my own device it works fine.
Please help! 😃
if (imageFiles.size()>0) {
CropImage.activity(Uri.fromFile(imageFiles.get(0)))
.setGuidelines(CropImageView.Guidelines.ON)
.setAspectRatio(1,1)
.setCropShape(CropImageView.CropShape.OVAL)
.setRequestedSize(128,128)
.start(getContext(),this);
}
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gilapps.smsshare2/com.theartofdev.edmodo.cropper.CropImageActivity}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) at android.app.ActivityThread.access$600(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5103) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java) at dalvik.system.NativeStart.main(NativeStart.java) Caused by java.lang.NullPointerException at com.theartofdev.edmodo.cropper.CropImageActivity.onCreate(CropImageActivity.java:68) at android.app.Activity.performCreate(Activity.java:5133) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) at android.app.ActivityThread.access$600(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5103) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java) at dalvik.system.NativeStart.main(NativeStart.java)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top GitHub Comments
Same as @kpradeepkumarreddy on version 2.7.0
I’m also facing the same issue in version 2.6.0, here is the crash report from Crashlytics :-
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lxltech.sc.participant/com.theartofdev.edmodo.cropper.CropImageActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘android.os.Parcelable android.os.Bundle.getParcelable(java.lang.String)’ on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2419) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2479) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5420) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method ‘android.os.Parcelable android.os.Bundle.getParcelable(java.lang.String)’ on a null object reference at com.theartofdev.edmodo.cropper.CropImageActivity.onCreate(CropImageActivity.java:63) at android.app.Activity.performCreate(Activity.java:6280) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2372) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2479) at android.app.ActivityThread.-wrap11(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1347) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5420) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)