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 3 years have passed since last update.

Android Studio で Build ができない。

Posted at

Buildを行うとこんな感じ。
とりあえず、回避。

Executing tasks: [clean, :app:assembleDebug] in project C:\Users\xxxx\AndroidStudioProjects\MyApplication

Build-tool 31.0.0 is missing DX at C:\Users\xxxx\AppData\Local\Android\Sdk\build-tools\31.0.0\dx.bat
Build-tool 31.0.0 is missing DX at C:\Users\xxxx\AppData\Local\Android\Sdk\build-tools\31.0.0\dx.bat

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

Tools - SDK Manager
から
SDK Platforms
で以下をチェック

  • Android 11.0(R)
  • Android 10.0(Q)
  • Android 9.0(Pie)

SDK Tools

Show Package Details
にチェックをつけて
以下をチェック

Android SDK Build-Tools 31

  • 31.0.0
  • 30.0.3
  • 29.0.3
  • 28.0.3
  • 27.0.3

以下のファイルを修正

.\app\build.gradle
  android {
    compileSdkVersion 30 <<<
    buildToolsVersion "30.0.3" <<<

    defaultConfig {
        applicationId "com.example.myapplication"
        minSdkVersion 19
        targetSdkVersion 30 <<<

Build - Rebuild Project
を実行

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?