0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Android Studio からエミュレータを実行できないとき(一時的な対処)

Posted at

対象

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)
を行います。

image.png

上記のようなダイアログが表示されますので「明日に通知」か「このプロジェクトでは確認しない」を押してください。

「更新」をクリックすると再びcom.android.tools.build:gradleのバージョンが最新に変更されます。
一度は起動するのですが、再度実行時にエラーとなります。

根本的な対処はまた後日。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?