Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Widget crashes Android App
Started by d.ireland Nov 07 2019 07:23 PM

1 reply to this topic
widget android corona cards

Best Answer Rob Miracle , 08 November 2019 - 05:46 PM

Since you're using CoronaCards, the widget library needs some resources. You can download the simulator and open the folder and look for a Contents/Resources folder and copy the widget* files to the same folder with main.lua and try that.

 

Rob

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

d.ireland

[GLOBAL: userInfoPane.html]
d.ireland
  • Observer

  • 2 posts
  • Corona SDK

Hi,

 

I have the latest CoronaCards  from daily  builds and my compileSDK Version is 28.

 

When I include this code (in the Fishies example):

 

local widget = require("widget")
widget.setTheme("widget_theme_android_holo_light")

playBtn = widget.newButton { label="Play Now" }

 

I get the following error (which is reproducible by creating any other widget as well):

2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] No pending exception expected: java.lang.RuntimeException: bad argument #2 to 'newSprite' (ImageSheet expected, got nil)
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] stack traceback:
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] 	[C]: ?
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] 	[C]: in function 'newSprite'
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] 	?: in function '?'
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] 	?: in function <?:1489>
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] 	(tail call): ?
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] 	?: in function <?:122>
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] 	(tail call): ?
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] 	scenes/menu:46: in function '?'
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] 	?: in function 'dispatchEvent'
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] 	?: in function 'gotoScene'
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] 	/data/user/0/com.csiro.metronorth.painroadmap/files/coronaResources/Ebony/main.lua:189: in main chunk
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166]   at int com.ansca.corona.CoronaLuaErrorHandler.invoke(com.naef.jnlua.LuaState) (CoronaLuaErrorHandler.java:169)
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166]   at int com.ansca.corona.CoronaEnvironment.invokeLuaErrorHandler(long) (CoronaEnvironment.java:450)
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166]   at int com.ansca.corona.NativeToJavaBridge.callInvokeLuaErrorHandler(long) (NativeToJavaBridge.java:321)
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166]   at void com.ansca.corona.JavaToNativeShim.nativeResize(long, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, int, int, boolean) (JavaToNativeShim.java:-2)
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166]   at void com.ansca.corona.JavaToNativeShim.resize(com.ansca.corona.CoronaRuntime, android.content.Context, int, int, com.ansca.corona.WindowOrientation, boolean) (JavaToNativeShim.java:419)
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166]   at void com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(javax.microedition.khronos.opengles.GL10, int, int) (CoronaGLSurfaceView.java:407)
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166]   at void com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun() (GLSurfaceView.java:1614)
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166]   at void com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run() (GLSurfaceView.java:1380)
2019-11-08 13:20:10.484 8963-9068/com.csiro.metronorth.painroadmap A/rth.painroadma: thread.cc:2166] 

Would anybody have any suggestions?

 

Thank you.

 



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,393 posts
  • Enterprise

  Best Answer

Since you're using CoronaCards, the widget library needs some resources. You can download the simulator and open the folder and look for a Contents/Resources folder and copy the widget* files to the same folder with main.lua and try that.

 

Rob




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: widget, android, corona cards