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.

java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttacher any more.

See original GitHub issue

The following ISE started to appear after update to the 1.3-SNAPSHOT due to #199.

java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttacher any more.
        at uk.co.senab.photoview.PhotoViewAttacher.getImageView(SourceFile:209)
        at uk.co.senab.photoview.PhotoViewAttacher.onGlobalLayout(SourceFile:311)
        at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:667)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2000)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4879)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776)
        at android.view.Choreographer.doCallbacks(Choreographer.java:579)
        at android.view.Choreographer.doFrame(Choreographer.java:548)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762)
        at android.os.Handler.handleCallback(Handler.java:725)
        at android.os.Handler.dispatchMessage(Handler.java:92)
        at android.os.Looper.loop(Looper.java:153)
        at android.app.ActivityThread.main(ActivityThread.java:5299)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
        at dalvik.system.NativeStart.main(Native Method)

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
mikeknoopcommented, Mar 30, 2015

Don’t do both:

mAttacher = new PhotoViewAttacher(mImageView);

and

    <uk.co.senab.photoview.PhotoView android:id="@+id/full_image"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />

Pick one or the other (this solved it for me – I have it inside a ViewPager).

0reactions
rns4731commented, Feb 24, 2015

Can confirm, still seeing the same issue using the attacher in a ViewPager. Looks like its an info log now and the attacher is still around even though the imageview no longer exists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImageView no longer exists. You should not use this ... - GitHub
java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttacher any more. #67.
Read more >
Viewpager view update error on delete using photoview and ...
Overriding getItemPosition() and returning POSITION_NONE returns an error from the PhotoAttacher saying: E/AndroidRuntime(18407): java.lang.
Read more >
java.lang.IllegalStateException: ImageView no longer exists ...
java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttacher any more.
Read more >
ImageView no longer exists. You should not use this ... - CSDN博客
java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttacher any more. 这个错误今天碰到了,下面是解决方法,直接上代码 ...
Read more >
com.wayto.android.vendor.photoView.PhotoViewAttacher.java ...
MotionEventCompat; import android.util. ... getLogger().i(LOG_TAG, "ImageView no longer exists. You should not use this PhotoViewAttacher any more.
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