为什么“HereMap”在Android中显示空白屏幕?

为什么“HereMap”在Android中显示空白屏幕?,第1张

概述我按照本教程 link进行诺基亚的Here Map集成.我得到了这样的输出和错误 java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation 我的 Manifest.xml <?xml version="1.0" encoding="utf-8"?><man 我按照本教程 link进行诺基亚的Here Map集成.我得到了这样的输出和错误

java.lang.IllegalAccessError: Class ref in pre-verifIEd class resolved
to unexpected implementation

我的

Manifest.xml

<?xml version="1.0" enCoding="utf-8"?><manifest xmlns:androID="http://schemas.androID.com/apk/res/androID"    package="com.example.heremap"    androID:versionCode="1"    androID:versionname="1.0" >    <uses-sdk        androID:minSdkVersion="11"        androID:targetSdkVersion="16" /><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.INTERNET"/><uses-permission androID:name="androID.permission.ACCESS_WIFI_STATE"/>    <application        androID:allowBackup="true"        androID:icon="@drawable/ic_launcher"        androID:label="@string/app_name"        androID:theme="@style/Apptheme" ><uses-library androID:name="com.here.androID" androID:required="true" />        <activity            androID:name="com.example.heremap.MainActivity"            androID:label="@string/app_name" >            <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="XXXXXX"/><Meta-data androID:name="com.here.androID.maps.apptoken"androID:value="XXXXXX"/>    </application></manifest>

MainActivity.java

package com.example.heremap;import androID.app.Activity;import androID.os.Bundle;import com.here.androID.mapPing.FragmentinitListener;import com.here.androID.mapPing.InitError;import com.here.androID.mapPing.Map;import com.here.androID.mapPing.MapAnimation;import com.here.androID.mapPing.MapFactory;import com.here.androID.mapPing.MapFragment;public class MainActivity extends Activity {    // map embedded in the map fragment    private Map map = null;    // map fragment embedded in this activity    private MapFragment mapFragment = null;    @OverrIDe    public voID onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentVIEw(R.layout.activity_main);        // Search for the map fragment to finish setup by calling init().        mapFragment = (MapFragment) getFragmentManager().findFragmentByID(                R.ID.mapfragment);        mapFragment.init(new FragmentinitListener() {            @OverrIDe            public voID onFragmentinitializationCompleted(InitError error) {                if (error == InitError.NONE) {                    // retrIEve a reference of the map from the map fragment                    map = mapFragment.getMap();                    // Set the map center coordinate to the Vancouver region                    map.setCenter(MapFactory.createGeoCoordinate(49.196261,-123.004773,0.0),MapAnimation.NONE);                    // Set the map zoom level to the average between min and max                    // (with no animation)                    map.setZoomLevel((map.getMaxZoomLevel() +                            map.getMinZoomLevel()) / 2);                } else {                    System.out.println("ERROR: Cannot initialize Map Fragment");                }            }        });    }}

activity_main.xml

<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="@string/hello_world"        tools:context=".MainActivity" /><fragment        androID:ID="@+ID/mapfragment"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"/></linearLayout>

Error Log:

02-26 06:06:47.192: E/AndroIDRuntime(808): FATAL EXCEPTION: main 02-26 06:06:47.192: E/AndroIDRuntime(808): java.lang.IllegalAccessError: Class ref in pre-verifIEd class resolved to unexpected implementation 02-26 06:06:47.192: E/AndroIDRuntime(808):     at com.example.heremap.MainActivity.onCreate(MainActivity.java:27) 02-26 06:06:47.192: E/AndroIDRuntime(808):   at androID.app.Activity.performCreate(Activity.java:5180) 02-26 06:06:47.192: E/AndroIDRuntime(808):   at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094) 02-26 06:06:47.192: E/AndroIDRuntime(808):     at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2031) 02-26 06:06:47.192: E/AndroIDRuntime(808):     at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2092) 02-26 06:06:47.192: E/AndroIDRuntime(808):     at androID.app.ActivityThread.access0(ActivityThread.java:133) 02-26 06:06:47.192: E/AndroIDRuntime(808):   at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1203) 02-26 06:06:47.192: E/AndroIDRuntime(808):     at androID.os.Handler.dispatchMessage(Handler.java:99) 02-26 06:06:47.192: E/AndroIDRuntime(808):   at androID.os.Looper.loop(Looper.java:137) 02-26 06:06:47.192: E/AndroIDRuntime(808):     at androID.app.ActivityThread.main(ActivityThread.java:4807) 02-26 06:06:47.192: E/AndroIDRuntime(808):   at java.lang.reflect.Method.invokeNative(Native Method) 02-26 06:06:47.192: E/AndroIDRuntime(808):   at java.lang.reflect.Method.invoke(Method.java:511) 02-26 06:06:47.192: E/AndroIDRuntime(808):     at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) 02-26 06:06:47.192: E/AndroIDRuntime(808):     at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:559) 02-26 06:06:47.192: E/AndroIDRuntime(808):   at dalvik.system.NativeStart.main(Native Method)

从订单中删除jar并导出文件夹获取新错误并更新日志结果

02-26 06:34:09.810: E/Trace(1266): error opening trace file: No such
file or directory (2) 02-26 06:34:09.859: D/BYD_Flex(1266): getValue()
name = @NOKIAFLEX@packageNeedData 02-26 06:34:09.859:
D/BYD_Flex(1266): Couldn’t find file variant/cfg/flex.xml 02-26
06:34:09.870: D/BYD_Flex(1266): getValue() readFlexFromXml =
TypedValue{t=0x0/d=0x0} 02-26 06:34:09.870: D/BYD_Flex(1266):
getValue() name = @NOKIAFLEX@setDataUsageReminder 02-26 06:34:09.870:
D/BYD_Flex(1266): Couldn’t find file variant/cfg/flex.xml 02-26
06:34:09.870: D/BYD_Flex(1266): getValue() readFlexFromXml =
TypedValue{t=0x0/d=0x0} 02-26 06:34:10.249: I/Choreographer(1266):
Skipped 44 frames! The application may be doing too much work on its
main thread. 02-26 06:34:10.249: W/TextureVIEw(1266): A TextureVIEw or
a subclass can only be used with harDWare acceleration enabled. 02-26
06:34:10.459: I/Choreographer(1266): Skipped 53 frames! The
application may be doing too much work on its main thread. 02-26
06:34:11.679: I/Choreographer(1266): Skipped 314 frames! The
application may be doing too much work on its main thread. 02-26
06:34:30.191: I/Choreographer(1266): Skipped 38 frames! The
application may be doing too much work on its main thread. 02-26
06:34:32.183: I/Choreographer(1266): Skipped 34 frames! The
application may be doing too much work on its main thread. 02-26
06:35:00.068: I/Choreographer(1266): Skipped 35 frames! The
application may be doing too much work on its main thread. 02-26
06:35:11.672: I/Choreographer(1266): Skipped 56 frames! The
application may be doing too much work on its main thread.

解决方法 嗨朋友atlast我发现错误,错误是在模拟器中,你必须使用此配置创建模拟器

之后在库中添加两个jar

> com.here.androID.sdk.jar
> com.Google.androID.maps.sdk.jar

并获得这样的输出

总结

以上是内存溢出为你收集整理的为什么“HereMap”在Android中显示空白屏幕?全部内容,希望文章能够帮你解决为什么“HereMap”在Android中显示空白屏幕?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1130012.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存