Can't run app in android studio

How to install app on android device using android studio.i can try but i cant find solution as i want please help me please see below screenshots

Waiting for device.
Target device: xiaomi-mi_3w-13d8da8
Uploading file
local path: E:\Mahesh\Android\StudioWorkspace\Test\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.test
Installing com.test
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.test"
pkg: /data/local/tmp/com.test
Failure [INSTALL_FAILED_DEXOPT]

      

Thank you in advance enter image description here

+3


source to share


1 answer


This error clearly states that you need to uninstall the installed application from your device and install it again. If that doesn't work, try enabling proguard for your releases / debugs:

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

      



You need to add this code to a file build.gradle

under android

. More information on Gradle in Android Studio can be found here .

+2


source







All Articles