Codename one builds failing

问题描述:

我想将我的lwuit应用程序移植到codenameoneCodename one builds failing

我在应用程序中使用了json包。 (org.json.me)。这个包实际上是json jar的一部分,包含了处理json文件的类。

当我使用LWUIT构建J2ME时,应用程序正常工作。

在codename one模拟器中,应用程序也没有任何问题。

当我尝试通过右键单击该项目并选择“发送J2ME构建”将J2ME构建发送到服务器时,我的应用程序的构建过程崩溃并带有一些警告。

Executing: javac -source 1.2 -target 1.2 -classpath C:\Users\Shai\AppData\Local\Temp\build925171746515355215xxx\tmpclasses;C:\Users\Shai\Desktop\j2me\midpapis.jar -d C:\Users\Shai\AppData\Local\Temp\build925171746515355215xxx\tmpclasses C:\Users\Shai\AppData\Local\Temp\build925171746515355215xxx\tmpsrc\GREStub.java Executing: java -jar C:\Users\Shai\Desktop\j2me\proguard.jar -injars . -libraryjars C:\Users\Shai\Desktop\j2me\midpapis.jar -outjars C:\Users\Shai\AppData\Local\Temp\build925171746515355215xxx\result\GRE.jar -target 1.3 -keep public class ** extends javax.microedition.midlet.MIDlet { public *; } -defaultpackage '' -printmapping C:\Users\Shai\AppData\Local\Temp\build925171746515355215xxx\result\obfuscation_mapping.txt -overloadaggressively -dontusemixedcaseclassnames -useuniqueclassmembernames -dontoptimize ProGuard, version 4.7 
Reading program directory [C:\Users\Shai\AppData\Local\Temp\build925171746515355215xxx\tmpclasses] 
Reading library jar [C:\Users\Shai\Desktop\j2me\midpapis.jar] 
Warning: com.mycompany.myapp.GRE: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.GRE: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.GRE: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.GRE: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.GRE: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.GRE$8: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.GRE$8: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal: can't find referenced class org.json.me.JSONException 
Warning: com.mycompany.myapp.Verbal: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal$4: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal$4: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal$4: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal$4: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal$8: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal$8: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal$9: can't find referenced class org.json.me.JSONObject 
Warning: com.mycompany.myapp.Verbal$9: can't find referenced class org.json.me.JSONObject 
Note: com.codename1.impl.midp.GameCanvasImplementation: can't find dynamically referenced class com.siemens.mp.game.Light 
Note: com.codename1.impl.midp.GameCanvasImplementation: can't find dynamically referenced class com.motorola.phonebook.PhoneBookRecord 
Note: com.codename1.impl.midp.GameCanvasImplementation: can't find dynamically referenced class com.nokia.mid.ui.FullCanvas 
Note: com.codename1.impl.midp.GameCanvasImplementation: can't find dynamically referenced class net.rim.device.api.system.Application 
Note: com.codename1.impl.midp.GameCanvasImplementation: can't find dynamically referenced class com.mot.iden.util.Base64 
Note: com.codename1.impl.midp.GameCanvasImplementation: can't find dynamically referenced class mmpp.media.MediaPlayer 
Note: there were 6 unresolved dynamic references to classes or interfaces. 
     You should check if you need to specify additional program jars. 
Warning: there were 26 unresolved references to classes or interfaces. 
     You may need to specify additional library jars (using '-libraryjars'). 
Error: Please correct the above warnings first. 

现在,我觉得服务器没有找到我的json包。但我需要这个构建才能成功。我已经在我的应用程序中使用了这个jar的类。并且现在我不想迁移到内置的json解析器,因为我不得不更改我的代码,我希望严格避免。

1)我能做些什么来解决这个问题?

2)我们不能在代号1中使用第三方罐子吗?

您不能在Codename One中更改库类路径。为了正常工作,一切都必须是源目录的一部分。

Codename One有它自己的JSON解析器,请在Codename One开发人员指南中阅读它。