代号一个构建失败

时间:2012-07-07 14:29:20

标签: lwuit codenameone

我正在尝试将我的lwuit应用移植到codenameone

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

当我以前用LWUIT制作J2ME版本时,应用程序运行正常。

在代号为one的模拟器中,应用程序正常运行。

当我尝试通过右键单击项目并选择“发送J2ME Build”将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使用第三方罐子吗?

1 个答案:

答案 0 :(得分:2)

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

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

相关问题