Android Studio 4.2.2
Build #AI-202.7660.26.42.7486908, built on June 24, 2021
Runtime version: 11.0.8+10-b944.6842174 amd64
VM: OpenJDK 64-Bit Server VM by N/A
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 8
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin
■ 症状
プロジェクト作成後、「Make Project」「Run ’App’」など実行すると failed となる。
エミュレーターは起動するが作成アプリが起動しない。

Executing tasks: [:app:assembleDebug] in project C:\Users\****\AndroidStudioProjects\MyApplication
Build-tool 31.0.0 is missing DX at C:\Users\****\AppData\Local\Android\Sdk\build-tools\31.0.0\dx.bat
Build-tool 31.0.0 is missing DX at C:\Users\****\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 711ms
Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
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.
■ 対処
下記対応を行うことで修正可能です。
Project Structure 設定変更
1.Project Structure 起動

2.Module タブ選択

3.Build Tools Version 31.0.0 → 30.0.* に変更

4.Default Config タブに移動

5.Target SDK Version 31 → 30 に変更

OK をクリックして設定変更完了

Success ログ確認
BUILD SUCCESSFUL in *s と表示される。

■ 動作確認
「Make Project」や「Run ‘App’」などエラーが発生した処理を再実行。サンプルでは「Run ‘App’」を実行。ビルドが成功し、エミュレーター起動→作成アプリが起動することを確認しています。


■ アプリ開発を学びたい方は
現在の仕事の将来性が心配で新たにIT系へ進みたいが知識がなく未経験だから心配という方は多いと思います。そういった方のために未経験から学べるオンラインスクールがあります。
テックアカデミーではオンラインで1週間の無料体験コースや前職不問・プログラミング未経験の初心者でも12週間で東京のIT企業へエンジニアとして転職を目指せる転職保障といったものもあります。気になる方、本気で転職を考えている方は一度調べてみてはいかがでしょうか。
コメント