Сбой моего приложения на Android 6.0


Я создал приложение, которое в Android-зефире вылетает, в то время как в версии ниже мое приложение работает корректно.
Как это возможно? Это мой манифест код:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="theasynchronous.unisamap"
    android:versionCode="6"
    android:versionName="1.2">

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="23"/>

    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"
        android:anyDensity="true"/>


    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">


        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="AIzaSyC4vg7tuiI73My4mhQ9SNdVAv_7inWGs60" />

        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_maps"
            android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <activity
            android:name=".MapsActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait">
        </activity>
    </application>

</manifest>

И это код Gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "unisamap"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 6
        versionName "1.2"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.google.android.gms:play-services:8.1.0'
}

Я прочитал, что вы должны изменить что-то в коде, чтобы сделать его совместимым с зефиром Android.
Как мне решить проблему?

1 ответ

Это может быть связано с особенностью Android M. Как альтернативно узнать время выполнения разрешения для проверки выдачи разрешений, вы можете указать вручную в настройках -> Приложения -> Настроить приложения в Android M Device.

Другие вопросы по тегам