「import io.realm.RealmRecyclerViewAdapter」ができずに困っております。
ScheduleAdapterクラスを作成後、その中で「RealmRecyclerViewAdapter」を使用しております。
importして上記を使用したいのですが、なぜかimportできない(反応しない)状態です。
解決方法についてご教示いただけませんでしょうか。
試したこと
bulid.gradleへ下記を記載しましたが、解決できませんでした。
implementation 'androidx.recyclerview:recyclerview:1.1.0'
ScheduleAdapter
1import io.realm.OrderedRealmCollection 2 3class ScheduleAdapter(data: OrderedRealmCollection<Schedule>) : 4 RealmRecyclerViewAdapter<Schedule, ScheduleAdapter.ViewHolder>(data, true){ 5}
build.gradle(project)
1buildscript { 2 repositories { 3 google() 4 mavenCentral() 5 } 6 7 8 dependencies { 9 classpath "com.android.tools.build:gradle:7.0.4" 10 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20" 11 classpath "io.realm:realm-gradle-plugin:10.4.0" 12 } 13} 14 15task clean(type: Delete) { 16 delete rootProject.buildDir 17}
build.gradle(module)
1plugins { 2 id 'com.android.application' 3 id 'org.jetbrains.kotlin.android' 4 id 'kotlin-kapt' 5 id 'realm-android' 6} 7 8android { 9 compileSdk 31 10 11 defaultConfig { 12 applicationId "com.example.myscheduler3" 13 minSdk 23 14 targetSdk 31 15 versionCode 1 16 versionName "1.0" 17 18 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 19 } 20 21 buildTypes { 22 release { 23 minifyEnabled false 24 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 25 } 26 } 27 compileOptions { 28 sourceCompatibility JavaVersion.VERSION_1_8 29 targetCompatibility JavaVersion.VERSION_1_8 30 } 31 kotlinOptions { 32 jvmTarget = '1.8' 33 } 34 buildFeatures { 35 viewBinding true 36 } 37} 38 39dependencies { 40 implementation 'io.realm:android-adapters:2.1.1' 41 implementation 'androidx.core:core-ktx:1.7.0' 42 implementation 'androidx.appcompat:appcompat:1.4.1' 43 implementation 'com.google.android.material:material:1.5.0' 44 implementation 'androidx.constraintlayout:constraintlayout:2.1.3' 45 implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0' 46 implementation 'androidx.navigation:navigation-ui-ktx:2.4.0' 47 testImplementation 'junit:junit:4.13.2' 48 androidTestImplementation 'androidx.test.ext:junit:1.1.3' 49 androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 50}

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/04/24 01:40
2022/04/25 08:21