Reputation: 548
I am getting start with android studio and I success in running my application on the emulator,
while after sometimes of successful and when I want to run my application again,
I get the error
Failure [INSTALL_FAILED_DEXOPT]
and ask me to uninstall my application in the emulator.
After clicking OK, I get the error
Unknown failure
And when I try to click run application again, I get another error
Failure [INSTALL_FAILED_UID_CHANGED]
I can successful solve my program by rebuilt project and manually removing the package in /data/data and /data/local/tmp.
But the problem exist again and again after a few run.
What I should do to stop this problem as it make my debugging extremely difficult.
Here are the error message I get:
Waiting for device.
Target device: Nexus_4_API_19 [emulator-5554]
Uploading file
local path: C:\Users\brian_000\AndroidStudioProjects\MyApplication\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.example.brian.myapp
Installing com.example.brian.myapp
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.brian.myapp"
pkg: /data/local/tmp/com.example.brian.myapp
Failure [INSTALL_FAILED_DEXOPT]
DEVICE SHELL COMMAND: pm uninstall com.example.brian.myapp
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.brian.myapp"
pkg: /data/local/tmp/com.example.brian.myapp
Failure [INSTALL_FAILED_DEXOPT]
DEVICE SHELL COMMAND: pm uninstall com.example.brian.myapp
Unknown failure
Upvotes: 4
Views: 10911
Reputation: 9
Seems like, if you don't have enough space to install the app, then we get this error. If i uninstall other apps & then tried to install the app, issue got resolved.
Upvotes: 1
Reputation: 1
I had the same issue , I fixed it by cleaning the project and cleaning the build folder inside the app folder , then I restarted the device and the issue gone,
also you could do some patch and change the application id
android {
compileSdkVersion Integer.valueOf(COMPILE_SDK_VERSION)
buildToolsVersion String.valueOf(BUILD_TOOLS_VERSION)
defaultConfig {
applicationId "your application ID"
versionName = VERSION_NAME
versionCode = Integer.valueOf(VERSION_CODE)
minSdkVersion Integer.valueOf(MINIMUM_SDK)
targetSdkVersion Integer.valueOf(COMPILE_SDK_VERSION)
}
hope this helps.
Upvotes: 0
Reputation: 466
The problem is not with SDK toole 24.0.2, but appears when you install that SDk tools and do not set your project to Build tools 22.0.1. Do that, and it will work again.
Upvotes: 0
Reputation: 25858
I have faced the same issue with Android SDK tools version 24.0.2, Seems like an issue with tools version 24.0.2 .
If you are using the same you can try below mentioned solution which have solved my problem.
Download the SDK r23 version from here
https://dl.google.com/android/android-sdk_r23.0.2-windows.zip
Unzip it, open SDK manager and download all necessary sdk platforms, support repository and Google repository if required.
Point your Android Studio Project to this new SDK directory from Project Structure dialog and run your app.
This solved my problem.
You can also try to install app right from your adb command insted of Android studio, I did not try that.
Upvotes: 2