Android アプリ開発初学です
初質問のため至らない点あれば申し訳ありません
実現したいこと
Realmを用いたデータべースをRecyclerViewに表示させるために
"io.realm:android-adapters:4.0.0"という追加コンポーネントを
導入したい
問題
BuildGradle(app)で"io.realm:android-adapters:4.0.0"を導入し
プログラムを実行すると次のようなエラーを吐きます
> Task :app:writeDebugSigningConfigVersions UP-TO-DATE FAILURE: Build completed with 8 failures. 1: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'. > Could not resolve all files for configuration ':app:debugCompileClasspath'. > Could not find io.realm:android-adapters:4.0.0. Required by: project :app * Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights. 文字数制限のため省略 以下同じエラーの繰り返し
GradleのSync時には以下のwarningが出ます
Failed to resolve: io.realm:android-adapters:4.0.0 Show in Project Structure dialog Affected Modules: app
コード
以下がGradleのコードです
buildGradle
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:7.1.3' classpath"io.realm:realm-gradle-plugin:10.9.0" } } plugins { id 'com.android.application' version '7.1.2' apply false id 'com.android.library' version '7.1.2' apply false id 'org.jetbrains.kotlin.android' version '1.5.30' apply false } task clean(type: Delete) { delete rootProject.buildDir }
以下がGradle(app)のコード
buildGradle(app)
plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' id 'kotlin-kapt' id 'realm-android' } android { compileSdk 32 defaultConfig { applicationId "com.example.myrealmtest" minSdk 21 targetSdk 32 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 } kotlinOptions { jvmTarget = '1.8' } buildFeatures { viewBinding true } } dependencies { implementation 'androidx.core:core-ktx:1.7.0' implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material:material:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2' implementation 'androidx.navigation:navigation-ui-ktx:2.4.2' implementation"io.realm:android-adapters:4.0.0" testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' }
他、XMLやkotlinクラスは、projectの作成時から変更していないため
省略します。必要なら記載します。
開発環境
Android Studio Version最新
Android Gradle Plugin Version7.1.3
Gradle Version7.4.2
試したこと
ググってみて、具体的な解決方法が理解できず困っています。
解決方法をご教示頂けますと幸いです。
後学のためにアドバイス等もいただけたら
ありがたいです。
どうか宜しくお願い致します。
まだ回答がついていません
会員登録して回答してみよう