我已经升级了react-从0.64.1版升级到0.65.0-rc.3版,因为targetSdk=30需要从8月21日开始向Google发布一个包。我正在使用升级助手升级信件,现在我收到了./gradlew bundleRelease错误:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeReleaseAssets'.
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
> Failed to transform react-native-reanimated-65-jsc.aar (project :react-native-reanimated) to match attributes {artifactType=android-assets}.
> Execution failed for JetifyTransform: MyApp/node_modules/react-native-reanimated/android/react-native-reanimated-65-jsc.aar.
> Transform's input file does not exist: MyApp/node_modules/react-native-reanimated/android/react-native-reanimated-65-jsc.aar. (See https://issuetracker.google.com/issues/158753935)已试过:
花了几个小时沮丧,因为没有稳定的反应释放-本机通过谷歌的要求。有什么办法让它起作用吗?
--编辑--编辑--
作为一种临时解决方法,只需更改项目级gradle文件中的版本就足够了:
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "20.1.5948944"
}发布于 2021-08-17 22:08:32
我刚刚升级到RN0.65稳定,在Android上也有同样的错误。我认为这是因为如果您想要使用react本机-还原软件包v2.0,升级还为时尚早。他们可能还没有将Android升级到0.65兰特。请参阅类似的问题,对于早期升级到RN0.64-rc.1谁使用RN恢复v2.0:https://github.com/software-mansion/react-native-reanimated/issues/1486。我们需要等待RN的恢复来升级他们的库。
编辑:这是关于RN与RN0.65不兼容的链接,这个链接位于Github:https://github.com/software-mansion/react-native-reanimated/issues/2290上。
编辑2:可以确认升级到RN恢复版本2.3.0-alpha 2解决了这个问题,Android构建成功使用RN0.65。
发布于 2021-08-19 15:56:02
请确保这些模块是如何在您的package.json中编写的,否则就会失败。我看到了许多本机发射器错误的反应-本机-恢复。
"react": "17.0.2",
"react-native": "0.65",
"react-native-reanimated": "^2.3.0-alpha.2",删除旧的npm模块。然后运行yarn install。
我尝试过使用> yarn add react-native-reanimated@next,但是构建失败了。我的最新版本是在package.json上运行的。我不太确定IOS的构建。
通过这些依赖关系,我在android上的构建也很成功。我沿途遇到了npm的问题,所以我转而使用纱线。
我不知道为什么很多人都犯了错误,但我的错误甚至适用于react的rc3。
"react-native": "0.65.0-rc.3",
"react-native-reanimated": "^2.3.0-alpha.2",################################################################
> Task :app:installDebug
Installing APK 'app-debug.apk' on 'Redmi Note 8 Pro - 11' for app:debug
Installed on 1 device.
BUILD SUCCESSFUL in 1m 40s
133 actionable tasks: 110 executed, 23 up-to-date
info Connecting to the development server...
info Starting the app...
Starting: Intent { cmp=com.myapp/.MainActivity }发布于 2021-09-05 08:45:12
试试这个:
npm i react-native-reanimated@^1.13.2https://stackoverflow.com/questions/68663941
复制相似问题