gpt4 book ai didi

android - 在Android上运行React Native项目

转载 作者:行者123 更新时间:2023-12-03 05:21:34 28 4
gpt4 key购买 nike

我完全按照有关如何配置RN环境this one的官方教程进行操作,似乎一切都很好,但是当我创建一个简单的项目并尝试通过react-native run-android运行它时,出现此错误

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
> Task :app:mergeDebugResources FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
7 actionable tasks: 2 executed, 5 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-3.5.3-5435860-linux Daemon #0: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-3.5.3-5435860-linux Daemon #1: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-3.5.3-5435860-linux Daemon #3: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-3.5.3-5435860-linux Daemon #2: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-3.5.3-5435860-linux Daemon #4: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-3.5.3-5435860-linux Daemon #5: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-3.5.3-5435860-linux Daemon #7: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-3.5.3-5435860-linux Daemon #6: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa


* 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

BUILD FAILED in 8s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081


我做了一些研究,发现所有Linux操作系统都不兼容,但就我而言,我有一个64位linux,这是我的 lcpu结果
Architecture:        x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 142
Model name: Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz
Stepping: 9
CPU MHz: 2625.481
CPU max MHz: 3500.0000
CPU min MHz: 400.0000
BogoMIPS: 5399.81
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
NUMA node0 CPU(s): 0-3

知道我的笔记本电脑是公司笔记本电脑,这可能是问题所在吗?我虽然有sudo访问

最佳答案

经过很多苦苦挣扎的时间,我发现我使用的是32位的jdk您可以通过运行jdk来检查所使用的java -d32 -version版本,如果您的jdk是64位,则应该出现错误
所以我刚刚安装了64位的jdk,现在一切正常

关于android - 在Android上运行React Native项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63268392/

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