当前位置: 首页 > 知识库问答 >
问题:

React Native:未能通知项目评估侦听器。>JAVA_LETTER_OR_DIGIT

和和裕
2023-03-14
 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-cli:2.0.1 react-native:0.51.0 Gradle 4.4

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"
        }
    }
}

共有1个答案

艾雪风
2023-03-14

您可能有一个版本与您的RN版本和Gradle不匹配。对于ReactNative 0.51,应该使用Gradle3.5。但这不是唯一的问题。你的项目已经过时了。您可能无法将您的应用程序发布到Google Play商店,因为Google引入了新的发布格式(应用程序包),您的发布apk将被Play商店拒绝。请参阅以下内容:https://developer.android.com/platform/technology/app-bundle

为了实现这一目标,您需要升级到Gradle5.5,如果使用React原生版本,则需要升级到0.60+版本。请参阅以下内容:https://facebook.github.io/react-native/docs/upgradation

如果您在升级当前项目时迷路了,替代方案是初始化一个新项目,逐块链接依赖项和C/P代码,并调整代码以适应您使用的库的新版本(如果需要)。

 类似资料:
  • 下面是Android Studio中的build.gradle代码 我收到以下错误:错误:配置项目“:App”时出现问题。 未能通知项目评估侦听器。com.android.build.gradle.tasks.factory.androidJavaCompile.SetDependencyCachedir(ljava/io/file;)V

  • 我正在尝试创建一个应用程序,使用新的Android服务来读取所有通知,也可以删除它们,但它并不起作用。在我的舱单上: 我有一个类NotificationListener扩展了NotificationListenerService我重写了两个方法OnNotificationPost(StatusBarNotification sbn)、onNotificationRemoved(StatusBarN

  • 问题内容: 在MySQL中是否有等效于PostgresQL的notify和listen?基本上,我需要在Java应用程序服务器中监听触发器。 问题答案: 不,还没有像这样的内置函数。您需要使用诸如“ read” 0/1之类的预制标志进行选择来“ ping”(每1-5秒)数据库。后 用read = 1更新它

  • 因为这是我的第一篇文章,所以我为它的结构上的任何错误道歉。我正在做一个个人项目,这是一个用java制作的时钟,可以显示时间/日期/日期,每季度播放一个音频文件,以及报时。图形用户界面是用摆动项构建的。 当时钟到达一定时间时,它必须发出钟声/播放声音,我希望在时钟响起时在GUI上显示一个图标。此时,图标在方法的开头切换,在方法的结尾再次切换。在第二次切换图标之前,我希望方法在播放音频时等待()。(也

  • 我已经使用命令创建了新的adonis项目 阿多尼斯新标尺 cd标尺 我没有做任何更改,我只是运行命令启动服务器。服务器已启动,但未侦听端口。当我使用“node”命令启动服务器时,它工作了,端口正在监听。我可以在哪里寻找解决一个问题,所以它将工作与adonis命令,也? 不起作用的解决方案: adonis Serve-Dev 有效的解决方案: 节点服务器

  • 使用方法 性能评估模块提供了一系列用于模型性能评估的函数,这些函数在模型编译时由metrics关键字设置 性能评估函数类似与目标函数, 只不过该性能的评估结果讲不会用于训练. 可以通过字符串来使用域定义的性能评估函数 model.compile(loss='mean_squared_error', optimizer='sgd', metri