skip to Main Content

I updated the Android Studio and Created a new project.
I’m using some dependencies from GitHub, but after sync now, I’m getting this warning. If I ignore it, the application won’t get installed.
enter image description here

Project Level 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

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

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?

2

Answers


  1. For newer Android Studio projects created in Android Studio Bumblebee | 2021.1.1 or newer, the JitPack repository needs to be added into the root level file settings.gradle instead of build.gradle:

    dependencyResolutionManagement {
        repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
        repositories {
          // ...
            maven { url 'https://jitpack.io' }
        }
    }
    
    Login or Signup to reply.
  2. Add this line in your settings.gradle (bumblebee version)
    after add this line Rebuild Project:-

     jcenter()
     maven { url "https://jitpack.io" }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search