Search code examples
javaandroidnoclassdeffounderroropentok

java.lang.NoClassDefFoundError: com.example.bylyngo


I built an app Have a Many Layout. I run the app in my MOTO G3 and it runs perfectly but when I run it in other devices it crashes with this error:

 java.lang.NoClassDefFoundError: com.example.bylyngo

Here's the code:

private PagerAdapter mPagerAdapter = new PagerAdapter() {


        @Override
        public boolean isViewFromObject(View arg0, Object arg1) {
            return ((MySubscriber) arg1).getView() == arg0;
        }

        @Override
        public int getCount() {
            return mSubscribers.size();
        }

        @Override
        public CharSequence getPageTitle(int position) {
            if (position < mSubscribers.size()) {
                return mSubscribers.get(position).getName();
            } else {
                return null;
            }
        }
      .....
      ...
 }

I got the error at the first line:

private PagerAdapter mPagerAdapter = new PagerAdapter() {}

Please help me solve this silly problem.

Here is build.gradle(module)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "id_app"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            jniLibs.srcDir 'jniLibs'
        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    defaultConfig {
        multiDexEnabled false
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.gms:play-services:7.8.0'

}

Solution

  • After lots of search and wasting time i got Solution From this link.Thanks to this man For Right Ans. java.lang.NoClassDefFoundError: android.support.v4.view.LayoutInflaterCompatHC in Android Studio