无法使用Expo运行Android应用程序,因为存在Kotlin Gradle插件版本冲突。

huangapple go评论66阅读模式
英文:

Cannot run android app using expo because of Kotlin Gradle plugin version conflict

问题

I created an expo project and ran expo run:android. And android project is built, but Gradle fails due to a version conflict. This is the message that I got.

> Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source.
Android gradle plugin: 7.4.1
Gradle: 7.5.1
WARNING: Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

FAILURE: Build failed with an exception.

* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
root project '(app name)' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10

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

I can directly fix build.gradle file to resolve this issue. But, this approach will still create build fails for eas build, because prebuilt files will not be changed.

How can I make expo to create android files with correct gradle plugin version?

英文:

I created an expo project and ran expo run:android.
And android project is built, but Gradle fails due to a version conflict.
This is the message that I got.

> Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source.
Android gradle plugin: 7.4.1
Gradle: 7.5.1
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

FAILURE: Build failed with an exception.

* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
root project '(app name)' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10

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

I can directly fix build.gradle file to resolve this issue.
But, this approach will still create build fails for eas build, because prebuilt files will not be changed.

How can I make expo to create android files with correct gradle plugin version?

答案1

得分: 1

  1. 你可以通过分叉 https://github.com/crossplatformkorea/react-native-kakao-login 来解决这个问题。
  2. 更改 kotlin-gradle 插件的版本。
  3. 将你的分叉添加到你的 package.json 中。
英文:

You can solve this by:

  1. You can fork https://github.com/crossplatformkorea/react-native-kakao-login
  2. Change kotlin-gradle plugin version
  3. Add your fork to you package.json

huangapple
  • 本文由 发表于 2023年5月15日 11:45:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76250770.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定