小编jdk*_*jdk的帖子

React-native:无法初始化类 org.codehaus.groovy.reflection.ReflectionCache

我按照https://reactnative.dev/docs/environment-setup 的说明进行了 React-native 设置

项目已成功创建。

Android 手机也使用 USB 连接,但是当我尝试使用命令在手机上安装应用程序时 -

npx react-native run-android
Run Code Online (Sandbox Code Playgroud)

发生以下错误并且 BUILD FAILED

what went wrong

Could not initialize class org.codehaus.groovy.reflection.ReflectionCache

错误:

Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
Run Code Online (Sandbox Code Playgroud)

我正在使用Powershell执行命令。

windows powershell android react-native-android npx

3
推荐指数
1
解决办法
1241
查看次数

坏字符范围:-'在python中的位置6异常

我正在比较两个字符串,但不包括两者中的标点符号。

这是我的代码片段:

punctuation = r"[.?!,;:-']"
string1 = re.sub(punctuation, r"", string1)
string2 = re.sub(punctuation, r"", string2)
Run Code Online (Sandbox Code Playgroud)

运行此代码后,我得到以下异常

punctuation = r"[.?!,;:-']"
string1 = re.sub(punctuation, r"", string1)
string2 = re.sub(punctuation, r"", string2)
Run Code Online (Sandbox Code Playgroud)

如何摆脱这个异常?“坏字符范围”是什么意思?

python regex

0
推荐指数
1
解决办法
978
查看次数