UnsatisfiedLinkError with SimpleLuaExtension sample

Hi,

I’m just getting started with Corona Enterprise and decided to try to build SimpleLuaExtension sample

before trying anything else. But unfortunately I just can’t get it to work. Whenever I run the application

on emulator / device it will give same error about UnsatisfiedLinkError:

09-02 17:51:14.056: W/dalvikvm(932): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/ansca/corona/JavaToNativeShim; 09-02 17:51:14.066: W/dalvikvm(932): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/ansca/corona/CoronaEnvironment; 09-02 17:51:14.066: D/AndroidRuntime(932): Shutting down VM 09-02 17:51:14.066: W/dalvikvm(932): threadid=1: thread exiting with uncaught exception (group=0x414c4700) 09-02 17:51:14.076: E/AndroidRuntime(932): FATAL EXCEPTION: main 09-02 17:51:14.076: E/AndroidRuntime(932): java.lang.UnsatisfiedLinkError: Couldn't load lua from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.mycompany.simpleluaextension-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.mycompany.simpleluaextension-1, /system/lib]]]: findLibrary returned null 09-02 17:51:14.076: E/AndroidRuntime(932): at java.lang.Runtime.loadLibrary(Runtime.java:355) 09-02 17:51:14.076: E/AndroidRuntime(932): at java.lang.System.loadLibrary(System.java:525) 09-02 17:51:14.076: E/AndroidRuntime(932): at com.ansca.corona.JavaToNativeShim.\<clinit\>(JavaToNativeShim.java:95) 09-02 17:51:14.076: E/AndroidRuntime(932): at com.ansca.corona.CoronaEnvironment.setLuaErrorHandler(CoronaEnvironment.java:373) 09-02 17:51:14.076: E/AndroidRuntime(932): at com.ansca.corona.CoronaEnvironment.\<clinit\>(CoronaEnvironment.java:41) 09-02 17:51:14.076: E/AndroidRuntime(932): at com.mycompany.simpleluaextension.CoronaApplication.onCreate(CoronaApplication.java:16) 09-02 17:51:14.076: E/AndroidRuntime(932): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007) 09-02 17:51:14.076: E/AndroidRuntime(932): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4444) 09-02 17:51:14.076: E/AndroidRuntime(932): at android.app.ActivityThread.access$1300(ActivityThread.java:141) 09-02 17:51:14.076: E/AndroidRuntime(932): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) 09-02 17:51:14.076: E/AndroidRuntime(932): at android.os.Handler.dispatchMessage(Handler.java:99) 09-02 17:51:14.076: E/AndroidRuntime(932): at android.os.Looper.loop(Looper.java:137) 09-02 17:51:14.076: E/AndroidRuntime(932): at android.app.ActivityThread.main(ActivityThread.java:5103) 09-02 17:51:14.076: E/AndroidRuntime(932): at java.lang.reflect.Method.invokeNative(Native Method) 09-02 17:51:14.076: E/AndroidRuntime(932): at java.lang.reflect.Method.invoke(Method.java:525) 09-02 17:51:14.076: E/AndroidRuntime(932): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 09-02 17:51:14.076: E/AndroidRuntime(932): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 09-02 17:51:14.076: E/AndroidRuntime(932): at dalvik.system.NativeStart.main(Native Method)

I use enterprise build 1061 and my emulator running Android 4.3 and my device is LG Optimus 2x running Cyanogenmod 10.

I really have no idea what’s causing this error.

Thanks.

It turns out that this error is caused by default signing process.

Since I want to use debug.keystore and it is done automatically using ant debug, I change the ant command to debug

inside build.sh. After I use ant release and sign it manually using debug.keystore, the error is gone.

Thanks.

The cause of this error actually has nothing to do with signing.  We’ve discovered a bug in Corona where it fails to load its native C/C++ libraries on Android 4.3 when running your app with another user account.  This crash only occurs if you create the user account *after* your app has been installed.  Re-installing your app would work-around the problem and cause it to load successfully.

