FMa*_*008 10 gradle android-gradle-plugin react-native
我正在运行 React-Native 0.63.4 并遇到以下错误:
Execution failed for task ':app:generateDebugBuildConfig'.
> Failed to calculate the value of task ':app:generateDebugBuildConfig' property 'buildConfigPackageName'.
> Failed to query the value of property 'packageName'.
> java.lang.NumberFormatException: For input string: "1.0.0"
Run Code Online (Sandbox Code Playgroud)
npm run android在Gradle 完成应用程序配置并尝试执行它后不久,运行时会发生这种情况。
当我从项目的根文件夹以及 /android/ 子文件夹运行命令时,都会发生此错误。
我做了一个gradlew clean,但没有帮助。
编辑:
如果我进入 /android/ 文件夹并运行gradlew android,构建将完成,不会出现错误。
只有当我运行时npm run android才会出现此错误。
Rel*_*som 16
这是另一个解决方案:
android/app/src/main/AndroidManifest.xml。所以你需要将其添加回来。<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.<buildname>">
Run Code Online (Sandbox Code Playgroud)
Manifest.xml。我终于弄明白了。
在文件上:android/app/src/main/AndroidManifest.xml
内容开头是:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.MyBusiness.MyApp"
android:versionCode="1.0.0"
android:versionName="1.0.0">
Run Code Online (Sandbox Code Playgroud)
versionCode 必须是整数:仅允许使用数字。显然它是什么并不重要,因为它会增加我们输入的任何数字。
将其更改为数字解决了我的问题:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.MyBusiness.MyApp"
android:versionCode="1000"
android:versionName="1.0.0">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
27285 次 |
| 最近记录: |