Hi,
In another post, I was trying to get MGMaps working with the MJT. In this post, I am attempting to use the library with the Blackberry JDE 4.2.1. I perform all of the steps as mentioned in RIM_Library_0.pdf.
When I do a build, I get the following messages (sorry for the log dump):
d: Warning!: Duplicate method only differs by return type: a
ag: Warning!: Duplicate method only differs by return type: a
ag: Warning!: Duplicate method only differs by return type: a
com.mgmaps.utils.Queue: Warning!: Duplicate method only differs by return type: a
com.mgmaps.utils.Queue: Warning!: Duplicate method only differs by return type: a
com.nutiteq.BasicMapComponent: Warning!: Duplicate method only differs by return type: a
com.nutiteq.BasicMapComponent: Warning!: Duplicate method only differs by return type: a
com.nutiteq.BasicMapComponent: Warning!: Duplicate method only differs by return type: g
com.nutiteq.BasicMapComponent: Warning!: Duplicate method only differs by return type: a
com.nutiteq.BasicMapComponent: Warning!: Duplicate method only differs by return type: a
com.nutiteq.BasicMapComponent: Warning!: Duplicate method only differs by return type: b
com.nutiteq.BasicMapComponent: Warning!: Duplicate method only differs by return type: c
com.nutiteq.BasicMapComponent: Warning!: Duplicate method only differs by return type: d
com.nutiteq.BasicMapComponent: Warning!: Duplicate method only differs by return type: e
com.nutiteq.BasicMapComponent: Warning!: Duplicate method only differs by return type: f
com.nutiteq.cache.RmsCache: Warning!: Duplicate method only differs by return type: a
com.nutiteq.cache.RmsCache: Warning!: Duplicate method only differs by return type: b
com.nutiteq.components.MapTile: Warning!: Duplicate method only differs by return type: a
com.nutiteq.components.Place: Warning!: Duplicate method only differs by return type: a
n: Warning!: Duplicate method only differs by return type: a
ah: Warning!: Duplicate method only differs by return type: a
ah: Warning!: Duplicate method only differs by return type: a
ah: Warning!: Duplicate method only differs by return type: a
ah: Warning!: Duplicate method only differs by return type: a
ah: Warning!: Duplicate method only differs by return type: a
ah: Warning!: Duplicate method only differs by return type: a
i: Warning!: Duplicate method only differs by return type: a
c: Warning!: Duplicate method only differs by return type: a
ad: Warning!: Duplicate method only differs by return type: a
ab: Warning!: Duplicate method only differs by return type: a
ab: Warning!: Duplicate method only differs by return type: a
ab: Warning!: Duplicate method only differs by return type: a
ab: Warning!: Duplicate method only differs by return type: a
ab: Warning!: Duplicate method only differs by return type: a
ab: Warning!: Duplicate method only differs by return type: a
ab: Warning!: Duplicate method only differs by return type: a
k: Warning!: Duplicate method only differs by return type: a
k: Warning!: Duplicate method only differs by return type: a
k: Warning!: Duplicate method only differs by return type: a
com.nutiteq.ui.NutiteqDownloadDisplay: Warning!: Duplicate method only differs by return type: a
com.nutiteq.ui.NutiteqDownloadDisplay: Warning!: Duplicate method only differs by return type: a
org.kxml2.io.KXmlParser: Warning!: Duplicate method only differs by return type: a
org.kxml2.io.KXmlParser: Warning!: Duplicate method only differs by return type: a
org.kxml2.io.KXmlParser: Warning!: Duplicate method only differs by return type: a
org.kxml2.io.KXmlParser: Warning!: Duplicate method only differs by return type: a
org.kxml2.io.KXmlParser: Warning!: Duplicate method only differs by return type: b
org.kxml2.io.KXmlParser: Warning!: Duplicate method only differs by return type: b
org.kxml2.io.KXmlParser: Warning!: Duplicate method only differs by return type: a
u: Warning!: Duplicate method only differs by return type: a
u: Warning!: Duplicate method only differs by return type: a
u: Warning!: Duplicate method only differs by return type: a
com.motorola.io.FileConnection: Warning!: No definition found
com.motorola.io.file.FileConnection: Warning!: No definition found
com.nutiteq.utils.fs.IDENFileSystem: Warning!: Reference to undefined class: com.motorola.io.file.FileConnection
com.motorola.io.FileSystemRegistry: Warning!: No definition found
com.nutiteq.utils.fs.MotoFileSystem: Warning!: Reference to undefined class: com.motorola.io.FileSystemRegistry
com.nutiteq.utils.fs.MotoFileSystem: Warning!: Reference to undefined class: com.motorola.io.FileConnection
C:\programs\opensource\MGMaps\maps_lib-0.10.0.jar(y.class): Warning!: verification failed at opcode offset: 17 cause: incompatible types in control flow merge in
C:\programs\opensource\MGMaps\maps_lib-0.10.0.jar(com/nutiteq/components/Place.class): Warning!: verification failed at opcode offset: 10 cause: incompatible types in control flow merge in
C:\programs\opensource\MGMaps\maps_lib-0.10.0.jar(com/nutiteq/maps/CloudMade.class): Warning!: verification failed at opcode offset: 16 cause: incompatible types in control flow merge in
C:\programs\opensource\MGMaps\maps_lib-0.10.0.jar(com/nutiteq/utils/fs/IDENFileSystem.class): Warning!: verification failed at opcode offset: 13 cause: found FileConnection where InputConnection is required invoking com.nutiteq.utils.fs.MidpFileSystemConnection.(InputConnection) in openConnectionToFile
C:\programs\opensource\MGMaps\maps_lib-0.10.0.jar(com/nutiteq/utils/fs/MotoFileSystem.class): Warning!: verification failed at opcode offset: 13 cause: found FileConnection where InputConnection is required invoking com.nutiteq.utils.fs.MidpFileSystemConnection.(InputConnection) in openConnectionToFile
So, I build anyway and in the Blackberry simulator, I get this error when I try to execute my program:
Module 'MGMaps' has verification error 1837 at offset 1b56
MGMaps is the name of the library with the jar file in it.
Thank you for any assistance.
Regards,
Eric
Hi Jaak,
I am also still trying to get the j2me version of this working to compare which version we would like to use. I have done as you suggested and tried compiling using the rimui...jar. However, when I do that, I get a compile error because it says that com.nutiteq.MapItem is not available.
Am I supposed to use a MapComponent even if I am building it as a Midlet when using it on the Blackberry?
Please note that this is different than some of my other questions where I was using the RIM version with a UIApplication. In this case, I am trying to build it as a MIDlet for the BB.
Thanks,
Eric
You are right, there is this limitation. We will build special RIM MIDlet library JAR for the next version update.
Current workaround would be to use the library source. For BB it needs some manual changes: removal of non-RIM classes (mainly file systems). See http://www.nutiteq.com/content/using-source-code-blackberry#comment-54 about it. In your case do not remove MapItem.java, and do not change references to .lcdui to rimui.
Let me know it this works.
Hi Jaak,
Do you have any documentation on which libraries to include in the classpath to compile from source? I grabbed many of the latest versions of the other packages that I could find, but I am getting compilation errors. Do you have a list of jars and their version? Or, some other type of documentation for building from source?
Below are the compilation errors that I am currently receiving. (sorry for the long post)
Thanks,
Eric
Description Resource Path Location Type
FileConnection cannot be resolved to a type IDENFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 69 Java Problem
FileConnection cannot be resolved to a type IDENFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 71 Java Problem
FileConnection cannot be resolved to a type IDENFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 108 Java Problem
FileConnection cannot be resolved to a type IDENFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 111 Java Problem
FileConnection cannot be resolved to a type IDENFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 139 Java Problem
FileConnection cannot be resolved to a type MotoFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 73 Java Problem
FileConnection cannot be resolved to a type MotoFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 75 Java Problem
FileConnection cannot be resolved to a type MotoFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 113 Java Problem
FileConnection cannot be resolved to a type MotoFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 116 Java Problem
FileConnection cannot be resolved to a type MotoFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 144 Java Problem
FileSystemRegistry cannot be resolved MotoFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 34 Java Problem
The import com.motorola cannot be resolved IDENFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 13 Java Problem
The import com.motorola cannot be resolved MotoFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 12 Java Problem
The import com.motorola cannot be resolved MotoFileSystem.java MGMaps Source/src/com/nutiteq/utils/fs line 13 Java Problem
The method createImage(byte[], int, int) in the type Image is not applicable for the arguments (Image, int, int, int, int, int) OnScreenZoomControls.java MGMaps Source/src/com/nutiteq/controls line 48 Java Problem
The method deleteAll() is undefined for the type BluetoothGpsBrowser BluetoothGpsBrowser.java MGMaps Source/src/com/nutiteq/helpers line 92 Java Problem
The method deleteAll() is undefined for the type List FileBrowser.java MGMaps Source/src/com/nutiteq/utils/fs line 95 Java Problem
The method drawRGB(int[], int, int, int, int, int, int, boolean) is undefined for the type Graphics Tools.java MGMaps Source/src/com/mgmaps/utils line 407 Java Problem
The method drawRGB(int[], int, int, int, int, int, int, boolean) is undefined for the type Graphics Tools.java MGMaps Source/src/com/mgmaps/utils line 454 Java Problem
The method fillTriangle(int, int, int, int, int, int) is undefined for the type Graphics Line.java MGMaps Source/src/com/nutiteq/components line 137 Java Problem
The method fillTriangle(int, int, int, int, int, int) is undefined for the type Graphics Line.java MGMaps Source/src/com/nutiteq/components line 138 Java Problem
The method getRGB(int[], int, int, int, int, int, int) is undefined for the type Image Tools.java MGMaps Source/src/com/mgmaps/utils line 402 Java Problem
The method getRGB(int[], int, int, int, int, int, int) is undefined for the type Image Tools.java MGMaps Source/src/com/mgmaps/utils line 450 Java Problem
The method hashPolygon(Graphics, int[], int[], int, int, int, Rectangle) is undefined for the type PolygonGraphics Polygon.java MGMaps Source/src/com/nutiteq/components line 87 Java Problem
The method setSelectCommand(Command) is undefined for the type BluetoothGpsBrowser BluetoothGpsBrowser.java MGMaps Source/src/com/nutiteq/helpers line 109 Java Problem
The method setSelectCommand(Command) is undefined for the type List FileBrowser.java MGMaps Source/src/com/nutiteq/utils/fs line 45 Java Problem
The method toDegrees(double) is undefined for the type Float11 EPSG3395.java MGMaps Source/src/com/nutiteq/maps/projections line 44 Java Problem
The method toDegrees(double) is undefined for the type Float11 EPSG3785.java MGMaps Source/src/com/nutiteq/maps/projections line 32 Java Problem
The method toRadians(double) is undefined for the type Float11 EPSG3395.java MGMaps Source/src/com/nutiteq/maps/projections line 70 Java Problem
The method toRadians(double) is undefined for the type Float11 EPSG3785.java MGMaps Source/src/com/nutiteq/maps/projections line 58 Java Problem
This class must implement the inherited abstract method Item.getHeight(), but cannot override it since it is not visible from MapItem. Either make the type abstract or make the inherited method visible MapItem.java MGMaps Source/src/com/nutiteq line 35 Java Problem
This class must implement the inherited abstract method Item.paint(Graphics), but cannot override it since it is not visible from MapItem. Either make the type abstract or make the inherited method visible MapItem.java MGMaps Source/src/com/nutiteq line 35 Java Problem
This class must implement the inherited abstract method Item.setWidth(int), but cannot override it since it is not visible from MapItem. Either make the type abstract or make the inherited method visible MapItem.java MGMaps Source/src/com/nutiteq line 35 Java Problem
Unhandled exception type IOException KmlReader.java MGMaps Source/src/com/nutiteq/kml line 93 Java Problem
There are actually no extra libraries needed besides the standard MIDP 2.0 and CLDC 1.1 libraries. All the other is in the source. From the errors I see that you should have removed following classes:
/com/nutiteq/helpers/BluetoothGpsBrowser.java
/com/nutiteq/utils/fs/FileBrowser.java
/com/nutiteq/utils/fs/FileBrowserListener.java
/com/nutiteq/utils/fs/IDENFileSystem.java
/com/nutiteq/utils/fs/MotoFileSystem.java
/com/nutiteq/utils/fs/SiemensFileSystem.java
This is the first thing to do. Of course this means that you also cannot use the classes in the case of RIM MIDlet.
Also make sure that source path includes also the third party sources which are included with library (thirdparty/src directory). Eg. Float11 is from there.
The recently released new lib version has separate zip package for Blackberry. You'll find two jar files from that: one for "rimui" (CLDC apps using UIApplication) and another one for the midlets in Blackberry.
These are the results from Building the example off the web in J2MEPolish for Blackberry 4.7
It dosen't work.
Buildfile: build.xml
clean:
[delete] Deleting directory E:\J2ME-P~1.2\samples\NEWNUT~1\build
test:
init:
j2mepolish:
[j2mepolish] J2ME Polish 2.1.2 (2009-08-19) (GPL License)
[j2mepolish] Loading device database...
[j2mepolish] using locale [en_US]...
[j2mepolish] assembling resources for device [BlackBerry/4.7].
[j2mepolish] preprocessing for device [BlackBerry/4.7].
[j2mepolish] processing locale code...
[j2mepolish] preparing binary libraries...
[j2mepolish] copying binary libraries to [E:\J2ME-P~1.2\samples\NEWNUT~1\build\test\BlackBerry\4.7\en_US\classes]...
[j2mepolish] Converting imports in 232 classes from E:\J2ME-P~1.2\samples\NEWNUT~1\build\test\BlackBerry\4.7\en_US\classes
[j2mepolish] Converting imports in 232 classes from E:\J2ME-P~1.2\samples\NEWNUT~1\build\test\BlackBerry\4.7\en_US\classes
[j2mepolish] Warning: unable to resolve path to API "javacard". When this leads to problems, please register this API in [apis.xml].
[j2mepolish] compiling for device [BlackBerry/4.7].
[j2mepolish-javac-BlackBerry/4.7] Compiling 450 source files to E:\J2ME-P~1.2\samples\NEWNUT~1\build\test\BlackBerry\4.7\en_US\classes
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\Screens\PlaceDetailsForm.java:21: cannot find symbol
[javac] symbol : class AccessibleCanvas
[javac] location: package de.enough.polish.ui
[javac] import de.enough.polish.ui.AccessibleCanvas;
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\Screens\MapItem.java:25: cannot find symbol
[javac] symbol : class MapTileSearchStrategy
[javac] location: package com.nutiteq.maps
[javac] import com.nutiteq.maps.MapTileSearchStrategy;
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\Screens\MapItem.java:503: cannot find symbol
[javac] symbol : class MapTileSearchStrategy
[javac] location: class com.tutorial.Screens.MapItem
[javac] public void setTileSearchStrategy(final MapTileSearchStrategy tileSearchStrategy) {
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\J2MEPolish\J2MEPolishSample.java:132: cannot find symbol
[javac] symbol : method focus(int)
[javac] location: class de.enough.polish.ui.TreeItem
[javac] placeTreeScreen.tree.focus(p.getId());
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\Screens\PlaceTreeForm.java:34: cannot find symbol
[javac] symbol : method appendToRoot(java.lang.String,com.nutiteq.wrappers.rimui.Image,de.enough.polish.ui.Style)
[javac] location: class de.enough.polish.ui.TreeItem
[javac] node=tree.appendToRoot(places[i].getName(),places[i].getIcon(), de.enough.polish.ui.StyleSheet.placeStyle );
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\Screens\PlaceTreeForm.java:47: cannot find symbol
[javac] symbol : method focus(int)
[javac] location: class de.enough.polish.ui.TreeItem
[javac] tree.focus(0);
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\data\MapData.java:66: cannot find symbol
[javac] symbol : constructor Place(int,com.nutiteq.components.PlaceLabel,de.enough.polish.blackberry.ui.Image,double,double)
[javac] location: class com.nutiteq.components.Place
[javac] places[i] = new Place(i, new PlaceLabel(PLACE_NAMES[i], 1),
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\Screens\MapItem.java:42: com.tutorial.Screens.MapItem is not abstract and does not override abstract method elementLeft(com.nutiteq.components.OnMapElement) in com.nutiteq.listeners.OnMapElementListener
[javac] public class MapItem extends CustomItem implements MapListener, PlaceListener{
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\Screens\MapItem.java:59: cannot access de.enough.polish.android.midlet.MIDlet
[javac] class file for de.enough.polish.android.midlet.MIDlet not found
[javac] mapDisplay = new MapComponent("abcdtrial", J2MEPolishSample.instance,width, height, MapData.STARTUP, 3);
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\Screens\MapItem.java:80: paint(com.nutiteq.wrappers.rimui.Graphics) in com.nutiteq.BasicMapComponent cannot be applied to (de.enough.polish.blackberry.ui.Graphics)
[javac] mapDisplay.paint(g);
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\Screens\MapItem.java:322: cannot find symbol
[javac] symbol : method showDefaultControlsOnScreen(boolean)
[javac] location: class com.nutiteq.MapComponent
[javac] mapDisplay.showDefaultControlsOnScreen(showControls);
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\Screens\MapItem.java:514: cannot find symbol
[javac] symbol : method setGpsMarker(com.nutiteq.location.LocationMarker)
[javac] location: class com.nutiteq.MapComponent
[javac] mapDisplay.setGpsMarker(marker);
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\Screens\MapItem.java:521: cannot find symbol
[javac] symbol : method removeGpsMarker()
[javac] location: class com.nutiteq.MapComponent
[javac] mapDisplay.removeGpsMarker();
[javac] ^
[javac] E:\J2ME-P~1.2\samples\NEWNUT~1\src\com\tutorial\Screens\MapItem.java:562: enqueueDownload(com.nutiteq.io.ResourceRequestor,int) in com.nutiteq.BasicMapComponent cannot be applied to (com.nutiteq.net.Downloadable,int)
[javac] mapDisplay.enqueueDownload(downloadable, cacheLevel);
[javac] ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 14 errors
[javac] When an API-class was not found, you might need to define where to find the device-APIs. Following classpath has been used: [E:\J2ME-Polish2.1.2\import\mmapi.jar;E:\J2ME-Polish2.1.2\import\cldc-1.1.jar;E:\J2ME-Polish2.1.2\import\blackberry-4.7.0.jar;E:\J2ME-Polish2.1.2\import\midp-2.0.jar;E:/J2ME-Polish2.1.2/import/wmapi.jar;E:/J2ME-Polish2.1.2/import/pim.jar;E:/J2ME-Polish2.1.2/import/jsr211.jar;E:/J2ME-Polish2.1.2/import/locationapi-1.0.jar;E:/J2ME-Polish2.1.2/import/pdaapi.jar;E:/J2ME-Polish2.1.2/import/jsr172.jar;E:/J2ME-Polish2.1.2/import/btapi.jar].
Building with J2ME Polish for BlackBerry is a bit more challenging task. Basically you can build J2ME apps using J2MEPolish using binary library, but if you need more deep transcoding (to BlackBerry native app or Android) then you need to use source package.
Currently I suggest to use the Library package which is included with J2MEPolish itself, in samples/thirdparty-nutiteq-openstreetmap. It has some tweaks, especially in the build script to work better with J2MEPolish, and it includes also needed library sources (albeit a bit older version). To build in Eclipse with it create new Run Build configuration and set target device(s).
There was one tweak needed: remove all package-info.java files, otherwise BB builder gives errors for them.
Make sure that you use RIM version of the library (rimui_maps_lib-0.10.0.jar), no the default one.
In the RIM version there are no methods mentioned in your log, as it is not obfuscated. Also make sure that you do not obfuscate (at least not with proguard) your application, as BB does not like it.
/JaakL