2016-02-29 43 views
-3


我創建了一個應用程序,在Android棉花糖崩潰時,在版本下我的應用程序正常工作。
這怎麼可能? 這是我的清單代碼:我的應用程序崩潰在Android 6.0上

<?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

請給我看你的日誌,以便我可以幫忙。 –

+4

你也問過運行時的位置權限嗎? –

+1

這是marshmellow中的權限問題。您必須在運行系統中分配權限。 – 2016-02-29 11:42:54

回答

1

這可能是因爲Android M How to ask permission runtime的功能或者用於檢查權限問題,您可以從設置 - >應用程序 - >在Android M設備中配置應用程序手動指定。