Crashing with 3.1.1: Parameter specified as non-null is null
See original GitHub issueAfter not touching one of our project written in Java for a long time, the version 2.2.0
seems no longer available. After updating to 3.1.1
the app continues to crash when destroying the Activity that holds a TouchImageView inside a PagerAdapter. I can confirm that the issue is coming from this library since replacing the TouchImageView with AppCompatImageView eliminates this crashing issue.
Here is a stacktrace of the crash
java.lang.RuntimeException: Unable to destroy activity {com.sample.app/com.sample.app.common_views.FullScreenPostActivity}: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter bm
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4874)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4892)
at android.app.ActivityThread.access$1600(ActivityThread.java:218)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1772)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6917)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter bm
at com.ortiz.touchview.TouchImageView.setImageBitmap(TouchImageView.kt)
at com.bumptech.glide.request.target.BitmapImageViewTarget.setResource(BitmapImageViewTarget.java:33)
at com.bumptech.glide.request.target.BitmapImageViewTarget.setResource(BitmapImageViewTarget.java:10)
at com.bumptech.glide.request.target.ImageViewTarget.setResourceInternal(ImageViewTarget.java:124)
at com.bumptech.glide.request.target.ImageViewTarget.onLoadCleared(ImageViewTarget.java:94)
at com.bumptech.glide.request.SingleRequest.clear(SingleRequest.java:337)
at com.bumptech.glide.request.ThumbnailRequestCoordinator.clear(ThumbnailRequestCoordinator.java:162)
at com.bumptech.glide.manager.RequestTracker.clearAndRemove(RequestTracker.java:70)
at com.bumptech.glide.RequestManager.untrack(RequestManager.java:660)
at com.bumptech.glide.RequestManager.untrackOrDelegate(RequestManager.java:628)
at com.bumptech.glide.RequestManager.clear(RequestManager.java:624)
at com.bumptech.glide.RequestManager.onDestroy(RequestManager.java:371)
at com.bumptech.glide.manager.ActivityFragmentLifecycle.onDestroy(ActivityFragmentLifecycle.java:65)
at com.bumptech.glide.manager.SupportRequestManagerFragment.onDestroy(SupportRequestManagerFragment.java:215)
at androidx.fragment.app.Fragment.performDestroy(Fragment.java:3219)
at androidx.fragment.app.FragmentStateManager.destroy(FragmentStateManager.java:774)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:350)
at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128)
at androidx.fragment.app.FragmentManager.dispatchDestroy(FragmentManager.java:3107)
at androidx.fragment.app.FragmentController.dispatchDestroy(FragmentController.java:334)
at androidx.fragment.app.FragmentActivity.onDestroy(FragmentActivity.java:330)
at androidx.appcompat.app.AppCompatActivity.onDestroy(AppCompatActivity.java:278)
at com.sample.app.common_views.FullScreenPostActivity.onDestroy(FullScreenPostActivity.java:207)
at android.app.Activity.performDestroy(Activity.java:6843)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1169)
```
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
IllegalArgumentException: Parameter specified as non-null ...
The exception is pretty clear: you're passing null for the parameter. By default all variables and parameters in Kotlin are non-null.
Read more >Kotlin NullPointerException: Parameter specified as non- ...
The stack trace is obvious: A non-null property named username from the User class constructor (<init> is the constructor) is set to null....
Read more >Parameter specified as non-null is null · Issue #8370
The crash report kept appearing every time I opened the app. I was unable to access Nextcloud via App. I uninstalled the app...
Read more >The Checker Framework Manual: Custom pluggable types ...
The local variable ref's type is annotated as @NonNull, indicating that ref must be a reference to a non-null object.
Read more >3.x Change Log - OkHttp
Fix: Change Authenticator 's Route parameter to be nullable. This was marked as non-null but could be called with null in some cases....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I see the release job for
3.2.0
was not successful, it should solve this issuehttps://github.com/MikeOrtiz/TouchImageView/actions/workflows/Android-CI-release.yml
The
3.2.0
stuck permanently on github but jitpack.io works properly. So I created a new3.2.1
with some more dependency updates to have a clear picture