当前位置: 首页 > 知识库问答 >
问题:

代号一失败

麹渊
2023-03-14

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

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

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

在代号为one的emulator中,应用程序也可以正常工作。

当我试图通过右键单击项目并选择“send 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)我们可以不使用代号为one的第三方罐子吗?

共有1个答案

鄢晔
2023-03-14

无法在Codename One中更改库类路径。所有内容都必须是源目录的一部分才能正常工作。

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

 类似资料:
  • 直到昨天一切都很好,我可以构建我的UWP应用程序,并从构建服务器下载它。 从今天开始,如果不更改任何内容,我就会收到一个错误: 有人知道怎么修吗?

  • 尝试将我的 Android 应用构建到 APK 时,构建服务器出错且无法构建。但是,在模拟器中,应用程序工作正常,并且我认为错误的类是由编译器创建的(它不是应用程序内部的类之一) 下面是错误日志: -

  • 我试图将我的应用程序发送到构建服务器以构建android应用程序,但它一直失败。模拟器上一切正常,没有错误。唯一的问题是当我尝试将项目发送到构建服务器时。这是错误日志。我如何修复这个问题? 以下是我添加的构建提示:1 .JavaScript . Google maps . KEY = JavaScript _ KEY 2。IOs . afterfinishlaunching =[GMS servi

  • 每次调用请求时,我都会收到一个错误。当我用请求评论这行时。setPost(false),我从服务器得到一些响应。请解释出现此错误的原因。 线程"Thread-6"中的异常java.lang.IllegalStateException: Request方法(post/get)不能修改一个参数

  • 在无法让sqlite与我的解决方案一起工作后,我决定尝试一下存储类。我已经按照下面的说明进行了操作:https://www.codenameone.com/how-do-i----store-data-to-persistent-storageExternalization.html,并设法将我的数据放入持久存储中。现在我有以下问题: 谢谢

  • 我想知道,有了代号one,你是否可以在设备上创建一个“属性”文件来存储应用程序设置。如果不是这样,使用非云解决方案实现设置的最佳方式是什么?我猜是一个XML文件,可以存储在电话上的应用程序中?