前提・実現したいこと
最近、「はじめてのAndroidプログラミング第五版」をもとにAndroidstudioの学習を始めました。
Realmを使用するためbuild.Grade(Module:app),build.Grade(Project;MyScheduler)を修正したのですが
同期が完了しません。
プログラミング歴も浅く、知識も乏しいのでエラーメッセージを調べても対処法がわかりません。
エラーの原因、解決の手順について教えてください。
発生している問題・エラーメッセージ
Build file 'C:\Users\okue\Realm\build.gradle' line: 22 A problem occurred evaluating root project 'Realm'. > Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file 'build.gradle' * Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'Realm'.
該当のソースコード
///build.gradle(Module:app) apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'realm-android' apply plugin: 'kotlin-kapt' android { compileSdkVersion 27 defaultConfig { applicationId "com.example.promoto.myscheduler" minSdkVersion 16 targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation'io.realm:android-adapters:2.1.1' implementation"org.jetbrains.anko:anko-common:$anko_version" implementation fileTree(dir: 'libs', include: ['*.jar']) implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.android.support:design:27.1.1' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' }
///build.Grade(Project;MyScheduler) buildscript { ext.kotlin_version = '1.2.61' ext.anko_version='0.10.5' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath"io.realm:realm-gradle-plugin:5.0.0" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }
試したこと
色々調べたのですが、どうしていいのか分からず何も出来ていない状態です。
補足情報(FW/ツールのバージョンなど)
Android Studio Arctic Fox | 2020.3.1 Patch1
回答1件
あなたの回答
tips
プレビュー