https://github.com/appcelerator-developer-relations/appc-sample-geocoder 上的示例應用程序由於缺少權限而在首次啓動時崩潰。我無法弄清楚如何防止這種行爲。有任何想法嗎?在授予權限後,後續的啓動都可以。Android 6.0.0上的ti.map權限
[ERROR] TiApplication: (main) [704,705] Sending event: exception on thread: main msg:java.lang.SecurityException: my location requires permission ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION; Titanium 6.0.0,2016/11/13 01:23,undefined
[ERROR] TiApplication: java.lang.SecurityException: my location requires permission ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION
[ERROR] TiApplication: at maps.ad.t.c(Unknown Source)
[ERROR] TiApplication: at xj.onTransact(:com.google.android.gms.DynamiteModulesB:274)
[ERROR] TiApplication: at android.os.Binder.transact(Binder.java:387)
[ERROR] TiApplication: at com.google.android.gms.maps.internal.IGoogleMapDelegate$zza$zza.setMyLocationEnabled(Unknown Source)
[ERROR] TiApplication: at com.google.android.gms.maps.GoogleMap.setMyLocationEnabled(Unknown Source)
[ERROR] TiApplication: at ti.map.TiUIMapView.setUserLocationEnabled(TiUIMapView.java:281)
[ERROR] TiApplication: at ti.map.TiUIMapView.processMapProperties(TiUIMapView.java:190)
[ERROR] TiApplication: at ti.map.TiUIMapView.onMapReady(TiUIMapView.java:162)
[ERROR] TiApplication: at com.google.android.gms.maps.SupportMapFragment$zza$1.zza(Unknown Source)
[ERROR] TiApplication: at com.google.android.gms.maps.internal.zzt$zza.onTransact(Unknown Source)
[ERROR] TiApplication: at android.os.Binder.transact(Binder.java:387)
[ERROR] TiApplication: at zu.a(:com.google.android.gms.DynamiteModulesB:82)
[ERROR] TiApplication: at maps.ad.t$5.run(Unknown Source)
[ERROR] TiApplication: at android.os.Handler.handleCallback(Handler.java:739)
[ERROR] TiApplication: at android.os.Handler.dispatchMessage(Handler.java:95)
[ERROR] TiApplication: at android.os.Looper.loop(Looper.java:158)
[ERROR] TiApplication: at android.app.ActivityThread.main(ActivityThread.java:7231)
[ERROR] TiApplication: at java.lang.reflect.Method.invoke(Native Method)
[ERROR] TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
[ERROR] TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
[ERROR] AndroidRuntime: FATAL EXCEPTION: main
所得AndroidManifest.xml含有權限[UPDATE]:
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.appcelerator.sample.mapping" android:versionCode="1" android:versionName="2.0.0">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
<application android:icon="@drawable/appicon" android:label="Geocoder" android:name="GeocoderApplication" android:debuggable="false" android:theme="@style/appcelerator">
<activity android:name=".GeocoderActivity" android:label="@string/app_name" android:theme="@style/Theme.Titanium" android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="org.appcelerator.titanium.TiActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="org.appcelerator.titanium.TiTranslucentActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@style/Theme.AppCompat.Translucent"/>
<activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity" android:configChanges="screenSize"/>
<service android:name="com.appcelerator.aps.APSAnalyticsService" android:exported="false"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyBDuTWLdPRaKN2eTTQKVc-QDNdCS6RxzPM"/>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
</application>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<permission android:name="com.appcelerator.sample.mapping.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="com.appcelerator.sample.mapping.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/>
</manifest>
鈦6.0.0.GA,機器人版上的設備:6.0.1
謝謝,請參閱原文中的編輯。清單包含生成後的權限 – paddel10
請發佈您的Mainfiest文件 –
您正在Google Map上工作嗎? –