7
4

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サンプルのビルドでminSdkVersionのエラーが出たときの対処(Android初心者)

Posted at

AndroidStudioを使っていて、サンプルをダウンロードしてビルドしてみようとしたときに出たエラーの対処です。

エラー:Execution failed for task ':Application:processDebugManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 9 cannot be smaller than version 14 declared in library [com.android.support:gridlayout-v7:26.1.0] C:\Users\use.android\build-cache\a30df1b586f055c7d0852106c9f9f75e253c4101\output\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="android.support.v7.gridlayout" to force usage

とりあえずよくわからないので、Suggestion: use ... to force usage(強制的に...を使え)と出てきたのでAndroidManifest.xmlに以下のuses-sdk要素の記述を追加してみましたが、エラーは...を変えて際限なく続きます。

<uses-sdk xmlns:tools="http://schemas.android.com/tools"
    android.support.v7.gridlayout,
    tools:overrideLibrary="android.support.v7.cardview,
    android.support.coreutils,
    ...際限なく
    "/>

全くよくわかっていなかったのですが、どうやらbuild.gradleという設定ファイルの以下のエントリを14以上にすることで解決するものでした。

defaultConfig {
    minSdkVersion 14 //ここ 9から14に変更
    targetSdkVersion 26
}
7
4
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
7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?