Java 此处SDK:无法初始化映射片段:不允许操作
我收到这个错误,地图没有出现(只是一个空白屏幕),即使我添加了我的应用程序ID+应用程序代码+许可证密钥, 我使用的是Mobile SDK premium(试用版),我遵循了这一点 这是我的密码 Android Manifest.xmlJava 此处SDK:无法初始化映射片段:不允许操作,java,android-studio,here-api,Java,Android Studio,Here Api,我收到这个错误,地图没有出现(只是一个空白屏幕),即使我添加了我的应用程序ID+应用程序代码+许可证密钥, 我使用的是Mobile SDK premium(试用版),我遵循了这一点 这是我的密码 Android Manifest.xml <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permissio
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:hardwareAccelerated="true"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:name=".BasicMapActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.here.android.maps.appid"
android:value="{app id}"/>
<meta-data android:name="com.here.android.maps.apptoken"
android:value="{app code}"/>
<meta-data android:name="com.here.android.maps.license.key"
android:value="{License key}"/>
<service
android:name="com.here.android.mpa.service.MapService"
android:label="HereMapService"
android:process="global.Here.Map.Service.v2"
android:exported="true" >
<intent-filter>
<action android:name="com.here.android.mpa.service.MapService" >
</action>
</intent-filter>
</service>
</application>
活动\u basic\u map.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hello_world"
tools:context=".BasicMapActivity" />
<!-- Map Fragment embedded with the map object -->
<fragment
class="com.here.android.mpa.mapping.MapFragment"
android:id="@+id/mapfragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
在清单文件中,尝试将服务标记从应用程序标记中移出。
我希望它能解决您的问题在清单文件中,尝试将服务标记从应用程序标记中删除。
我希望它能解决您的问题是否可能重复?请尝试我在那里添加的答案。谢谢。我的TargetSdkVersion是22@marco。你的应用程序名称空间与你在developer.here.com上注册的名称空间相同吗?许可证密钥对appid/令牌和app名称空间进行编码,它们必须匹配。还要检查凭证中的尾随空格和前导空格。我刚知道问题出在许可证密钥上,我把它放在了{}内,谢谢@marcome的副本?请尝试我在那里添加的答案。谢谢。我的TargetSdkVersion是22@marco。你的应用程序名称空间与你在developer.here.com上注册的名称空间相同吗?许可证密钥对appid/令牌和app名称空间进行编码,它们必须匹配。还要检查凭证中的尾随空格和前导空格。我刚知道问题出在许可证密钥上,我把它放在了{}里面,谢谢@Marco
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hello_world"
tools:context=".BasicMapActivity" />
<!-- Map Fragment embedded with the map object -->
<fragment
class="com.here.android.mpa.mapping.MapFragment"
android:id="@+id/mapfragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>