问题描述
我是一个使用React Native创建的应用程序.我正在尝试在我的设备上安装应用程序.但是显示此错误"未安装-package的应用程序似乎已损坏".
是什么原因?我尝试了以下方法来构建APK.
gradlew assembleRelease.
推荐答案
遵循这些说明....它为我
工作先决条件 - 如果您没有,则必须具有密钥库文件,然后打开cmd运行keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000按照说明且您完成.您将有一个密钥库文件.现在按照以下步骤操作.
1 .on Windows cd android然后运行gradlew assembleRelease
2 .find apk 在此位置android/app/build/outputs/apk/release/app-release-unsigned.apk
3 .copy这个apk到bin bin安装目录的文件夹(对于me目录是C:\Program Files\Java\jdk1.8.0_181\bin)[基本上我们正试图转到与jarsigner]
4 .also将密钥库文件复制到此(C:\Program Files\Java\jdk1.8.0_181\bin)目录.
5 .now打开cmd在Administrator mode中,运行cd C:\Program Files\Java\jdk1.8.0_181\bin
6 .now运行jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore <<your keystore file name >> <<your apk file name>> alias_name
这里你的 apk ,现在找到你的签名APK CD C:\Program Files\Java\jdk1.8.0_181\bin.运行它,现在它应该安装.
其他推荐答案
给我我的手机已经有一个安装的应用程序版本的原因. 一旦我删除了应用程序 - 重新安装APK它会顺利进行.
其他推荐答案
这将有助于: - 在最新的Android Studio
上转到build-> build apk.
创建APK后,您将看到一个对话框,如下所示.
点击找到并在手机上安装它
问题描述
I've an app created using react native. I am trying to install the app on my device.But showing this error "app not installed -package appears to be corrupted".
What would be the reason? I've tried the following method to build apk.
gradlew assembleRelease.
推荐答案
FOLLOW THESE INSTRUCTIONS ....IT WORKED FOR ME
Prerequisite - You must have a keystore file, If you don't have then Open cmd run keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 follow instructions and you are done.You will have a keystore file. Now follow these steps.
1 .On windows cd android and then run gradlew assembleRelease
2 .Find APK at this location android/app/build/outputs/apk/release/app-release-unsigned.apk
3 .Copy this APK to bin folder of jdk installation directory ( for me directory was C:\Program Files\Java\jdk1.8.0_181\bin ) [ Basically in this step we are trying to go to the same directory as jarsigner]
4 .Also Copy your keystore file to this ( C:\Program Files\Java\jdk1.8.0_181\bin ) directory.
5 .Now Open cmd in Administrator mode and run cd C:\Program Files\Java\jdk1.8.0_181\bin
6 .Now run jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore <<your keystore file name >> <<your apk file name>> alias_name
Here goes your apk , now find your signed apk here cd C:\Program Files\Java\jdk1.8.0_181\bin . Run it, Now it should install.
其他推荐答案
For me the reason that my phone already had a version of the app installed on it. Once I remove the app - reinstall the apk it went smoothly.
其他推荐答案
This will help: - on Latest android studio
Go to Build-> Build Apk(s).
After creating apk you will see a dialog as below.
Click on locate and install it on your phone