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

optimizedResourceShrinkingを有効にするとAboutLibrariesのjsonが消されるのでkeepが必要

1
Last updated at Posted at 2026-09-11

タイトルの通りなのですが、AGP 9.x で追加された optimizedResourceShrinking を有効にすると AboutLibraries が生成する json ファイルが最適化のために消えてしまい、ライセンスの画面表示でクラッシュするようになります。

以下のようなリソースの keep 処理を res/raw/keep.xml を入れることで回避することができます。

keep.xml
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
    tools:keep="@raw/aboutlibraries" />

optimizedResourceShrinking は DEX コードの最適化要件で有効にする必要があるため、有効時には注意しましょう。

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