studio默认运行不一致

studio默认运行不一致

本文介绍了切片签名与android studio默认运行不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为gradle配置了签名:

  android {
...
signingConfigs {
debug {
storeFile file(...);
storePassword'...'
keyAlias'...'
keyPassword'...'
}
}
}

现在,当我运行Gradle任务installDebug时,该应用程序被签名并正确安装,我可以按预期运行该应用程序。但是当我运行应用程序模块时(android studio默认运行,这对于调试来说是非常优选的)。我收到消息:

 无法完成会话:INSTALL_FAILED_INVALID_APK:
/data/app/vmdl2083307194.tmp/1_slice__签名不一致

即使没有安装apk,也会发生这种情况。



我认为这与android studio分裂apk不当有关。所以如果没有人知道如何让它正确地标记出来,保持android工作室不会拆分apk的方法也可能会奏效。

在定义调试版本的签名后,我碰到了确切的问题。从测试设备中删除以前的应用程序后,清洁项目 / 重建项目为我完成了技巧。


I've configured gradle for signing with:

android {
    ...
    signingConfigs{
        debug {
            storeFile file("...");
            storePassword '...'
            keyAlias '...'
            keyPassword '...'
        }
    }
}

Now when I run the Gradle task installDebug the app is signed and installed correctly and I can run the app as expected. But when I run the app module (android studio default run, which is much preferred for debugging). I get the message:

Failed to finalize session : INSTALL_FAILED_INVALID_APK:
/data/app/vmdl2083307194.tmp/1_slice__ signatures are inconsistent

This happens even when No apk is yet installed.

I think it has to do with android studio splitting the apk improperly. So if nobody knows how to make it sign correctly a way to keep android studio from splitting the apk will probably also work.

解决方案

I just ran into the exact problem after defining the signature for the debug build. After deleting the previous app from the test device, Clean Project / Rebuild Project did the trick for me.

这篇关于切片签名与android studio默认运行不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 15:13