-1

I got an App. It launches on other computers buy my computer does not. It does not work even if make apk. If I create apk of the same app from other computer it works if I make from this it does not. It gives me the following error

I have tried: 1) Clean-Rebuild 2) Invalidate and restart 3) Uninstall / reinstall Android studio 4) Use multidex from here https://developer.android.com/studio/build/multidex 5) Tried native emulator / genymotion / real device

I have tried all (as i think) things which could cause the problem. So Please if want to minus that question put the comment what is wrong it could help me improve the quality of my questions.

java.lang.NoClassDefFoundError: android.support.graphics.drawable.VectorDrawableCompat
        at android.support.v7.widget.AppCompatDrawableManager$VdcInflateDelegate.createFromXmlInner(AppCompatDrawableManager.java:775)
        at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:366)
        at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:198)
        at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:191)
        at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:753)
        at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:196)
        at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:86)
        at android.support.v7.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:260)
        at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:182)
        at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:520)
        at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
        at com.myApp.base.BaseActivity.onCreate(BaseActivity.java:69)
        at com.myApp.devicemanager.DMActivity.onCreate(DMActivity.java:29)
        at android.app.Activity.performCreate(Activity.java:5231)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
        at android.app.ActivityThread.access$800(ActivityThread.java:135)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5017)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
        at dalvik.system.NativeStart.main(Native Method)

Gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.myApp.mobile.pm.payday"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation ("com.myApp.mobile.pm.common:app:$rootProject.ext.commonVersion") {
        exclude group: 'com.fasterxml.jackson.annotation'
        exclude group: 'com.fasterxml.jackson.core'
        exclude group: 'com.fasterxml.jackson.databind'
    }

    annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.ext.butterknifeVersion"
    annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"

}
Sina Rezaei
  • 529
  • 3
  • 24
Bo Z
  • 2,359
  • 1
  • 13
  • 31

1 Answers1

1

Depending on the version of android on simulator/device you are testing, you might need to add this line to your gradle

android {
    defaultConfig {
        vectorDrawables.useSupportLibrary = true
    }
 }

source: Android Vector Drawable Documentations.

Sina Rezaei
  • 529
  • 3
  • 24
  • Did you check this answer? https://stackoverflow.com/a/37864531/5528269 – Sina Rezaei Mar 28 '19 at 20:08
  • The thing is that it works with the same code and config on other computer. So the problem somewhere in this particular comp not code i guess. But yes I tried all that manipulation in code – Bo Z Mar 28 '19 at 20:14