[Flutter]Androidアプリとしてビルドすると「Warning: Mapping new ns https://schemes.android・・」というウォーニングが出る場合の対処法

このページには広告が含まれる場合があります。

 

FlutterのプロジェクトをAndroidアプリとしてビルドすると、アプリ自体は正常に動くのですが、

Warning: Mapping new ns https://schemes.android・・

というウォーニングがDebugウィンドウを埋め尽くしてしまう場合があります。

Running Gradle task 'assembleDebug'...
Warning: Mapping new ns https://schemas.android.com/repository/android/common/02 to old ns https://schemas.android.com/repository/android/common/01
Warning: Mapping new ns https://schemas.android.com/repository/android/generic/02 to old ns https://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns https://schemas.android.com/sdk/android/repo/addon2/02 to old ns https://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns https://schemas.android.com/sdk/android/repo/addon2/03 to old ns https://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns https://schemas.android.com/sdk/android/repo/repository2/02 to old ns https://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns https://schemas.android.com/sdk/android/repo/repository2/03 to old ns https://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns https://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns https://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns https://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns https://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: 予期しない要素(URI:""、ローカル:"base-extension")です。予期される要素は<{}codename>,<{}layoutlib>,<{}api-level>です

これは、Androidアプリをビルドするためのツールである「Gradle」のバージョンが低いことを示すウォーニングのようで、エラーではないのでこのまま放っておいても、アプリはちゃんと動くので問題はないのですが、気持ち悪いので解消したい場合は、

1)以下の要領で、「Open android module in Android Studio」からAndroidアプリとしてプロジェクトを開く

 

2)ビルドが回り終わると(Buildウィンドウで「finished」になることを確認)、プロジェクトのアップデートを促すウィンドウ(Project update recommended)が表示されるので、「upgraded」をクリック => 「Begin Upgrade」

 

3)画面の指示に従って「Update」にチェックが入っている(デフォルトのままでOK)ことを確認して「Run Selected Steps」すると、

 

4)Flutterのプロジェクトに戻って、プロジェクトレベルのbuild.gradleファイル(android => build.gradle)でGradleプラグインのバージョンが変更されたことを確認できるので、

これで再度ビルドすると、さきほどのウォーニングは出てこなくなります。

(詳しくは、以下の動画で解説していますので、よろしければご覧ください)

こんな記事も読まれています

人気No.1

前向きな気持ちになれる 占星術・タロットリーディング

あすコロ式・相談サロン 【ナビるやん】

人に言えない悩みから使命・運勢診断まで、あなたに寄り添いながら“ナビゲート”する、あすコロ人気No.1のオンライン相談サロン。占星術・心理学・タロットの叡智を活かし、普段認識していない「潜在意識」にアクセスしてあなたの気づいていない可能性を拓かせ、明日から前向きに歩めるようになる60分のリーディングセッション。

今すぐ詳細を見る(メルマガ登録で初回半額) ▶

TOP