简体   繁体   English

如何修复应用程序没有在我的移动设备上安装已编译的apk,使用生成signed-react的react-native

[英]How to fix app not installing compiled apk on my mobile device, using generating signed APK of react-native

I currently new developing android react-native, I have problem regarding deploying my application on other mobile device, I read the documentation of react native How to generate signed APK, i did the instruction of there document 我目前新开发的android react-native,我有关于在其他移动设备上部署我的应用程序的问题,我阅读本机的文档如何生成签名的APK,我做了那里的文档的指示

React Native signed-apk-android React Native signed-apk-android

I already done configuring those requirements based on there document. 我已经完成了基于那个文档的配置。 I will show you the step that I did. 我会告诉你我做的那一步。

First: Install this in the cmd 首先:在cmd中安装它

keytool -genkeypair -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000

Second: Setting up gradle variables 第二:设置gradle变量

MYAPP_RELEASE_STORE_FILE=my-release-key.keystore

MYAPP_RELEASE_KEY_ALIAS=my-key-alias

MYAPP_RELEASE_STORE_PASSWORD=123456

MYAPP_RELEASE_KEY_PASSWORD=123456

Third: Adding signing config to your app's gradle config 第三步:将签名配置添加到应用程序的gradle配置中

    ...
android {
    ...
    defaultConfig { ... }
    signingConfigs {
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }
    buildTypes {
        release {
            ...
            signingConfig signingConfigs.release
        }
    }
}
...

Lastly: Generating the release APK Simply run the following in a terminal: 最后:生成发布APK只需在终端中运行以下内容:

$ cd android
$ ./gradlew assembleRelease

Before I do the installation, I gonna make sure that the package clearly uninstalled on my mobile device. 在我进行安装之前,我将确保在我的移动设备上清楚地卸载了该软件包。

Release APK: 发布APK: APK文件

Error: 错误:

捕获错误

你需要点击apk(可能是开发者模式激活,按设置菜单中的内部版本号几次)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM