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 アプリでサポートするOSを変更したらリリースビルド失敗するようになった

Posted at

前提

  • AndroidStudio: 3.1
  • Gradle version: 4.4
  • ReactNative: 0.57.1
  • リリースに必要なもろもろ 参考サイト は実施済み
  • 過去にほぼ同じ条件でリリース通ったことあり
  • クライアントの要望により minSdkVersion の値を低くした

エラー内容

error: invalid file path '/[アプリのディレクトリ]/[アプリ名]/node_modules/react-native-sensitive-info/android/build/intermediates/manifests/aapt/release/AndroidManifest.xml'.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-sensitive-info:verifyReleaseResources'.
> java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details

解決策

  1. AndroidStudio を閉じる
  2. 以下のディレクトリやファイルを全部削除する
  • /android/build
  • /android/.gradle
  • /android/.idle
  • /android/[アプリ名].iml
  • /android/app/build
  • /android/app/app.iml
  1. AndroidStudio でプロジェクトを開く
  2. もろもろの処理が終わるのを待つ
  3. 再度ビルド

原因

なんでなのかはわからないけど、対象の sdk 変えたからキャッシュが悪さしたんだと思う。

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?