2016-12-15 5 views
0

Mein Targeted SDK ist 22! Wenn ich versuche, externer Speicher zu schreiben, ein Toast ist, sagt gezeigt:Android-Berechtigung WRITE EXTERNAL STORAGE funktioniert nicht, auch wenn ich es

java.lang.SecurityExeption: need WRITE_EXTERNAL_STORAGE permission to use DESTINATION_FILE_URI: uid 10504 does not have android.permission.WITE_EXTERNAL_STORAGE

Dies ist der Fehler ist:

Error

Kann mir jemand helfen?

MY AndroidMainfest:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    package="com.CowLabel"> 

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 
    <uses-permission android:name="android.permission.INTERNET"/> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 
    <uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE"/> 
    <uses-permission android:name="com.android.vending.BILLING"/> 
    <uses-permission android:name="com.android.alarm.permission.SET_ALARM"/> 


    <application 
     android:hardwareAccelerated="true" 
     android:allowBackup="true" 
     android:icon="@drawable/Cows" 
     android:label="@string/app_name" 
     android:supportsRtl="true" 
     android:name="CowLabel.util.MyApplication" 
     android:theme="@style/Mytheme"> 


     <meta-data android:name="com.google.android.gms.version" 
      android:value="@integer/google_play_services_version" /> 


     <activity android:name="CowLabel.WelcomeActivity" android:theme="@style/Theme.AppCompat.Light.NoActionBar"> 

      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 

     </activity> 
     <activity android:name="CowLAbel.Purchase_activity"/> 

     <service 
      android:name="CowLabel.accessibilityservice" 

      android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE" 
      android:label="Cow Label" > 
      <intent-filter> 
       <action android:name="android.accessibilityservice.AccessibilityService" /> 
      </intent-filter> 

      <meta-data 
       android:name="android.accessibilityservice" 
       android:resource="@xml/accessibility_service_config" /> 

     </service> 

     <activity 
      android:name="com.CowLabel.MainActivity"></activity> 

     <receiver android:name="com.CowLabel.Notification_reciever"/> 















     </application> 








</manifest> 

Mein Gradle Datei:

apply plugin: 'com.android.application' 


android { 
    compileSdkVersion 25 
    buildToolsVersion "24.0.3" 

    defaultConfig { 
     applicationId "com.CowLabel" 
     minSdkVersion 15 
     targetSdkVersion 22 
     versionCode 11 
     versionName "2.3" 
     multiDexEnabled true 
     vectorDrawables.useSupportLibrary = true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 


} 

repositories { 

    maven { 
     name "Fyber's maven repo" 
     url "https://fyber.bintray.com/maven" 
    } 
    flatDir { 
     dirs "libs" 
    } 

} 


dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:25.0.0' 
    compile 'org.jsoup:jsoup:1.9.2' 
    compile 'com.mcxiaoke.volley:library:1.0.19' 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'com.google.android.gms:play-services-ads:10.0.1' 
    compile 'com.anjlab.android.iab.v3:library:1.0.+' 
    compile 'com.google.firebase:firebase-core:10.0.1' 
    compile 'com.google.firebase:firebase-database:10.0.1' 
    compile 'com.google.firebase:firebase-ads:10.0.1' 
    compile 'com.google.firebase:firebase-appindexing:10.0.1' 
    compile 'com.google.firebase:firebase-config:10.0.1' 
    compile 'com.google.firebase:firebase-messaging:10.0.1' 
    compile 'com.google.firebase:firebase-crash:10.0.1' 



    compile(name:'heyzap-unified-platform-10.2.2', ext:'aar') 
    //adcolony 
    compile 'com.fyber.mediation:adcolony:[email protected]' 

    //inmobi 
    compile 'com.fyber.mediation:inmobi:[email protected]' 
    compile 'com.squareup.picasso:picasso:2.5.2' 

    //tapjoy 
    compile 'com.fyber.mediation:tapjoy:[email protected]' 

    //unityads 
    compile 'com.fyber.mediation:unityads:[email protected]' 

    //vungle 
    compile 'com.google.dagger:dagger:2.4' 
    compile 'javax.inject:javax.inject:1' 

    // IMPORTANT! 
// The latest Vungle adapter is not currently published to Fyber's maven repository. 
// Please follow the "Eclipse Users" instructions to download the Vungle adapter and add the `aar` file to your project's `libs` folder 
    compile (name: 'fyber-vungle-4.0.3-r1', ext: 'aar') 

} 
apply plugin: 'com.google.gms.google-services' 
+0

https: // stackoverflow.com/questions/32635704/android-permission-doesnt-work-even-if-i-have-declared-it – CommonsWare

+0

Vielen Dank für Ihre Antwort, aber meine gezielte SDK ist 22 nicht 23 – user2297374

+0

Auf welcher Android-Version laufen Sie/Testen Sie Ihre App? –

Antwort

0

Ich denke, brauchen Fyber.init();

Fyber sdk ist offenbar die Erlaubnis ändern

0

Sie können versuchen, apk-Datei von Android Studio zu analysieren. Überprüfen Sie AndroidManifest.xml, sehen Sie, welche Verwendungen dort platziert sind.

0

Sie haben Ihre Libs zu überprüfen, gibt es eine lib Ihre Erlaubnis blockiert, so sollten Sie die Erlaubnis, mit Gewalt zu "Tools: replace =" maxSdkVersion“android: maxSdkVersion = "27"

Verwandte Themen