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.

PhotoViewAttacher not found on Android 4.2.2 ?

See original GitHub issue

Hi !

I have CustomPhotoView component:

public class CustomPhotoView extends FrameLayout {

    private ImageView mDefaultImageView;
    private PhotoView mPhotoImageView;

    public CustomPhotoView(Context context) {
        super(context);
        init();
    }

    public CustomPhotoView(Context context, AttributeSet attrs) {
        super(context, attrs);
        treatAttibutes(context, attrs);
        init();
    }

    public CustomPhotoView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        treatAttibutes(context, attrs);
        init();
    }

    protected void treatAttibutes(Context context, AttributeSet attrs) {}

    protected void init() {
        // Create and setup image views
        mDefaultImageView = new ImageView(getContext());
        mPhotoImageView = new PhotoView(getContext());

    ...

I use the last PhotoView library: compile ‘com.github.chrisbanes.photoview:library:1.2.4’

It works perfectly on my S5 (Android 5.1), but on my Genymotion with Android 4.4.4 it’s failed on line:

mPhotoImageView = new PhotoView(getContext());

The error is: java.lang.NoClassDefFoundError: uk.co.senab.photoview.PhotoViewAttacher

Thank you very much for your help!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
anthony3444commented, Apr 20, 2016

The problem was linked with multidex in my Gradle.

The correct way is to set in Gradle: // Enabling multidex support. multiDexEnabled true

And this in my Application class: @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); }

Check this link too: http://stackoverflow.com/questions/36547087/android-java-lang-noclassdeffounderror-on-the-release-apk/36547147?noredirect=1#comment60698278_36547147

0reactions
Jawnnypoocommented, Apr 21, 2016

Happy you could both resolve it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

PhotoViewAttacher not found on Android 4.2.2 ? #336 - GitHub
I have CustomPhotoView component: public class CustomPhotoView extends FrameLayout { private ImageView mDefaultImageView; private PhotoView ...
Read more >
ArrayIndexOutOfBoundsException in PhotoView + ViewPager
It seems to be a bug some where along the lines. I'm not sure if it is on the PhotoViewer side or on...
Read more >
[4.2.2][jdq39][aosp] SHPONGLE [halo][beta ... - XDA Forums
Hello mate, Before rushing to download this rom (I know everyone does it, I'm not an exception either), take some time to read...
Read more >
PhotoView in Android with Example - GeeksforGeeks
In this article, PhotoView is added to android. PhotoView aims to help ... Media error: Format(s) not supported or source(s) not found.
Read more >
Android meeting sdk crash on initialize - Zoom Developer Forum
I have added proguard rules as well but no luck. ... step-by-step details of how you added the SDK so we can check...
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