2017-10-09 115 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