LoginSignup
2
1

More than 3 years have passed since last update.

[Android Studio]FileNotFoundExceptionでビルドが失敗する場合の対処法

Posted at

現象

ビルド時に以下のようなエラーが発生する

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexWithInstantRunSlicesApkForDebug'.
> java.lang.RuntimeException: java.io.FileNotFoundException: /Users/hoge/android_app/app/build/intermediates/instant_run_split_apk_resources/debug/instantRunSplitApkResourcesDebug/out/slice_1/resources_ap

Android Studio 3.4 以降で起こるらしい?
Instant Runが有効な場合に起こる。

対処法

gradle-wrapper.properties の gradle のバージョンを 5.2 以上にする。
少なくとも 5.4 では動作した。

gradle/wrapper/gradle-wrapper.properties
- distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
+ distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-all.zip

参考

2
1
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
2
1