前提・実現したいこと
kotlinでrealmを実装したいです。
はじめてのAndroidプログラミング第五版をもとに進めております。
アンドロイドスタジオをバージョンアップすると同期できなくなりました。
以前のバージョンではbuild.gradle(MyScheduler)のbuildscriptのところにjcenter()を追加するだけで
出来たのですが、今回は出来ませんでした。調べてもよく分からないことだらけです。
ご教示お願い致します。
発生している問題・エラーメッセージ
gradleプロジェクトの同期に失敗してしまいます。
Build was configured to prefer settings repositories over project repositories but repository 'BintrayJCenter' was added by plugin 'realm-android'
A problem occurred configuring project ':app'. > Build was configured to prefer settings repositories over project repositories but repository 'BintrayJCenter' was added by plugin 'realm-android' * Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights.
該当のソースコード
//build.gradle(MyScheduler) // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() mavenCentral() jcenter() } dependencies { classpath "com.android.tools.build:gradle:7.0.1" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20" classpath "io.realm:realm-gradle-plugin:10.0.1" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } task clean(type: Delete) { delete rootProject.buildDir }
//build.gradle(;app) plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-kapt' id 'realm-android' } android { compileSdk 30 defaultConfig { applicationId "com.example.myscheduler" minSdk 21 targetSdk 30 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 'io.realm:android-adapters:2.1.1' implementation 'androidx.core:core-ktx:1.3.2' implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'com.google.android.material:material:1.3.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5' implementation 'androidx.navigation:navigation-ui-ktx:2.3.5' testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' }
補足情報(FW/ツールのバージョンなど)
Android Studio Arctic Fox | 2020.3.1 Patch 1
kotlinを使い始めてまだ2か月の初心者です。
宜しくお願い致します。
あなたの回答
tips
プレビュー