gpt4 book ai didi

android - react native : Failed to notify project evaluation listener. > JAVA_LETTER_OR_DIGIT

转载 作者:行者123 更新时间:2023-12-03 03:56:13 32 4
gpt4 key购买 nike

当我尝试使用 react-native run-android 在 react-native 中运行 android 代码时出现错误。
我在 ubuntu 上运行代码。

 rahul@rahul-Inspiron-15-3567  ~/Documents/reactNative/crowdalert/CrowdAlert-Mobile   master ●  react-native run-android 
Scanning folders for symlinks in /home/rahul/Documents/reactNative/crowdalert/CrowdAlert-Mobile/node_modules (8ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...

> Configure project :app
WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
Reading env from: .env
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> JAVA_LETTER_OR_DIGIT

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
在 react native 中运行应用程序也会显示相同的错误。这些是我的 gradle 和 react-native 版本:
react 原生 cli:2.0.1
react 原生:0.51.0
梯度 4.4
项目级 build.gradle 文件。
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.3.2'
classpath 'io.fabric.tools:gradle:1.25.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url "https://maven.google.com"
}
}
}

最佳答案

您的 RN 版本和 gradle 可能存在版本不匹配。对于 ReactNative 0.51,你应该使用 gradle 3.5。但这不是唯一的问题。您的项目已过时。您可能无法将您的应用发布到 Google Play 商店,因为 Google 引入了新的发布格式(App Bundle),您的发布 apk 将被 Play 商店拒绝。在此处查看更多信息:https://developer.android.com/platform/technology/app-bundle

为此,您需要升级到 gradle 5.5,并使用 React Native 进行此操作,您需要升级到 0.60+ 版本。在此处查看如何操作:https://facebook.github.io/react-native/docs/upgrading

如果您在升级当前项目时迷失了方向,另一种方法是初始化一个新项目,链接依赖项和逐 block 的 c/p 代码,并将您的代码调整为您使用的新版本的库(如有必要)。

关于android - react native : Failed to notify project evaluation listener. > JAVA_LETTER_OR_DIGIT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59095284/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com