AndroidStudio:APIのレベルについてメモ、エラー

APIがマッチしていないせいでエミュレーターを起動したときにエラーがでたりする。

まずエミュレーターのAPIを確認してからエミュレーターをダウンロードしたい。

APIのレベルを確認する方法

File

Project Structure

Modules

app

MinSdkVersion

これがあってないとエラーがでたりする。

エミュレーターのバージョンをあげたときに AndroidManifest.xml の activity タグに要素を追加しないといけないっぽい。
しないとこういうエラーがでる。

Manifest merger failed: Apps targeting Android 12 and higher are required to specify an explicit value for android: exported when the corresponding component has an intent filter defined

追加する要素
android:exported ってやつ。
android:name とかといっしょにのせとく。

<activity
          android:name=".MainActivity"
          android:exported="true">

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA