当我将 TargetSdkVersion 22 更改为 27 时出现问题

Having problems when i changed TargetSdkVersion 22 to 27

我需要你的帮助,我有一个 android 相框应用程序,它在 phone 和 android 5.1.1 上运行良好,但是当我在另一个 phone 使用 android 版本 7.0 当我尝试将照片从画廊导入到编辑器时它不起作用并且它让我重新选择一个框架,在 gradle 我有 targetSdkVersion 27正如 google 告诉我们 targetSdkVersion 必须 > 26,当我将 targetSdkVersion 降级到 22 时我测试了一些东西它在两个 phones 中工作但是当我将它更改为 27 它只在 phone 5.1.1 android 版本。请检查我的gradle并帮助我解决这个问题。

构建脚本{

repositories {

  maven { url 'https://plugins.gradle.org/m2/'}

             }

 dependencies {

    classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:  
       [0.12.1, 0.99.9]'

              }

         }

应用插件:'com.onesignal.androidsdk.onesignal-gradle-plugin'

存储库{

maven { url 'https://maven.google.com' }

}

应用插件:'com.android.application'

android {

compileSdkVersion 27

buildToolsVersion '28.0.3'

defaultConfig {

    manifestPlaceholders = [

            onesignal_app_id: '5sdfjk85-df56-3564-df5639-24598ml0f35b',
            // Project number pulled from dashboard, local value is ignored.
            onesignal_google_project_number: 'REMOTE'
    ]

    applicationId "com.techlabo.gardendflowers.gardenphotoframes"
    minSdkVersion 15
    targetSdkVersion 27
    versionCode 5
    versionName "5.3"
}


buildTypes {

    release {

        minifyEnabled false

        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

    }

}

}

依赖项 {

implementation 'com.onesignal:OneSignal:[3.10.3, 3.99.99]'

implementation fileTree(include: ['*.jar'], dir: 'libs')

testImplementation 'junit:junit:4.12'

implementation 'com.android.support:appcompat-v7:27.0.0'

implementation 'com.android.support:design:27.0.0'

implementation 'com.android.support:recyclerview-v7:27.0.0'

implementation 'com.android.support:cardview-v7:27.0.0'

implementation 'com.startapp:inapp-sdk:3.11.1'

implementation files('libs/glide-3.7.0.jar')

}

您应该在运行时请求权限

https://developer.android.com/training/permissions/requesting#java