NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.6k stars 4.8k forks source link

taro v3.6.18 init rn模板 yarn android 编译报错 #14776

Open tianlinzz opened 1 year ago

tianlinzz commented 1 year ago

相关平台

React Native

使用框架: React

复现步骤

1:taro initi app 选择 react-native模板

2:yarn upgradePeerdeps 命令升级对应依赖

3: yarn android

期望结果

期望运行成功,app正常安装到模拟器。项目已经启动成功,安卓模拟器正常启动,但是编译成app阶段报错。

实际结果

编译app安装到模拟器过程报错:

FAILURE: Build failed with an exception.

BUILD FAILED in 13s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

BUILD FAILED in 13s

at makeError (F:\learn\Project\App\node_modules\execa\index.js:174:9)
at F:\learn\Project\App\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (F:\learn\Project\App\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (F:\learn\Project\App\node_modules\@react-native-community\cli\build\index.js:142:9)

info 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.

环境信息

👽 Taro v3.5.0

  Taro CLI 3.5.0 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 18.16.0 - D:\IDE\node.js\node\node.EXE
      Yarn: 1.22.19 - D:\IDE\node.js\node_global\yarn.CMD
      npm: 9.5.1 - D:\IDE\node.js\node\npm.CMD
tianlinzz commented 1 year ago

taro3.5.0是我降低版本后又初始化rn进行尝试,所以会显示info 为3.5.0.但其实3.5对应的社区模板还是会报错

tianlinzz commented 1 year ago

👽 Taro v3.6.18

Taro CLI 3.6.18 environment info: System: OS: Windows 10 10.0.22621 Binaries: Node: 18.16.0 - D:\IDE\node.js\node\node.EXE Yarn: 1.22.19 - D:\IDE\node.js\node_global\yarn.CMD npm: 9.5.1 - D:\IDE\node.js\node\npm.CMD npmPackages: @tarojs/cli: 3.6.18 => 3.6.18 @tarojs/components: 3.6.18 => 3.6.18 @tarojs/helper: 3.6.18 => 3.6.18 @tarojs/plugin-framework-react: 3.6.18 => 3.6.18 @tarojs/plugin-platform-alipay: 3.6.18 => 3.6.18 @tarojs/plugin-platform-h5: 3.6.18 => 3.6.18 @tarojs/plugin-platform-jd: 3.6.18 => 3.6.18 @tarojs/plugin-platform-qq: 3.6.18 => 3.6.18 @tarojs/plugin-platform-swan: 3.6.18 => 3.6.18 @tarojs/plugin-platform-tt: 3.6.18 => 3.6.18 @tarojs/plugin-platform-weapp: 3.6.18 => 3.6.18 @tarojs/react: 3.6.18 => 3.6.18 @tarojs/rn-runner: 3.6.18 => 3.6.18 @tarojs/rn-supporter: 3.6.18 => 3.6.18 @tarojs/runtime: 3.6.18 => 3.6.18 @tarojs/runtime-rn: 3.6.18 => 3.6.18 @tarojs/shared: 3.6.18 => 3.6.18 @tarojs/taro: 3.6.18 => 3.6.18 @tarojs/taro-loader: 3.6.18 => 3.6.18 @tarojs/taro-rn: 3.6.18 => 3.6.18 @tarojs/webpack5-runner: 3.6.18 => 3.6.18 babel-preset-taro: 3.6.18 => 3.6.18 eslint-config-taro: 3.6.18 => 3.6.18 expo: ~47.0.3 => 47.0.14 react: ^18.1.0 => 18.2.0 react-native: ^0.70.1 => 0.70.14

这是3.6.18对应的info,但是其实报错都是一致,我也不知道是不是环境没有配置好 但是react-native提供的社区模板是可以正常启动的

tianlinzz commented 1 year ago

image image image image 相应的安卓配置也都下了

tianlinzz commented 1 year ago

如果说有人能够跑通可以告诉你对应的配置吗

zhiqingchen commented 1 year ago

3.6.18 正常编译参考 https://github.com/NervJS/taro-native-shell/tree/v0.70.14-beta.3

zhiqingchen commented 1 year ago

https://github.com/NervJS/taro-native-shell/releases/tag/v0.70.14-beta.3

tianlinzz commented 1 year ago

https://github.com/NervJS/taro-native-shell/releases/tag/v0.70.14-beta.3

我是windows应该不用执行yarn podInstall把我试了也执行不了 image 但其实还是一样的报错 image 实在是无法解决,这个依赖无法找到的问题。

tianlinzz commented 1 year ago

https://github.com/NervJS/taro-native-shell/releases/tag/v0.70.14-beta.3

会不会是gradle插件版本的问题呢。所以在这个包找不到这个依赖

a422916528 commented 1 year ago

一摸一样的问题,直接从入门到放弃,我直接跑 rn 都没这么困难

tianlinzz commented 1 year ago

一摸一样的问题,直接从入门到放弃,我直接跑 rn 都没这么困难

唉,主要是这个issue我已经提出了那么久了啦,官方还是没给出有效的解决方案。直接跑rn我也是很快就启动了。

1009867202 commented 11 months ago

我跑rn,taro官方给的,然后android出现,Error: Unable to resolve module react-native-gesture-handler

1009867202 commented 11 months ago

然后安装这个包就行了,这个,笑死

tianlinzz commented 11 months ago

我跑rn,taro官方给的,然后android出现,Error: Unable to resolve module react-native-gesture-handler

请问你用的taro几版本的