INSTALL_FAILED_TEST_ONLY: installPackageLI. 问题解决

FAQ:

Installation failed with message Failed to finalize session : INSTALL_FAILED_TEST_ONLY: installPackageLI.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

 

Resolve:

check your gradle,if it`s alpha,beta...maybe this wrong.

The cause is due to gradle version set in build.gradle of the app which is alpha version

--这个我问题是由于gradle plugin, gradle tool是beta版本,版本配置不对导致的,重新配置下工程的gradle版本 ,比如我用的是AS2.3.2

gradle配置如下:

# for android studio 2.3.2
classpath 'com.android.tools.build:gradle:2.3.2'
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

 

# for android studio 3.0
classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip

posted @ 2017-06-02 17:40  petercao  阅读(14795)  评论(1编辑  收藏  举报