Talking about the pit of react native packaging apk

You can package RN step by step according to the official website, but here are a few points to note. Let's briefly introduce:

Generate a signature key

Open the CMD command window under the project directory and enter the following command to run:

This command will ask you to enter the password of the keystore and the corresponding key, and then set some distribution related information. Finally, it generates a keystore file called my-release-key.keystore. Note that the key library and password are written by yourself. If it is a test, you can do it casually

After running the above statement, a separate key should have been generated in the keystore, which is valid for 10000 days-- The alias behind the alias parameter is what you need to use when signing applications in the future, so remember to record this alias.

Note: please remember to keep your keystore file properly and do not upload it to the version library or other places.

Set gradle variable

Put the my-release-key.keystore file in the Android / APP folder of your project.

Edit ~ /. Gradle / gradle.properties (you can create one without this file) and add the following code (note that the * * * * in it is replaced with the corresponding password)

Here is the tutorial on the official website. There will be a pit here. In fact, we need to put this file in the Android Directory:

And add the following code to the file:

Add a signature to the gradle profile of the project

Edit Android / APP / build.gradle in your project directory and add the following signature configuration:

Generate and release APK package

Enter the following command under Windows:

Wait for the packaging results. If you see the following results, it shows that it is successful. If it is not successful, you are welcome to post your mistakes and summarize them together

The generated APK file is located in Android / APP / build / outputs / APK / app-release.apk, which is ready for release.

The above talk about the pit of react native packaging APK is all that Xiaobian shared with you. I hope it can give you a reference and support more programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>