简体   繁体   English

Android 大黄蜂工作室,Maven()

[英]Android Studio BumbleBee, Maven()

I updated the Android Studio and Created a new project.我更新了 Android Studio 并创建了一个新项目。 I'm using some dependencies from GitHub, but after sync now, I'm getting this warning.我正在使用 GitHub 中的一些依赖项,但现在同步后,我收到此警告。 If I ignore it, the application won't get installed.如果我忽略它,应用程序将不会安装。 在此处输入图像描述

Project Level build.gradle项目级 build.gradle

buildscript {
    ext {
        compose_version = '1.6.10'
    }
    dependencies {
        classpath 'com.google.gms:google-services:4.3.10'
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
    }
}

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

allprojects {
    repositories {
        google()
        maven { url 'https://jitpack.io' }
        maven {
            url "https://maven.google.com"
        }
//        mavenCentral()
        maven { url 'https://github.com/leonardocardoso/mvn-repo/raw/master/maven-deploy' }
    }
}

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

App Level build.gradle应用级别 build.gradle

plugins {
    id 'com.android.application'
}

android {
    compileSdk 31

    buildFeatures {
        dataBinding true
    }

    defaultConfig {
        applicationId "com.eg.eg"
        minSdk 21
        targetSdk 31
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
dependencies {

    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$compose_version"
    implementation 'com.github.scottyab:showhidepasswordedittext:0.8'

}

settings.gradle设置.gradle

import org.gradle.api.initialization.resolve.RepositoriesMode

pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()

    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
    repositories {
        google()
        mavenCentral()

    }
}
rootProject.name = "MyPro_v02"
include ':app'

How To Resolve this issue in Android Studio latest version BumbleBee?如何在 Android Studio 最新版本的 BumbleBee 中解决此问题?

For newer Android Studio projects created in Android Studio Bumblebee |对于在 Android Studio Bumblebee 中创建的较新的 Android Studio 项目 | 2021.1.1 or newer, the JitPack repository needs to be added into the root level file settings.gradle instead of build.gradle: 2021.1.1 或更高版本,JitPack 存储库需要添加到根级文件settings.gradle instead of build.gradle:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
      // ...
        maven { url 'https://jitpack.io' }
    }
}

Add this line in your settings.gradle (bumblebee version) after add this line Rebuild Project:-添加此行后,在您的设置中添加此行。gradle(大黄蜂版本)重建项目:-

 jcenter()
 maven { url "https://jitpack.io" }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM