当前位置: 代码迷 >> J2ME >> j2mepolish的build打jar包时报错误
  详细解决方案

j2mepolish的build打jar包时报错误

热度:8010   发布时间:2013-02-25 21:33:27.0
j2mepolish的build打jar包时报异常
Buildfile: D:\workspace\EmoticonSend_SonyEri_S700\build.xml
init:
j2mepolish:
[j2mepolish] J2ME Polish 2.1.2 (2009-08-19) (GPL License)
[j2mepolish] Loading device database...
[j2mepolish] Last build was interrupted or failed, now clearing work directory...
[j2mepolish] Processing [31] devices...
[j2mepolish] building application for [Motorola/A780] (1/31):
[j2mepolish] using locale [zh_CN]...
[j2mepolish] assembling resources for device [Motorola/A780].
[j2mepolish] preprocessing for device [Motorola/A780].
[j2mepolish] processing locale code... 
[j2mepolish] Warning: unable to resolve path to API "telephony-api". When this leads to problems, please register this API in [apis.xml].
[j2mepolish] compiling for device [Motorola/A780].
[j2mepolish-javac-Motorola/A780] Compiling 148 source files to D:\workspace\EmoticonSend_SonyEri_S700\build\real\Motorola\A780\zh_CN\classes
[j2mepolish] obfuscating for device [Motorola/A780].
[j2mepolish] proguard: ProGuard, version 4.4
[j2mepolish] proguard: Preparing output jar [D:\workspace\EmoticonSend_SonyEri_S700\build\real\dest.jar]
[j2mepolish] Skipping second preverification phase.
[j2mepolish] java.lang.StringIndexOutOfBoundsException: String index out of range: 70
[j2mepolish] at java.lang.String.substring(String.java:1934)
[j2mepolish] at de.enough.polish.ant.build.Manifest.write(Manifest.java:94)
[j2mepolish] at de.enough.polish.ant.build.Manifest.write(Manifest.java:78)
[j2mepolish] at de.enough.polish.manifest.DefaultManifestCreator.createManifest(DefaultManifestCreator.java:66)
[j2mepolish] at de.enough.polish.manifest.ManifestCreator.execute(ManifestCreator.java:82)
[j2mepolish] at de.enough.polish.ExtensionManager.executeTemporaryExtension(ExtensionManager.java:400)
[j2mepolish] at de.enough.polish.ExtensionManager.executeTemporaryExtension(ExtensionManager.java:379)
[j2mepolish] at de.enough.polish.ant.PolishTask.jar(PolishTask.java:2993)
[j2mepolish] at de.enough.polish.ant.PolishTask.execute(PolishTask.java:644)
[j2mepolish] at de.enough.polish.ant.PolishTask.execute(PolishTask.java:442)
[j2mepolish] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[j2mepolish] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[j2mepolish] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[j2mepolish] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[j2mepolish] at java.lang.reflect.Method.invoke(Method.java:597)
[j2mepolish] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[j2mepolish] at org.apache.tools.ant.Task.perform(Task.java:348)
[j2mepolish] at org.apache.tools.ant.Target.execute(Target.java:357)
[j2mepolish] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[j2mepolish] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[j2mepolish] at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[j2mepolish] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[j2mepolish] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[j2mepolish] at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[j2mepolish] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[j2mepolish] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

BUILD FAILED
D:\workspace\EmoticonSend_SonyEri_S700\build.xml:84: Unable to execute extension [default]: java.lang.StringIndexOutOfBoundsException: String index out of range: 70

Total time: 11 seconds

这是控制台打印出来的异常信息,我用模拟器运行没错,用wtk打包也没错,在真机赏也能运行,可就是用build打包时出了这个异常,我找了好久,把subString()方法从程序里全部注释掉再次打包还是一样的异常,现在请求帮助!
  相关解决方案