【问题标题】:How to add project level dependency class path in Android Studio Bumblebee如何在 Android Studio Bumblebee 中添加项目级依赖类路径
【发布时间】:2022-11-15 18:07:04
【问题描述】:

由于我在项目级 build.gradle 文件中将我的 Android Studio 更新为 Bumblebee,因此包含 plugins 块,如下所示:

plugins {
    id 'com.android.application' version '7.1.1' apply false
    id 'com.android.library' version '7.1.1' apply false
    id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

以前在顶级 build.gradle 文件中的存储库设置现在位于 settings.gradle 文件中。

通过此更改,我无法将新插件添加到我的应用程序中,我想将以下插件添加到我已添加到我的应用程序级别 build.gradle 的项目中。

apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs.kotlin"

为了完成这项工作,我需要在我的项目级别 build.gradle 中添加类路径,但是由于 build.gradle 结构最近发生了变化,我不确定如何在我的项目级别 @987654327 添加以下行@

dependencies {
       
        classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0"
    }

我试图在https://developer.android.com/studio/releases/gradle-plugin 中找到解决方案,但是我看不到任何解决方案,但是我知道此更改来自带有 gradle 插件版本 7.0.0 的 Android Studio Bumblebee

请帮我添加依赖项。

【问题讨论】:

    标签: android gradle build.gradle gradle-plugin


    【解决方案1】:

    使用这一行:

    id 'androidx.navigation.safeargs.kotlin' version '2.5.0-alpha01' apply false
    

    【讨论】:

      【解决方案2】:
      settings.gradle
      pluginManagement {
          resolutionStrategy {
              eachPlugin {
                  if (requested.id.namespace == 'com.example') {
                      useModule('com.example:sample-plugins:1.0.0')
                  }
              }
          }
          repositories {
              maven {
                  url './maven-repo'
              }
              gradlePluginPortal()
              ivy {
                  url './ivy-repo'
              }
          }
      }
      
      

      【讨论】:

        猜你喜欢
        • 2022-07-09
        • 1970-01-01
        • 2022-01-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-01-09
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多