対象
Andoroid Studioでソースを記述。
実行(U) - 実行(U)
を選択して以下のようなエラーがビルド出力に出てエミュレータが起動できないときの対処を記述します。
Invalid escape sequence at line 1 column 28 path $[0].name
対処
build.gradleを開く
プロジェクト中にあるbuild.gradleをエディタで開きます。
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// 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
}
こちらのclasspath 'com.android.tools.build:gradle:3.4.1'のバージョンを3.2.1に変更します。
バージョン自体はお使いのAndroidStudioに依存します。
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// 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
}
保存して再度
実行(U) - 実行(U)
を行います。
上記のようなダイアログが表示されますので「明日に通知」か「このプロジェクトでは確認しない」を押してください。
「更新」をクリックすると再びcom.android.tools.build:gradleのバージョンが最新に変更されます。
一度は起動するのですが、再度実行時にエラーとなります。
根本的な対処はまた後日。