0
votes

Yes, I know this question is similar to this, but it never got answered and I don't like resurrecting old threads (from July '13).

I just began testing my game on a real device (yay!), and though it works perfectly on the Corona Simulator, every time I open it on the actual device and now the emulator, I get "Sorry! The application SampleApp (process com.foo.bar.SampleApp) has stopped unexpectedly. Please try again." I opened adb logcat and find that I'm getting this error:

I/ActivityThread( 1264): Pub com.foo.bar.SampleApp.files: com.ansca.corona.storage.FileContentProvider
W/dalvikvm( 1264): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/ansca/corona/JavaToNativeShim;
W/dalvikvm( 1264): Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Lcom/ansca/corona/CoronaEnvironment;
D/AndroidRuntime( 1264): Shutting down VM
W/dalvikvm( 1264): threadid=1: thread exiting with uncaught exception (group=0x40020560)
E/AndroidRuntime( 1264): FATAL EXCEPTION: main
E/AndroidRuntime( 1264): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 1264):    at com.ansca.corona.CoronaView.deleteTempDirectory(CoronaView.java:141)
E/AndroidRuntime( 1264):    at com.ansca.corona.CoronaActivity.onCreate(CoronaActivity.java:101)
E/AndroidRuntime( 1264):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 1264):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1618)
E/AndroidRuntime( 1264):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1670)
E/AndroidRuntime( 1264):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime( 1264):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
E/AndroidRuntime( 1264):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1264):    at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 1264):    at android.app.ActivityThread.main(ActivityThread.java:3695)
E/AndroidRuntime( 1264):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1264):    at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 1264):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
E/AndroidRuntime( 1264):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
E/AndroidRuntime( 1264):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 1264): Caused by: java.lang.ExceptionInInitializerError
E/AndroidRuntime( 1264):    at com.ansca.corona.CoronaEnvironment.setLuaErrorHandler(CoronaEnvironment.java:379)
E/AndroidRuntime( 1264):    at com.ansca.corona.CoronaEnvironment.<clinit>(CoronaEnvironment.java:41)
E/AndroidRuntime( 1264):    ... 15 more
E/AndroidRuntime( 1264): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load lua: findLibrary returned null
E/AndroidRuntime( 1264):    at java.lang.Runtime.loadLibrary(Runtime.java:429)
E/AndroidRuntime( 1264):    at java.lang.System.loadLibrary(System.java:554)
E/AndroidRuntime( 1264):    at com.ansca.corona.JavaToNativeShim.<clinit>(JavaToNativeShim.java:118)
E/AndroidRuntime( 1264):    ... 17 more
W/ActivityManager(  146):   Force finishing activity com.foo.bar.SampleApp/com.ansca.corona.CoronaActivity

Of course, the real process name isn't com.foo.bar.SampleApp, but it's the same thing.

I have an old Android, so that may be the issue, but I sure hope not. I'm on a Huawei-U8652, Android version 2.3.5. I also built a Corona sample code app, and it did the same thing with the same error.

1
If the sample app does same thing, it's highly likely to be your device. Next step is to run sample app on a more recent device and if it work, try yours (or skip sample app and just run yours!).Oliver
Sigh... I was hoping it wouldn't come to that :( My device is the only Android I have access to... Guess I'd better start looking around for new ones.Caleb P
Ok, now it's officially really strange. It's stopped working on the emulator, and does the exact same thing. Please help!Caleb P
You need to state when this happens: every run? sometimes? At launch time or after you click something? Also the link you post is for Eclipse, is this what you are using? Have you tried running the demo from the sim directly? I've never used Eclipse with Corona, not sure how they relate (other than editor for the Lua files).Oliver
I don't use Eclipse as an editor, just as an AVD launcher (now I've started using the command line, instead). It happens every time, just as I open the app.Caleb P

1 Answers

0
votes

The error is that Lua can't be found, that's pretty extreme. Works from Corona Sim, but not on real device, or in Eclipse-based emulator. Until you can get it to work on the real device, there is no point in using the emulator, it's just too much of an unknown wrt Corona. Try this:

  1. verify examples that come with Corona work on your device
  2. if they do, start adding parts of your main.lua in one of those examples; maybe at some point the error will happen again, allowing you to identify a specific lib call that corrupts memory and sends everything wally
  3. start adding other parts of your app (if you import modules during startup), until you see the error again