代号一本机地图未显示 [英] Codename one Native Map not showing

查看:38
本文介绍了代号一本机地图未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为项目使用本机地图CN1Lib。我遵循了此处的说明>,并添加了所需的构建提示。在模拟器中,地图看起来不错,但是当我将其导出到android(在android studio上调试)时,地图仅显示为灰色矩形,左下角带有 Google。

I'm using the native map CN1Lib for my project. I followed the instructions from here and added the required build hints. In simulator the map looks fine but when I export it to android (debug on android studio), the map only shows as a gray rectangle with "Google" on the left bottom.

我认为这是有关google api的问题,因此我在google控制台上创建了一些新的api密钥。所有键均不受限制。 Google Maps Android API也已启用,但问题仍然存在。我还检查了导出的apk中的AndroidManifest.xml中是否包含正确的api。

I thought it was a problem about google api so I created a few new api keys at google console. All keys were not limited. Google Maps Android API was also enabled, but the problem persists. I've also checked that in the AndroidManifest.xml in the exported apk the correct api is contained.

以下是构建提示(经过审查的api密钥的一部分):

Below are the build hints (part of api key censored):

codename1.android.keystore=
codename1.android.keystoreAlias=
codename1.android.keystorePassword=
codename1.arg.android.playService.maps=true
codename1.arg.android.xapplication=<meta-data android\:name\="com.google.android.maps.v2.API_KEY" android\:value\="AIza__________________________________"/>
codename1.arg.build.incSources=1
codename1.arg.ios.add_libs=SystemConfiguration.framework
codename1.arg.ios.afterFinishLaunching=[GMSServices provideAPIKey\:@"AIza__________________________________"];
codename1.arg.ios.locationUsageDescription=To provide near-by stores info to the user
codename1.arg.ios.newStorageLocation=true
codename1.arg.ios.objC=true
codename1.arg.java.version=8
codename1.arg.javascript.googlemaps.key=AIza__________________________________
codename1.displayName=Medi
codename1.icon=icon.png
codename1.ios.certificate=
codename1.ios.certificatePassword=
codename1.ios.provision=
codename1.j2me.nativeTheme=nativej2me.res
codename1.languageLevel=5
codename1.mainName=Medi
codename1.packageName=com.my.medi
codename1.rim.certificatePassword=
codename1.rim.signtoolCsk=
codename1.rim.signtoolDb=
codename1.secondaryTitle=Medi
codename1.vendor=CodenameOne
codename1.version=1.0
libVersion=203

我不确定现在如何进行。请指教。

I'm not sure how to proceed now. Please advice.






编辑:
Logcat输出为如下:

The Logcat output is as follows:

01-23 01:37:13.051 6001-6018/com.my.medi D/CN1 Maps: Initializing maps
01-23 01:37:13.099 6001-6001/com.my.medi I/zzy: Making Creator dynamically
01-23 01:37:13.114 6001-6001/com.my.medi I/zygote: The ClassLoaderContext is a special shared library.
01-23 01:37:13.118 6001-6001/com.my.medi I/chatty: uid=10081(com.my.medi) identical 1 line
01-23 01:37:13.122 6001-6001/com.my.medi I/zygote: The ClassLoaderContext is a special shared library.
01-23 01:37:13.260 6001-6006/com.my.medi I/zygote: Do partial code cache collection, code=114KB, data=93KB
01-23 01:37:13.263 6001-6006/com.my.medi I/zygote: After code cache collection, code=114KB, data=93KB
01-23 01:37:13.263 6001-6006/com.my.medi I/zygote: Increasing code cache capacity to 512KB
01-23 01:37:13.274 6001-6001/com.my.medi W/zygote: Unsupported class loader
01-23 01:37:13.326 6001-6001/com.my.medi W/zygote: Skipping duplicate class check due to unsupported classloader
01-23 01:37:13.412 6001-6001/com.my.medi I/Google Maps Android API: Google Play services client version: 8298000
01-23 01:37:13.429 6001-6001/com.my.medi I/Google Maps Android API: Google Play services package version: 11580470
01-23 01:37:13.551 6001-6001/com.my.medi E/Google Maps Android API: Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above
01-23 01:37:13.750 6001-6001/com.my.medi I/Google Maps Android API: Google Play services package version: 11580470
01-23 01:37:13.809 6001-6001/com.my.medi I/Choreographer: Skipped 42 frames!  The application may be doing too much work on its main thread.
01-23 01:37:13.851 6001-6001/com.my.medi I/Google Maps Android API: Google Play services package version: 11580470
01-23 01:37:13.957 6001-6018/com.my.medi I/System.out: SQL Query: SELECT * FROM AspTable WHERE (Lat BETWEEN 0.0 AND 0.0) AND (Lnt BETWEEN 0.0 AND 0.0)
01-23 01:37:14.085 6001-6018/com.my.medi I/System.out: SQL Query: SELECT * FROM AspTable WHERE (Lat BETWEEN 0.0 AND 0.0) AND (Lnt BETWEEN 0.0 AND 0.0)
01-23 01:37:14.366 6001-6071/com.my.medi D/EGL_emulation: eglCreateContext: 0x966589e0: maj 1 min 0 rcv 1
01-23 01:37:14.874 6001-6071/com.my.medi D/EGL_emulation: eglMakeCurrent: 0x966589e0: ver 1 0 (tinfo 0x96663380)
01-23 01:37:15.151 6001-6001/com.my.medi I/Choreographer: Skipped 55 frames!  The application may be doing too much work on its main thread.

                                                          [ 01-23 01:37:15.170  6001: 6064 D/         ]
                                                          HostConnection::get() New Host Connection established 0x8d2d2740, tid 6064
