3

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

Mahesh Kavathiya
  • 573
  • 5
  • 23
  • possible duplicate of [Can't upload Android app to device (stale dexed jars)](http://stackoverflow.com/questions/25493310/cant-upload-android-app-to-device-stale-dexed-jars) – Sufiyan Ghori Jan 03 '15 at 11:41
  • @sufiyan i try this but i don't know what i do exacly in studio,beacuse i am new in studio.Thank you – Mahesh Kavathiya Jan 03 '15 at 11:44

1 Answers1

2

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.

aga
  • 27,954
  • 13
  • 86
  • 121