android-crop
android-crop copied to clipboard
Doesn't work on Nexus devices
This library works perfectly fine with all devices except the Nexus 5 and 6 I tried. A possible reason could be that the Nexus devices give a null result on photo Activity if given a URI in the intent.
I second this. It does not appear to work on my Nexus 7 either:
This is the error I get when I try to use the library on my old Nexus 7. It works fine in the emulator and on an Asus Transformer:
D/AndroidRuntime( 7714): Shutting down VM
E/AndroidRuntime( 7714): FATAL EXCEPTION: main
E/AndroidRuntime( 7714): Process: org.phd, PID: 7714
E/AndroidRuntime( 7714): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=6709, result=0, data=null} to activity {org.phd/org.phd.UnwrappedActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Parcelable android.content.Intent.getParcelableExtra(java.lang.String)' on a null object reference
E/AndroidRuntime( 7714): at android.app.ActivityThread.deliverResults(ActivityThread.java:3574)
E/AndroidRuntime( 7714): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3617)
E/AndroidRuntime( 7714): at android.app.ActivityThread.access$1300(ActivityThread.java:151)
E/AndroidRuntime( 7714): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1352)
E/AndroidRuntime( 7714): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 7714): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 7714): at android.app.ActivityThread.main(ActivityThread.java:5254)
E/AndroidRuntime( 7714): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 7714): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 7714): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/AndroidRuntime( 7714): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
E/AndroidRuntime( 7714): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Parcelable android.content.Intent.getParcelableExtra(java.lang.String)' on a null object reference
E/AndroidRuntime( 7714): at com.soundcloud.android.crop.Crop.getOutput(Crop.java:158)
E/AndroidRuntime( 7714): at org.phd.UnwrappedActivity.onActivityResult(UnwrappedActivity.scala:57)
E/AndroidRuntime( 7714): at android.app.Activity.dispatchActivityResult(Activity.java:6192)
E/AndroidRuntime( 7714): at android.app.ActivityThread.deliverResults(ActivityThread.java:3570)
E/AndroidRuntime( 7714): ... 10 more
This is the code:
override def onActivityResult(requestCode: Int, resultCode: Int, data: Intent): Unit = requestCode match {
case Crop.REQUEST_CROP =>
val intent = SIntent[CroppedActivity]
intent setData Crop.getOutput(data) // This is line 57
startActivity(intent)
}
Thanks for the report. I'll try to reproduce on a Nexus 7.
Any progress on this issue?