English 中文(简体)
依附和海底生物:活性:1.8.0 要求依靠它来汇编第34版或后版的安普森图书馆或仪器。
原标题:Dependency androidx.activity:activity:1.8.0 requires libraries or apps that depend on it to compile against version 34 or later of the Android APIs

我在安乐施会中设立了一个新项目,但在我申请测试时,我发现这一错误:

An issue was found when checking AAR metadata:

  1.  Dependency  androidx.activity:activity:1.8.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.0.2 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).

我不知道正在做些什么,但目前利用最新更新和图书馆的Im。

它们是:

dependencies {
    implementation  androidx.appcompat:appcompat:1.6.1 
    implementation  com.google.android.material:material:1.10.0 
    implementation  androidx.constraintlayout:constraintlayout:2.1.4 
    implementation  com.github.bumptech.glide:glide:4.16.0 
    testImplementation  junit:junit:4.13.2 

    androidTestImplementation  androidx.test.ext:junit:1.1.5 
    androidTestImplementation  androidx.test.espresso:espresso-core:3.5.1 
}

这是法典:

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

import java.util.ArrayList;

public class AllBook extends AppCompatActivity {

    private RecyclerView bookRecView;
    BookRecAdapter bookAdapter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_all_book);
        bookAdapter = new BookRecAdapter(this);
        bookRecView = findViewById(R.id.booksRecView);
        bookRecView.setAdapter(bookAdapter);
        bookRecView.setLayoutManager(new GridLayoutManager(this, 2));

        ArrayList<Book> books = new ArrayList<>();
        books.add(new Book(1, "1Q84", "Haruki Murakumi", 135, "https://i.gr-assets.com/images/S/compressed.photo.goodreads.com/books/1483103331l/10357575.jpg", "1Q84 is a novel written by Japanese writer Haruki Murakami, first published in three volumes in Japan in 2009–10."
        , "1Q84 is a novel written by Japanese writer Haruki Murakami, first published in three volumes in Japan in 2009–10. It covers a fictionalized year of 1984 in parallel with a "real" one. The novel is a story of how a woman named Aomame begins to notice strange changes occurring in the world"));

        bookAdapter.setBooks(books);
    }
}
问题回答

取代这一执行:

implementation  com.google.android.material:material:1.10.0 

with:

implementation  com.google.android.material:material:1.8.0 

仅需要更新<代码>compileSdk = 33 to 34,载于build.gradle.kts

我也面临同样的问题,并减少了从中产生的材料。

implementation  com.google.android.material:material:1.10.0 

页: 1

implementation  com.google.android.material:material:1.6.1 

如今,它会受到罚款。

随着新版的安乐施室的发布,每个人都在几天里也出现了同样的问题。 你们都这样做,要么将<代码>compileSdk的价值从33条改为34条,要么将<代码>com.google.android.material:material的版本从10个降至9,即改为:

执行 com.google.android.material:material:1.100

a 包括:

执行 com.google.android.material:material:1.90

这两种解决办法都应在modulesbuild.gradle文档中适用,而不是在项目上适用。

自上周以来,安乐公司将其活动版本更新至1.8,这要求你们至少有34个骨 the。 如果您的版本从1.8.0改为1.7.2,它将解决问题,因为这一版本至少需要33个点。

Basically the situation is: you current project using version 33, and you have conflict cause of this -> implementation com.google.android.material:material:1.10.0 which require 34

解决办法:

  1. replace on : implementation com.google.android.material:material:1.9.0 which will support version 33. OR
  2. update SDK to 34

采用<><>>>>>>>>>>> > 代码>build.gradle文档的以下改动:

- compileSdkVersion 33
+ compileSdkVersion 34
- targetSdkVersion 33
+ targetSdkVersion 34

<>说明>:- = Line Removal,+ = Line Addiation

I too faced the same issue. Then I checked my compileSDK version and target SDK version in build.gradle file in the Gradle Scripts Folder. I changed

    plugins {
    id  com.android.application 
}

android {
    namespace  com.example.classify 
    compileSdk 33

    defaultConfig {
        applicationId "com.example.classify"
        minSdk 24
        targetSdk 33
        versionCode 1
        versionName "1.0"

        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.6.1 
    implementation  com.google.android.material:material:1.10.0 
    implementation  androidx.constraintlayout:constraintlayout:2.1.4 
    testImplementation  junit:junit:4.13.2 
    androidTestImplementation  androidx.test.ext:junit:1.1.5 
    androidTestImplementation  androidx.test.espresso:espresso-core:3.5.1 
}

页 次

    plugins {
    id  com.android.application 
}

android {
    namespace  com.example.classify 
    compileSdk 34

    defaultConfig {
        applicationId "com.example.classify"
        minSdk 24
        targetSdk 34
        versionCode 1
        versionName "1.0"

        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.6.1 
    implementation  com.google.android.material:material:1.8.0 
    implementation  androidx.constraintlayout:constraintlayout:2.1.4 
    testImplementation  junit:junit:4.13.2 
    androidTestImplementation  androidx.test.ext:junit:1.1.5 
    androidTestImplementation  androidx.test.espresso:espresso-core:3.5.1 
}

I just updated the SDK version and clicked syn gradle button.... When i run the code now its promising

I changed compileSdk = 33 to compileSdk = 34 in the build.gradle.kts file. After making this modification, I rebuilt the project and run the app. compileSdk = 33 to 34

我也有同样的问题。 建议采取的行动是更新该项目,以使用新的compileSdk

为此,请登陆Gradle casts->build.gradle.kts(Module.app)。 替换 Sdk, 33至34。 右上角的“Sync现在”新闻,应当罚款。

I had the same issue. I changed the compiler version to SDK 34, and now it is working fine.

如果你想保留最新的材料图书馆版本,也不想把SDK编成34册,那是你们的解决办法。

不包括下列材料图书馆的活动:

implementation("com.google.android.material:material:1.10.0") {
    exclude("androidx.activity", "activity")
}

为了解决这个问题,我必须更新格拉斯原始版。 然而,由于可以使用的格拉斯原始版本取决于安妮·演播室的版本,IRV更新了,所有材料都做了罚款。

Add android.suppressUnsupportedCompileSdk=34 to gradle.properties file.

I face this issue today change androidx.activity:activity:1.4.0

刚刚更新。 梯度线8汇编 Sdk = 33 Sdk = 34





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签