gpt4 book ai didi

android - HERE Maps Android 集成,MISSING_LIBRARIES 错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:46:04 24 4
gpt4 key购买 nike

我按照步骤 https://developer.here.com/mobile-sdks/documentation/android/topics/app-simple-android-studio.html

但我收到错误消息:无法初始化 map fragment MISSING_LIBRARIES

map 初始化代码:

mapFragment.init(new OnEngineInitListener() {
@Override
public void onEngineInitializationCompleted(OnEngineInitListener.Error error) {
if (error == OnEngineInitListener.Error.NONE) {
// retrieve a reference of the map from the map fragment
map = mapFragment.getMap();
// Set the map center to the Vancouver region (no animation)
map.setCenter(new GeoCoordinate(49.196261, -123.004773, 0.0),
Map.Animation.NONE);
// Set the zoom level to the average between min and max
map.setZoomLevel(
(map.getMaxZoomLevel() + map.getMinZoomLevel()) / 2);
} else {
System.out.println("ERROR: Cannot initialize Map Fragment " + error.toString());
Toast.makeText(MainActivity.this, " Error: " + error.toString(), Toast.LENGTH_LONG).show();
}
}
});

渐变代码

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "com.chethan.mobileapp.startmap"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
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:22.2.1'
compile 'com.android.support:design:22.2.1'
compile files('libs/HERE-sdk.jar')
compile files('libs/jts-1.14.jar')
}

list 代码:

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

<uses-permission android:name="android.permission.INTERNET" />
<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.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:hardwareAccelerated="true"
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="Ksn3W" />
<meta-data android:name="com.here.android.maps.apptoken" android:value="m90-Q" />
<!--<meta-data android:name="com.here.android.maps.license.key" android:value="{J8XXfNbyt7M=}" />
-->
</application>

</manifest>

非常感谢任何建议

最佳答案

我相信您看错了文档。在这个页面上:https://developer.here.com/documentation列出了两个版本的 HERE Android Mobile SDK,适用于 Android Starter 的 SDK 和适用于 Android Premium 的 SDK。当我认为您需要 Premium 时,您正在查看 Starter 的文档。

Premium SDK 有一个本地库组件,需要包含在构建中。试试这个页面:https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics/app-simple-android-studio.html (“将 HERE SDK 库添加到您的项目”部分)

具体来说,我相信这些是您错过的部分:

  • From the directory where you installed the HERE SDK, copy the contents of the HERE-sdk/libs/armeabi-v7a folder to your project's app/src/main/jniLibs/armeabi folder. You need to create the jniLibs and armeabi subfolders.

  • Within the same section in your AndroidManifest.xml file, add the following lines:

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

更新

从 HERE SDK 版本 3.3 开始,SDK 作为 Android 存档 (AAR) 文件提供。因此,您不再需要像上面第一个项目符号中提到的那样手动复制 native 库。您只需将 AAR 文件包含在您的build.gradle 文件。例如:

// Assuming you have placed the HERE-sdk.aar in a folder 'libs'
repositories {
flatDir {
dirs 'libs'
}
}

dependencies {
...
compile(name: 'HERE-sdk', ext: 'aar')
...
}

关于android - HERE Maps Android 集成,MISSING_LIBRARIES 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35218242/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com