installation failed since the device possibly has

2019-02-21 11:13发布

I am unable to run app from android studio to my samsumg phone running android 2.3.6. I am getting Application installation Failed popup refer below screenshot.

enter image description here

when I click on OK I get below error in log

Failure [INSTALL_FAILED_DEXOPT]
DEVICE SHELL COMMAND: pm uninstall my.package.name
Unknown failure

I got in this trouble after adding Google Cloud Module called "App Engine Backend with Google Cloud Messaging".

This is exactly same problem described in one of stack overflow questions here

I tried the accepted answer.

Ran dex-method-counts application I got "Overall method count: 24474" in terminal. I dont understand what to do next?

(Note : The same application is running on my other device running on kitkat.)

Please help to resolve this issue. I am struggling from past two days. I know there are many similar questions but nothing helped me.

Built--> Clean is not working.

Here is my build.gradle file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "my.package.name"
        minSdkVersion 9
        targetSdkVersion 19
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
    }

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


dependencies {
    compile files('libs/libGoogleAnalyticsServices.jar')
    compile project(path: ':gcmAppEngineBackend', configuration: 'android-endpoints')
    compile 'com.android.support:support-v4:22.0.0'
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services:7.0.0'

}

Thanks in advance!

4条回答
何必那么认真
2楼-- · 2019-02-21 11:30

Replace this 'compile files('libs/libGoogleAnalyticsServices.jar')' with this 'com.google.android.gms:play-services-analytics:8.3.0'

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-02-21 11:42

Also I have the same problem. To make it work I had to remove "third party library" from dependencies. Or try this: https://developer.android.com/tools/building/multidex.html

查看更多
在下西门庆
4楼-- · 2019-02-21 11:46

Disable Instant Run.

Android Studio -> Preferences -> Instant Run

查看更多
淡お忘
5楼-- · 2019-02-21 11:47

This usually happens because your device doesn't have enough space in memory.

Delete some apps and try again

查看更多
登录 后发表回答