Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run application in android studio

How to install application in android device using android studio.i had may try but i can't find solution as i want so please help me,please see below screen shots

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 advanceenter image description here

like image 722
Mahesh Kavathiya Avatar asked Apr 20 '26 04:04

Mahesh Kavathiya


1 Answers

The error clearly states that you need to remove installed application from your device and install it again. If it doesn't work, try to enable proguard for your release/debug builds:

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 into the build.gradle file, inside the section called android. More info on Gradle in Android Studio can be found here.

like image 63
aga Avatar answered Apr 24 '26 19:04

aga