Open WhiredPlanck opened 1 year ago
刚刚又查了一下,好像是由这个问题引起的:https://github.com/facebook/react-native/issues/35210
我也遇到了同样的问题,在yarn start:android
之后就会遇到@react-native-community_asy
的问题.
yarn start:android
yarn run v1.22.17
$ concurrently -r "react-native start" "yarn start:android:no-packager"
$ react-native run-android --no-packager
info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...
error Invalid regular expression: /(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class. Run CLI with --verbose flag for more details.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':@react-native-community_async-storage'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at 'C:\SandBox\listen1_mobile_wyatt\android\local.properties'.
刚刚又查了一下,好像是由这个问题引起的:[facebook/react-native#35210](https://github.com/facebook/react-native/issues/35210)
build.gradle
已经添加了这个issue给出的修复办法了,但是我还是会遇到这个问题.
这是我的系统环境
java -version
java version "1.8.0_333"
Java(TM) SE Runtime Environment (build 1.8.0_333-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.333-b02, mixed mode)
node -v
v14.16.0
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':@react-native-async-storage_async-storage:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
9 actionable tasks: 1 executed, 8 up-to-date
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@WhiredPlanck Hi,我已经成功编译出来产物了.我给你说一下我的环境版本配置.在AndroidStudio中Project Structure
选项检查.
Android Gradle plugin version 3.4.0
Gradle Version 5.4.1
但是我的JDK环境版本很低,只有1.8.所以我手动指定了JDK版本,android/gradle.properties
文件中添加这个部分.这个路径是默认AndroidStudio自带的JDK 11 版本.
org.gradle.java.home = C:\\Program Files\\Android\\Android Studio\\jre
这里还有一个readme中提到的构建过程中的问题.
Nodejs 8 (版本>12.10.0 可能遇到 metro 一个关于正则表达式的 bug 导致的启动失败)
错误过程:
这个错误在yarn
之后yarn start:android
安装app时会提示Could not connect to development server并且Console中会提示.
/(.*\\__fixtures__\\.*|node_modules[\\\]react[\\\]dist[\\\].*|website\\node_modules\\.*|heapCapture\\bundle\.js|.*\\__tests__\\.*)$/: Unterminated character class. Run CLI with --verbose flag for more details.
这个错误的[解决办法](https://blog.csdn.net/weixin_44369568/article/details/102917156).
@mnyon 你说的第二个问题我没有遇到,但感谢你的反馈 ~
不好意思,这是我第一次接触有前端技术参与的移动应用项目(主要是 Android)。
我配置好开发环境后,按照 README 里的指引装好依赖并链接好库后,运行
yarn start:android
后就有很多报错(我看 Actions 里最近两次的提交也是构建失败的),但我对前端不熟悉,对此一头雾水。报错贴在这里,期望能帮助解决:我的想法是想升级改造下这个项目,因为我在使用时觉得有很多小不足,比如不支持自动切换暗色模式啦、来电或者看 B 站视频时不会自己暂停啦(其他音乐应用有这样的特性)、还有一些地方的操作逻辑不太符合逻辑啦 …… 考虑到可能作者精力有限可能没时间管移动端,所以决定自己动手。