We fixed this issue in build #1202.

It turns out that this error is caused by default signing process.

Since I want to use debug.keystore and it is done automatically using ant debug, I change the ant command to debug

inside build.sh. After I use ant release and sign it manually using debug.keystore, the error is gone.

Thanks.

The cause of this error actually has nothing to do with signing.  We’ve discovered a bug in Corona where it fails to load its native C/C++ libraries on Android 4.3 when running your app with another user account.  This crash only occurs if you create the user account *after* your app has been installed.  Re-installing your app would work-around the problem and cause it to load successfully.

We fixed this issue in build #1202.

@Joshua

I still get similar crash reports from Google, and I was building with #2188. Why is that if it’s fixed?

java.lang.UnsatisfiedLinkError: Couldn't load lua from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/tw.com.appstudio.app.myapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/tw.com.appstudio.app.myapp-2, /vendor/lib, /system/lib]]]: findLibrary returned null at java.lang.Runtime.loadLibrary(Runtime.java:355) at java.lang.System.loadLibrary(System.java:525) at com.ansca.corona.JavaToNativeShim.\<clinit\>(JavaToNativeShim.java:118) at com.ansca.corona.CoronaEnvironment.setLuaErrorHandler(CoronaEnvironment.java:379) at com.ansca.corona.CoronaEnvironment.\<clinit\>(CoronaEnvironment.java:41) at com.ansca.corona.CoronaView.deleteTempDirectory(CoronaView.java:141) at com.ansca.corona.CoronaActivity.onCreate(CoronaActivity.java:101) at android.app.Activity.performCreate(Activity.java:5133) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2230) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316) at android.app.ActivityThread.access$600(ActivityThread.java:150) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1298) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:5225) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) at dalvik.system.NativeStart.main(Native Method)

@Corona

I am still getting this crash report now & then

Do you want to investigate again?

I just confirmed that the above “restricted profile” issue is still fixed with the newest daily builds.

So, you’re likely running into some other issue.  Perhaps your customers’ app installation have become corrupted?  If so, then having them re-install the app would resolve the issue, just like what you would do with a Windows desktop app.  I’m not really sure what else could cause this.

@Joshua

I still get similar crash reports from Google, and I was building with #2188. Why is that if it’s fixed?

java.lang.UnsatisfiedLinkError: Couldn't load lua from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/tw.com.appstudio.app.myapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/tw.com.appstudio.app.myapp-2, /vendor/lib, /system/lib]]]: findLibrary returned null at java.lang.Runtime.loadLibrary(Runtime.java:355) at java.lang.System.loadLibrary(System.java:525) at com.ansca.corona.JavaToNativeShim.\<clinit\>(JavaToNativeShim.java:118) at com.ansca.corona.CoronaEnvironment.setLuaErrorHandler(CoronaEnvironment.java:379) at com.ansca.corona.CoronaEnvironment.\<clinit\>(CoronaEnvironment.java:41) at com.ansca.corona.CoronaView.deleteTempDirectory(CoronaView.java:141) at com.ansca.corona.CoronaActivity.onCreate(CoronaActivity.java:101) at android.app.Activity.performCreate(Activity.java:5133) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2230) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316) at android.app.ActivityThread.access$600(ActivityThread.java:150) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1298) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:213) at android.app.ActivityThread.main(ActivityThread.java:5225) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) at dalvik.system.NativeStart.main(Native Method)

@Corona

I am still getting this crash report now & then

Do you want to investigate again?

I just confirmed that the above “restricted profile” issue is still fixed with the newest daily builds.

So, you’re likely running into some other issue.  Perhaps your customers’ app installation have become corrupted?  If so, then having them re-install the app would resolve the issue, just like what you would do with a Windows desktop app.  I’m not really sure what else could cause this.