我在安乐施会中设立了一个新项目,但在我申请测试时,我发现这一错误:
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);
}
}