build.gradleの設定して、Sync Nowを実行後に下記エラーが発生しました。
解決方法をご教示いただけませんでしょうか。
よろしくお願いいたします。
build.gradle
1// Top-level build file where you can add configuration options common to all sub-projects/modules. 2buildscript { 3 ext.kotlin_version = "1.5.0" 4 repositories { 5 google() 6 mavenCentral() 7 jcenter() 8 } 9 dependencies { 10 classpath "com.android.tools.build:gradle:4.1.0" 11 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 classpath "io.realm:realm-gradle-plugin:10.0.1" 13 def nav_version = "2.3.1" 14 classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" 15 // NOTE: Do not place your application dependencies here; they belong 16 // in the individual module build.gradle files 17 } 18} 19 20allprojects { 21 repositories { 22 google() 23 mavenCentral() 24 jcenter() 25 } 26} 27 28task clean(type: Delete) { 29 delete rootProject.buildDir 30}
build.gradle(:app)
1plugins { 2 id 'com.android.application' 3 id 'kotlin-android' 4 id 'kotlin-kapt' 5 id 'realm-android' 6} 7 8android { 9 compileSdkVersion 30 10 buildToolsVersion "30.0.2" 11 12 defaultConfig { 13 applicationId "com.example.myscheduler" 14 minSdkVersion 23 15 targetSdkVersion 30 16 versionCode 1 17 versionName "1.0" 18 19 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 20 } 21 22 buildTypes { 23 release { 24 minifyEnabled false 25 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 26 } 27 } 28 compileOptions { 29 sourceCompatibility JavaVersion.VERSION_1_8 30 targetCompatibility JavaVersion.VERSION_1_8 31 } 32 kotlinOptions { 33 jvmTarget = '1.8' 34 } 35 buildFeatures { 36 viewBinding = true 37 } 38} 39 40dependencies { 41 implementation 'io.realm:android-adapters:2.1.1' 42 implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 43 implementation 'androidx.core:core-ktx:1.3.2' 44 implementation 'androidx.appcompat:appcompat:1.2.0' 45 implementation 'com.google.android.material:material:1.2.1' 46 implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 47 implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2' 48 implementation 'androidx.navigation:navigation-ui-ktx:2.2.2' 49 implementation 'androidx.legacy:legacy-support-v4:1.0.0' 50 testImplementation 'junit:junit:4.+' 51 androidTestImplementation 'androidx.test.ext:junit:1.1.2' 52 androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' 53}
errorMessage
1Build file '/Users/runban/AndroidStudioProjects/MyScheduler/build.gradle' line: 22 2 3A problem occurred evaluating root project 'MyScheduler'. 4> Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file 'build.gradle' 5 6* Try: 7Run with --info or --debug option to get more log output. Run with --scan to get full insights. 8 9* Exception is: 10org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'MyScheduler'. 11 at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93) 12 at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.lambda$apply$0(DefaultScriptPluginFactory.java:133) 13 at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77) 14 at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:136) 15 at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65) 16 ... 140 more 17 18 19
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。