01-23 01:37:15.182 6001-6064/com.my.medi D/EGL_emulation: eglCreateContext: 0x8ce859e0: maj 1 min 0 rcv 1
01-23 01:37:15.492 6001-6064/com.my.medi D/EGL_emulation: eglMakeCurrent: 0x8ce859e0: ver 1 0 (tinfo 0x96663630)
01-23 01:37:15.730 6001-6059/com.my.medi W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.
01-23 01:37:15.731 6001-6059/com.my.medi W/DynamiteModule: Failed to load module via V2: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.dynamite.DynamiteModule$DynamiteLoaderClassLoader" on path: DexPathList[[zip file "/data/app/com.my.medi-Sd9oSMBfGaQ8_lajDB7WUA==/base.apk"],nativeLibraryDirectories=[/data/app/com.my.medi-Sd9oSMBfGaQ8_lajDB7WUA==/lib/x86, /system/lib, /vendor/lib]]
01-23 01:37:15.746 6001-6059/com.my.medi I/DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
01-23 01:37:15.746 6001-6059/com.my.medi I/DynamiteModule: Selected remote version of com.google.android.gms.googlecertificates, version >= 4
01-23 01:37:15.770 6001-6059/com.my.medi W/zygote: Unsupported class loader
01-23 01:37:15.817 6001-6059/com.my.medi W/zygote: Skipping duplicate class check due to unsupported classloader
01-23 01:37:16.310 6001-6066/com.my.medi W/zygote: Long monitor contention with owner androidmapsapi-ula-1 (6059) at int java.io.UnixFileSystem.getBooleanAttributes0(java.lang.String)(UnixFileSystem.java:-2) waiters=0 in boolean in.a() for 474ms
01-23 01:38:05.450 6001-6018/com.my.medi D/Codename One: native focus gain

我不确定缺失的类加载器部分是否相关。预先感谢

I'm not sure if the "missing class loader part" is related though. Thanks in advance









编辑编辑





EDIT EDIT

事实证明,这是Android Studio展示,否则除非您更新Google Play服务错误,否则该错误将不会运行,该错误使用API​​版本21(Android 5.0)解决了该问题。

As it turns out it is just another way Android studio manifest the won't run unless you update the Google Play Service bug, where using API version 21 (Android 5.0) solves the issue. Will need to do on device testing tho

推荐答案

如果本机配置与JavaScript配置不匹配或无法执行,则会出现此问题初始化。调试此问题的技巧之一是连接电缆,并使用DDMS / logcat查看输出。正常情况下,Google会打印出错误。

This problem occurs if the native configuration doesn't match the JavaScript configuration or failed to initialize. One of the tricks to debugging this is connecting a cable and using DDMS/logcat to look at the output. Google usually prints out an error when things don't work correctly.

请注意,您使用的 AIza __________________________________ 值必须是3个不同的值。一个用于本地Android应用程序,一个用于本地iOS应用程序,最后一个用于网络。

Notice that the AIza__________________________________ values you used must be 3 different values. One for a native Android app, one for a native iOS app and the last one for the web.

这篇关于代号一本机地图未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