0

I need your help please, i have an android photo frame app that is working good on a phone with android 5.1.1 but when i tested it on another phone with android version 7.0 when i tried to import a photo from the gallery to the editor it's not working and it's sending me back to chose a frame again, in the gradle i have targetSdkVersion 27 as google told us the targetSdkVersion must be > 26, i tested something when i downgrade targetSdkVersion to 22 it's working in both phones but when i changed it to 27 it's only working perfect in the phone with 5.1.1 android version. Please check my gradle and help me to solve this problem.

buildscript {

repositories {

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

             }

 dependencies {

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

              }

         }

apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

repositories {

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

}

apply plugin: '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'

    }

}

}

dependencies {

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')

}

  • Api level 22 was the last one where it was not necessary to request permissions at runtime (those were the days...) So if your app works on Android 5.1.1, you should look at the way you handle permissions in your code. – Bö macht Blau Jan 09 '19 at 19:55
  • Thank you this is really helped me – samawi non Jan 11 '19 at 15:18

1 Answers1

1

You should request permissions at runtime

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

Anwar SE
  • 743
  • 2
  • 7
  • 14