【トラブル】【Android】プロジェクト作成時のトラブル

【1】「Failed to find style 'coordinatorlayoutstyle' in current theme」が表示される

 新しくプロジェクトを作ったら、
「Failed to find style 'coordinatorlayoutstyle' in current theme」が表示される

発生環境

 * OS : Windows10
 * Android Studio v3.1.4

手順

1)Android SDK Platform 28をアンインストールする

[1] Android Studio の [Tools]-[SDK Manager]-[System setting]-[Android SDK]で
   「Show package detail」のチェックボックスにチェックを入れる
[2] Android SDK Platform 28のチェックを外し、「apply」ボタン押下
[3] 「./app/build.gradle」を以下の【修正後】のように修正し、
    [File]-[Sync Project with Gradle Files]を選択

【修正前】./app/build.gradle

android {
    compileSdkVersion 28
    defaultConfig {
        // 略
        targetSdkVersion 28
        // 略

dependencies {
    implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
    implementation 'com.android.support:design:28.0.0-rc02'
    // 略
}

【修正後】./app/build.gradle(28 => 27に下げる)

android {
    compileSdkVersion 27
    defaultConfig {
        // 略
        targetSdkVersion 27
        // 略

dependencies {
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    // 略
}

2) ./app/res/values/style.xml の修正

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- 略 -->
        <!-- 以下の行を追加する. -->
        <item name="coordinatorLayoutStyle">@style/Widget.Design.CoordinatorLayout</item>
    </style>

参考文献

https://www.maikeruexe.jp/entry/2018/07/04/225300
https://www.androidpit.com/forum/772791/android-studio-err-msg-render-problem-failed-to-find-sytle-coordinatorlayoutstyle-in-current-theme
https://stackoverflow.com/questions/49292487/failed-to-find-style-coordinatorlayoutstyle-in-current-theme