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.

NullPointerException @ CropImageActivity.onCreate

See original GitHub issue

Hi, 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
tomerpetelcommented, Jun 27, 2018

Same as @kpradeepkumarreddy on version 2.7.0

2reactions
kpradeepkumarreddycommented, Jun 4, 2018

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)

Read more comments on GitHub >

github_iconTop Results From Across the Web

NullPointerException in onCreate of Activity - Stack Overflow
Try this code may be help to you. Just change loginTwitter.setOnClickListener(new OnClickListener() {. instead of loginTwitter.
Read more >
androidx.appcompat.app.ActionBar.setTitle java code examples
CropImageActivity.onCreate(...) ? mOptions.activityTitle : getResources().getString(R.string.crop_image_activity_title); actionBar.
Read more >
android-crop - Bountysource
However, i have a little problem. When my image is cropped, result picture is rotated (90 on the right). Is a known issue...
Read more >
Android Analysis Report Mi Home_v6.11.702_apkpure.com.apk
CropImageActivity ;->showStorageToast:43, API Call: android.os. ... ScenePoiSelectWifiActivity;->onCreate:124, API Call: android.net.wifi.
Read more >
How to solve Null Pointer Exception for Android? : r/androiddev
private static MediaPlayer firePlayer; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
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