代号一构建失败

Posted

技术标签:

【中文标题】代号一构建失败【英文标题】:Codename one builds failing 【发布时间】:2012-07-07 14:29:20 【问题描述】:

我正在尝试将我的 lwit 应用程序移植到 codenameone。

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

当我使用 LWUIT 构建 J2ME 时,该应用程序运行良好。

在代号为 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)我们不能在代号一中使用第三方 jars 吗?

【问题讨论】:

【参考方案1】:

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

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

【讨论】:

以上是关于代号一构建失败的主要内容,如果未能解决你的问题,请参考以下文章

java.net.ConnectException:无法连接到 localhost/127.0.0.1(端口 8080):连接失败:ECONNREFUSED ....(代号一个应用程序)

Mysql 8.0.11版本,安装成功,使用Navicat连接失败。

代号一构建IOS:致命错误:找不到'MapContainer.h'

Cruisecontrol.net exec 中的 Fitnesse:测试失败时不要使构建失败

jenkins构建失败的原因是啥

代号一 发送IOS应用商店构建