失败:构建失败并出现异常。
- 什么地方出了错:
任务“:react-native-screens:compileDebugKotlin”执行失败。
评估任务“:react-native-screens:compileDebugKotlin”的属性“filteredArgumentsMap”时出错
无法解析配置“:react-native-screens:debugCompileClasspath”的所有工件。
> 无法转换 core-ktx-1.5.0.aar (androidx.core:core-ktx:1.5.0) 以匹配属性 {artifactType=android-classes-jar, org.gradle.category=library, org.gradle。 dependency.bundling=external、org.gradle.libraryelements=aar、org.gradle.status=release、org.gradle.usage=java-api}。
> AarToClassTransform 执行失败:C:\Users\ABC.gradle\caches\transforms-3\186e662719f643b770233b2443ab0f39\transformed\jetified-core-ktx-1.5.0.aar。
> 未找到 zip END 标头
28 秒内构建失败
at makeError (D:\ReactNative\todo\node_modules\execa\index.js:174:9)
at D:\ReactNative\todo\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\ReactNative\todo\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\ReactNative\todo\node_modules\@react-native-community\cli\build\index.js:192:9)
info 使用 --verbose 标志运行 CLI 以获取更多详细信息。
这个你能帮我吗
在这里找到了正确的解决方案。这对我有用。https://github.com/software-mansion/react-native-screens/issues/1369#issuecomment-1105152720 https://github.com/software-mansion/react-native-screens/issues/1369#issuecomment-1105152720:
在我的 android/build.gradle 文件中我更改了这一点:
buildscript {
ext {
// ...
kotlin_version = '1.6.10' // <- add this line
}
dependencies {
// ...
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // <- add this line
// ...
}
}
我还在 android/gradle.properties 中添加了增加的内存:org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)