执行失败的任务':react-native-naistated:compiledebugjavawithjavac'
尽管其他人提出了这个问题,但提供的解决方案对我的用例都没有。
环境
System:
OS: macOS 12.3.1
CPU: (10) arm64 Apple M1 Pro
Memory: 202.25 MB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.1.0 - ~/.nvm/versions/node/v16.1.0/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 7.11.2 - ~/.nvm/versions/node/v16.1.0/bin/npm
Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /Users/AH94896/.jenv/shims/javac (Using Java 1.8 gives same result)
npmPackages:
@react-native-community/cli: Not Found
react: 16.14.0 => 16.14.0
react-native: 0.64.1 => 0.64.1
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
------------------------------------------------------------
Gradle 6.5.1
------------------------------------------------------------
Build time: 2020-06-30 06:32:47 UTC
Revision: 66bc713f7169626a7f0134bf452abde51550ea0a
Kotlin: 1.3.72
Groovy: 2.5.11
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 11.0.15 (Eclipse Adoptium 11.0.15+10)
OS: Mac OS X 12.3.1 x86_64
说明
我可以使用./ gradlew Clean
清洁应用程序。但是,当使用NPX React-Native Run-android
启动时,构建在同一地点失败:
> Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source.
Native libs debug enabled: false
Android gradle plugin: 4.1.0
Gradle: 6.5.1
building Reanimated2
> Task :react-native-reanimated:compileDebugJavaWithJavac FAILED
在构建过程中的位置出现问题的位置,这是
/Users/AH94896/projects/app/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIImplementation.java:13: error: cannot find symbol
ViewManagerResolver viewManagerResolver,
^
symbol: class ViewManagerResolver
location: class ReanimatedUIImplementation
/Users/AH94896/projects/app/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIImplementation.java:11: error: recursive constructor invocation
public ReanimatedUIImplementation(
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-reanimated:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
一个真正奇怪的事实是,我无论使用Apple M1还是Intel Macs,团队都会遇到此问题。我已经用尽了我发现寻找解决方案的所有资源。 请询问您是否需要更多信息。这是我项目工作的关键阻滞剂。
Although this question has been asked by others, none of the provided solutions work for my use case.
Environment
System:
OS: macOS 12.3.1
CPU: (10) arm64 Apple M1 Pro
Memory: 202.25 MB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.1.0 - ~/.nvm/versions/node/v16.1.0/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 7.11.2 - ~/.nvm/versions/node/v16.1.0/bin/npm
Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /Users/AH94896/.jenv/shims/javac (Using Java 1.8 gives same result)
npmPackages:
@react-native-community/cli: Not Found
react: 16.14.0 => 16.14.0
react-native: 0.64.1 => 0.64.1
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
------------------------------------------------------------
Gradle 6.5.1
------------------------------------------------------------
Build time: 2020-06-30 06:32:47 UTC
Revision: 66bc713f7169626a7f0134bf452abde51550ea0a
Kotlin: 1.3.72
Groovy: 2.5.11
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 11.0.15 (Eclipse Adoptium 11.0.15+10)
OS: Mac OS X 12.3.1 x86_64
Description
I can clean the app using ./gradlew clean
. But when launching using npx react-native run-android
, the build fails in the same spot:
> Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source.
Native libs debug enabled: false
Android gradle plugin: 4.1.0
Gradle: 6.5.1
building Reanimated2
> Task :react-native-reanimated:compileDebugJavaWithJavac FAILED
The place in the build process where it goes awry is this
/Users/AH94896/projects/app/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIImplementation.java:13: error: cannot find symbol
ViewManagerResolver viewManagerResolver,
^
symbol: class ViewManagerResolver
location: class ReanimatedUIImplementation
/Users/AH94896/projects/app/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIImplementation.java:11: error: recursive constructor invocation
public ReanimatedUIImplementation(
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-reanimated:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
The REALLY odd fact is that NO ONE else on my team experiences this problem whether using Apple M1 or Intel Macs. I have exhausted every resource I've found searching for a solution.
Please ask if you need more info. This is a critical blocker for my project work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论