cd android && ./gradlew assembleRelease
我在执行该命令时遇到了异常:
```
cd android && ./gradlew assembleRelease '.' is not recognized as an internal or external command, operable program or batch file.
问题是什么?
cd android && ./gradlew assembleRelease
```
cd android && ./gradlew assembleRelease '.' is not recognized as an internal or external command, operable program or batch file.
对于 Windows 系统,原始命令需使用反斜杠
cd android && ./gradlew assembleRelease
作为解决这个问题的一部分,我发现构建React Native源代码需要以下步骤:
Windows
Make sure that you have Java jdk, Android SDK and gradle installed and they are accessible as global variables. You can check it by the following command (see more How to set up the environment variable for Windows):
java -version
android list target
gradle -v
it is necessary to set up gradle environment for root/android/ directory of the project (gradlew.bat executive file and other environment files)
gradle init
Note: you need to rename or remove build.gradle file before you run gradle init. After you run gradle init, you can return build.gradle back.
Create directories and file AndroidManifest.xml as it is shown below
root\android\src\main\AndroidManifest.xml
AndroidManifest.xml has to have the following minimal content:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="myAppName">
<uses-permission android:name="myAppName" />
<uses-feature android:name="feature-01" android:required="false" />
</manifest>
For Windows you need to use backslash in the original command
cd android && .\gradlew assembleRelease
You are going to find the resulted build package by this path:
root\android\build\outputs\aar\android-release.aar
cd android && gradlew assembleRelease
命令。 - Leffa