【问题标题】:React Native: What's the difference between gradle references in gradle-wrapper.properties and build.gradle?React Native:gradle-wrapper.properties 和 build.gradle 中的 gradle 引用有什么区别?
【发布时间】:2021-01-26 15:54:50
【问题描述】:

在我的 React Native 应用程序中,我收到一个关于与 gradle 6 不兼容的错误,因此我查看了我的项目结构以找出我在我的项目中运行的 gradle 版本。我在gradle-wrapper.properties找到了这条线

distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip

还有build.gradle中的这一行

classpath("com.android.tools.build:gradle:3.4.2")

我想知道的:每个文件中对 gradle 的引用有什么区别?换句话说,我的项目中是如何使用 5.5 版本的,以及如何使用 3.4.2 版本?

【问题讨论】:

    标签: android react-native gradle


    【解决方案1】:

    distributionUrl 代表Gradel 版本其中classpath 代表Android Gradle plugin 版本。

    Gradel vs Android Gradle plugin:参考这个difference between android gradle plugin and gradle

    Gradle 是构建系统。

    您可以将它与a lot of plugins 一起使用。其中之一是plugin for Android
    它用于为构建和测试 Android 应用程序提供特定的流程和可配置设置。

    有关上述两种版本的更多详细信息和映射,请参阅以下 URL https://developer.android.com/studio/releases/gradle-plugin#updating-gradle https://developer.android.com/studio/releases/gradle-plugin#updating-plugin

    我希望这个答案已经消除了你的疑虑。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-05
      • 2017-06-21
      • 1970-01-01
      相关资源
      最近更新 更多