2017-10-09 189 views
0

我的构建和应用程序非常简单。当我在虚拟设备上安装该apk时,它已成功安装并按原样运行。但是当我在移动设备上安装相同的APK(已签名的apk)时,它会给出错误"Application not installed"。我已经下载了NDK并在项目结构中给出了它的路径。应用程序在虚拟设备中正常工作,但不能在真实设备中安装。 帮助!错误:未安装应用程序

在此先感谢。

以下是我在虚拟设备上运行应用程序时的控制台输出。

Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] 

    Configuration on demand is an incubating feature. 
    Incremental java compilation is an incubating feature. 
    :app:preBuild UP-TO-DATE 
    :app:preDebugBuild UP-TO-DATE 
    :app:checkDebugManifest 
    :app:preReleaseBuild UP-TO-DATE 
    :app:prepareComAndroidSupportAnimatedVectorDrawable2600Alpha1Library 
    :app:prepareComAndroidSupportAppcompatV72600Alpha1Library 
    :app:prepareComAndroidSupportConstraintConstraintLayout102Library 
    :app:prepareComAndroidSupportSupportCompat2600Alpha1Library 
    :app:prepareComAndroidSupportSupportCoreUi2600Alpha1Library 
    :app:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library 
    :app:prepareComAndroidSupportSupportFragment2600Alpha1Library 
    :app:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library 
    :app:prepareComAndroidSupportSupportV42600Alpha1Library 
    :app:prepareComAndroidSupportSupportVectorDrawable2600Alpha1Library 
    :app:prepareComGoogleAndroidGmsPlayServicesAds1104Library 
    :app:prepareComGoogleAndroidGmsPlayServicesAdsLite1104Library 
    :app:prepareComGoogleAndroidGmsPlayServicesBase1104Library 
    :app:prepareComGoogleAndroidGmsPlayServicesBasement1104Library 
    :app:prepareComGoogleAndroidGmsPlayServicesClearcut1104Library 
    :app:prepareComGoogleAndroidGmsPlayServicesGass1104Library 
    :app:prepareComGoogleAndroidGmsPlayServicesSafetynet1104Library 
    :app:prepareComGoogleAndroidGmsPlayServicesTasks1104Library 
    :app:prepareDebugDependencies 
    :app:compileDebugAidl UP-TO-DATE 
    :app:compileDebugRenderscript 
    :app:generateDebugBuildConfig UP-TO-DATE 
    :app:generateDebugResValues UP-TO-DATE 
    :app:generateDebugResources 
    :app:mergeDebugResources 
    :app:processDebugManifest 
    :app:processDebugResources 
    :app:generateDebugSources 
    :app:preDebugAndroidTestBuild UP-TO-DATE 
    :app:prepareComAndroidSupportTestEspressoEspressoCore222Library 
    :app:prepareComAndroidSupportTestEspressoEspressoIdlingResource222Library 
    :app:prepareComAndroidSupportTestExposedInstrumentationApiPublish05Library 
    :app:prepareComAndroidSupportTestRules05Library 
    :app:prepareComAndroidSupportTestRunner05Library 
    :app:prepareDebugAndroidTestDependencies 
    :app:compileDebugAndroidTestAidl UP-TO-DATE 
    :app:processDebugAndroidTestManifest UP-TO-DATE 
    :app:compileDebugAndroidTestRenderscript UP-TO-DATE 
    :app:generateDebugAndroidTestBuildConfig UP-TO-DATE 
    :app:generateDebugAndroidTestResValues UP-TO-DATE 
    :app:generateDebugAndroidTestResources UP-TO-DATE 
    :app:mergeDebugAndroidTestResources UP-TO-DATE 
    :app:processDebugAndroidTestResources UP-TO-DATE 
    :app:generateDebugAndroidTestSources UP-TO-DATE 
    :app:mockableAndroidJar UP-TO-DATE 
    :app:preDebugUnitTestBuild UP-TO-DATE 
    :app:prepareDebugUnitTestDependencies 

    BUILD SUCCESSFUL 

    Total time: 18.303 secs 

回答

0

是在你的设备上运行和虚拟? Relese是在某些方面比调试,接下来 谷歌严格,如果发现它的工作 android { lintOptions { abortOnError false } }}

+0

是的,它是相同的APK。其安装在虚拟设备和应用程序运行良好。但不在真实的设备上。它只是给错误“应用程序未安装” –

+0

1.uninstall存在的一个,并重新安装 2.jniLibs包含一些不兼容的.so文件 –

0

确保例如在Android Studio中运行是禁用

如果Instant Run被激活,会导致某些类被移动。 要禁用即时运行转到文件 - >设置 - >构建,执行,部署 - >即时运行 - >取消选中“启用即时运行”

它为我工作。 我希望它能帮助你解决问题。

很高兴帮助你!

+0

我试过了,仍然是相同的错误。在虚拟设备中工作,但不在真实设备上工作。 “未安装应用程序” –

+0

您尝试在安装应用程序之前删除并清除应用程序。 – Thientvse