Android Question Unable to create service problem

NeoTechni

Well-Known Member
Licensed User
Longtime User
My program is too big to run in debug mode anymore
I haven't touched this service in a long time, so I don't know what's going on.
The only thing I've done that I can think of that might affect anything is hide some modules

java.lang.RuntimeException: Unable to create service com.omnicorp.lcarui.test.widgets: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2568)
at android.app.ActivityThread.access$1800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.omnicorp.lcarui.test.widgets.onCreate(widgets.java:33)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2558)
... 10 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.omnicorp.lcarui.test.widgets.onCreate(widgets.java:31)
... 11 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at com.omnicorp.lcarui.test.main.initializeProcessGlobals(main.java:4221)
... 14 more
Caused by: java.lang.NullPointerException
at com.omnicorp.lcarui.test.lcarseffects._process_globals(lcarseffects.java:3509)
at com.omnicorp.lcarui.test.main.initializeProcessGlobals(main.java:4200)
... 14 more
OUT OF RANGE: (false) [IsInitialized=true, ItemID=-1, Page=0
, X=0, X2=0, Y=1
, Y2=0]
** Activity (main) Pause, UserClosed = false **
Activity_Paused at: 1414401551700
** Activity (apps) Create, isFirst = true **
STARTING ACT C
ENDING ACT C
** Activity (apps) Resume **
** Activity (apps) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
Activity_Paused at: 1414401554815
java.lang.RuntimeException: Unable to create service com.omnicorp.lcarui.test.widgets: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2568)
at android.app.ActivityThread.access$1800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)


at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.omnicorp.lcarui.test.widgets.onCreate(widgets.java:33)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2558)
... 10 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.omnicorp.lcarui.test.widgets.onCreate(widgets.java:31)
... 11 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at com.omnicorp.lcarui.test.main.initializeProcessGlobals(main.java:4221)
... 14 more
Caused by: java.lang.NullPointerException
at com.omnicorp.lcarui.test.lcarseffects._process_globals(lcarseffects.java:3509)
at com.omnicorp.lcarui.test.main.initializeProcessGlobals(main.java:4200)
... 14 more
** Activity (main) Resume **
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
rapid debug mode:
Parsing code. 8.08
Compiling code. 11.65
Compiling layouts code. 4.91
Generating R file. 0.38
Compiling debugger engine code. Error
B4A line: 1244
End Sub
javac 1.6.0_24
shell\src\com\omnicorp\lcarui\test\wallpaperservice_subs_0.java:4672: code too large for try statement
catch (Exception e) {
^
1 error

legacy debug mode:
Parsing code. 7.23
Compiling code. 9.24
Compiling layouts code. 0.02
Generating R file. 1.00
Compiling generated Java code. 18.45
Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: Java heap space
at com.android.dx.cf.code.RopperMachine.run(RopperMachine.java:601)
at com.android.dx.cf.code.Simulator$SimVisitor.visitConstant(Simulator.java:691)
at com.android.dx.cf.code.BytecodeArray.parseInstruction(BytecodeArray.java:309)
at com.android.dx.cf.code.Simulator.simulate(Simulator.java:94)
at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:782)
at com.android.dx.cf.code.Ropper.doit(Ropper.java:737)
at com.android.dx.cf.code.Ropper.convert(Ropper.java:346)
at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:282)
at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:139)
at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:94)
at com.android.dx.command.dexer.Main.processClass(Main.java:682)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
at com.android.dx.command.dexer.Main.access$600(Main.java:78)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:596)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)
Optimized dexer failed. Switching to Standard dexer.
 
Upvote 0

NeoTechni

Well-Known Member
Licensed User
Longtime User
B4A decided to change the order of the modules on me, and it initialized out of order.
Problem fixed, till the next time I need debug mode...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
The first error means that you are doing something wrong in lcarseffects.process_globals.

The second error means that the sub size is too large. The rapid debugger adds quite a lot of code and it hits the limit of the Java compiler.

You should split this sub.

The third error means that you need to increase MaxRamForDex.
 
Upvote 0
Top