Hi,
I have a problem to create a midlet with J2ME Polish using NFC.
First, I have created a blank midlet with J2ME Polish => no problem.
Now, I want to use the NFC lib. So I have included the lib in the source code :
I have imported the JAR in the project, so there is no error reported in the IDE.Code:import javax.microedition.contactless.ContactlessException; import javax.microedition.contactless.TargetListener; import javax.microedition.contactless.TargetProperties ; import javax.microedition.contactless.DiscoveryManager; import javax.microedition.contactless.TargetType ; import javax.microedition.contactless.ndef.NDEFMessage ; import javax.microedition.contactless.ndef.NDEFRecordListener; import javax.microedition.contactless.ndef.NDEFTagConnection; import javax.microedition.contactless.ndef.NDEFRecordType ; import javax.microedition.contactless.ndef.NDEFRecord ;
But precompilation of J2ME Polish doesn't work :
I read this thread (http://discussion.forum.nokia.com/fo...d.php?t=132438) and I try several solutions.[j2mepolish-javac-Generic/AnyPhone] Compiling 1 source file to C:\Projects\Polish2\blank\build\real\Generic\AnyPhone\en_US\classes
[javac] C:\Projects\Polish2\blank\source\src\de\enough\polish\sample\test\TestMidlet.java:11: package javax.microedition.contactless does not exist
[javac] import javax.microedition.contactless.ContactlessException;
1. Add the NFC JAR folder in the build.xml file
Error :<build
symbols="ExampleSymbol, AnotherExample"
fullscreen="menu"
usePolishGui="true"
workDir="${dir.work}"
destDir="${dir.dist}"
binaryLibraries="lib"
>
2. Add the JAR one by one in the build.xml file.[j2mepolish] preverifying for device [Generic/AnyPhone].
[j2mepolish] preverify:Error preverifying class cd
[j2mepolish] preverify: java/lang/ClassFormatException: cd
[j2mepolish] Preverify call failed: 1
Error :<build
symbols="ExampleSymbol, AnotherExample"
fullscreen="menu"
usePolishGui="true"
workDir="${dir.work}"
destDir="${dir.dist}"
binaryLibraries="C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/3dapi.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/amms.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/cldc10.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/cldc11.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/jsr75.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/jsr82.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/jsr172.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/jsr211.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/jsr257.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/jsr257extensions.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/midp20.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/mmapi12.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/nokiaui.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/satsa-apdu.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/satsa-crypto.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/svg.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/wma11.jar;C:/Projects/Mobile3/S40_Nokia_6212_NFC_SDK/lib/wma20.jar"
>
3. Add the JAR in the apis.xml file[j2mepolish] proguard: ProGuard, version 4.1
[j2mepolish] proguard: Warning: javax.microedition.lcdui.Alert: can't find referenced method 'boolean isRotator()' in class com.nokia.mid.impl.isa.ui.style.UIStyle
[j2mepolish] proguard: Warning: javax.microedition.lcdui.Displayable: can't find referenced method 'void hideIndex()' in class com.nokia.mid.impl.isa.ui.style.UIStyle
[j2mepolish] proguard: Warning: javax.microedition.lcdui.SoftkeyManager: can't find referenced method 'boolean isRotator()' in class com.nokia.mid.impl.isa.ui.style.UIStyle
[j2mepolish] proguard: Warning: com.sun.cldc.util.j2me.TimeZoneImpl: can't find referenced method 'long getDaylightSavingOffsetInMillis()' in class javax.microedition.io.PushRegistry
[j2mepolish] proguard: Warning: javax.microedition.lcdui.CustomItem: can't find referenced method 'boolean isRotator()' in class com.nokia.mid.impl.isa.ui.style.UIStyle
[j2mepolish] proguard: Warning: javax.microedition.lcdui.TextEditor: can't find referenced method 'void setIndex(int)' in class com.nokia.mid.impl.isa.ui.style.UIStyle
[j2mepolish] proguard: Warning: javax.microedition.lcdui.TextEditor: can't find referenced method 'void hideIndex()' in class com.nokia.mid.impl.isa.ui.style.UIStyle
[j2mepolish] proguard: Warning: javax.microedition.lcdui.Form: can't find referenced method 'void hideIndex()' in class com.nokia.mid.impl.isa.ui.style.UIStyle
[j2mepolish] proguard: Warning: javax.microedition.lcdui.List: can't find referenced method 'void hideIndex()' in class com.nokia.mid.impl.isa.ui.style.UIStyle
[j2mepolish] proguard: Warning: javax.microedition.lcdui.List: can't find referenced method 'void setIndex(int)' in class com.nokia.mid.impl.isa.ui.style.UIStyle
[j2mepolish] proguard: Warning: there were 10 unresolved references to program class members.
[j2mepolish] proguard: Your input classes appear to be inconsistent.
[j2mepolish] proguard: You may need to recompile them and try again.
[j2mepolish] proguard: Alternatively, you may have to specify the options
[j2mepolish] proguard: '-dontskipnonpubliclibraryclasses' and/or
[j2mepolish] proguard: '-dontskipnonpubliclibraryclassmembers'.
[j2mepolish] proguard: Error: Please correct the above warnings first.
Error : package ... does not exist<api>
<name>NFC API</name>
<description>Enable read/write from RFID-tags
</description>
<names>nfc-api</names>
<symbol>nfc</symbol>
<files>nfc.zip</files>
<path>import/nfc.zip</path>
</api>
Any idea ?

Reply With Quote

