skip to Main Content

hello guys I try to make new project with java in android studio but when I wanna run the project there is some problem with this :::

***4 issues were found when checking AAR metadata:

  1. Dependency ‘androidx.navigation:navigation-common:2.7.0’ requires libraries and applications that
    depend on it to compile against version 34 or later of the
    Android APIs.
    enter image description here
  :app is currently compiled against android-33.

Also, the maximum recommended compile SDK version for Android Gradle
plugin 8.1.0 is 33.

Recommended action: Update this project’s version of the Android Gradle
plugin to one that supports 34, then update this project to use
compileSdk of at least 34.

Note that updating a library or application’s compileSdk (which
allows newer APIs to be used) can be done separately from updating
targetSdk (which opts the app in to new runtime behavior) and
minSdk (which determines which devices the app can be installed
on).

  1. Dependency ‘androidx.navigation:navigation-runtime:2.7.0’ requires libraries and applications that
    depend on it to compile against version 34 or later of the
    Android APIs.
  :app is currently compiled against android-33.

Also, the maximum recommended compile SDK version for Android Gradle
plugin 8.1.0 is 33.

Recommended action: Update this project’s version of the Android Gradle
plugin to one that supports 34, then update this project to use
compileSdk of at least 34.

Note that updating a library or application’s compileSdk (which
allows newer APIs to be used) can be done separately from updating
targetSdk (which opts the app in to new runtime behavior) and
minSdk (which determines which devices the app can be installed
on).

  1. Dependency ‘androidx.navigation:navigation-fragment:2.7.0’ requires libraries and applications that
    depend on it to compile against version 34 or later of the
    Android APIs.
  :app is currently compiled against android-33.

Also, the maximum recommended compile SDK version for Android Gradle
plugin 8.1.0 is 33.

Recommended action: Update this project’s version of the Android Gradle
plugin to one that supports 34, then update this project to use
compileSdk of at least 34.

Note that updating a library or application’s compileSdk (which
allows newer APIs to be used) can be done separately from updating
targetSdk (which opts the app in to new runtime behavior) and
minSdk (which determines which devices the app can be installed
on).

  1. Dependency ‘androidx.navigation:navigation-ui:2.7.0’ requires libraries and applications that
    depend on it to compile against version 34 or later of the
    Android APIs.
  :app is currently compiled against android-33.

Also, the maximum recommended compile SDK version for Android Gradle
plugin 8.1.0 is 33.

Recommended action: Update this project’s version of the Android Gradle
plugin to one that supports 34, then update this project to use
compileSdk of at least 34.

Note that updating a library or application’s compileSdk (which
allows newer APIs to be used) can be done separately from updating
targetSdk (which opts the app in to new runtime behavior) and
minSdk (which determines which devices the app can be installed
on).*
**
enter image description here
and this is my gradel build ->

plugins {
id("com.android.application") }

android {
namespace = "com.arzju.myapplication"
compileSdk = 33

defaultConfig {
    applicationId = "com.arzju.myapplication"
    minSdk = 24
    targetSdk = 33
    versionCode = 1
    versionName = "1.0"

    testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        isMinifyEnabled = false
        proguardFiles(
            getDefaultProguardFile("proguard-android-optimize.txt"),
            "proguard-rules.pro"
        )
    }
}
compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}
buildFeatures {
    viewBinding = true
} }

dependencies {

implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.9.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.navigation:navigation-fragment:2.7.0")
implementation("androidx.navigation:navigation-ui:2.7.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")

}

I change the version of some lib and sdk to 34 , 33 for compiling and target but it dosnt work

2

Answers


  1. Add this line of code above defaultConfig

     compileSdk = 34
    
    Login or Signup to reply.
  2. basic view activity in android studio error solved, please try

    In android studio right hand side (Top corner find "SDK Manager" click here) and open pop up. Then checkbox checked "Android API level 34" and downloaded. then download successfully then finish and "apply" and "ok". After that Go to file and search "Invalidate Caches and Restart" then wait.
    Then Rebuild your project and follow this below code

    In build.gradle file (module app)

    android {
    compileSdkVersion 34
    
    defaultConfig {
        applicationId "com.appynitty.navapur_citizen"
        minSdkVersion 23
        targetSdkVersion 34
        versionCode 6
        versionName "1.0"
        multiDexEnabled false
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }}
    

    build.gradle(project_file)

    allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }}
    

    And Then in android studio (Go to file option and select setting)
    search "gradle" and check jdk reqirment, jdk11

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search