Search Unity

android (basic) 2.1: "Library mono not found"

Discussion in 'Android' started by pfialho, Mar 28, 2012.

  1. pfialho

    pfialho

    Joined:
    Oct 24, 2011
    Posts:
    13
    Hi all,

    I'm having trouble starting a Unity application on an emulated android 2.1 (with emulated gpu enabled and 256mb ram size).
    From the logcat, there's a "java.lang.UnsatisfiedLinkError: Library mono not found", but I can't figure how to manage the include libraries in an apk or in the emulated android system. ATM, I don't have a real device to try.

    I'm using Unity 3.5 with an android basic license.

    Any help?

    Thanks in advance,
    Peter

    The relevant logcat is:

    D/AndroidRuntime( 242):
    D/AndroidRuntime( 242): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
    D/AndroidRuntime( 242): CheckJNI is ON
    D/dalvikvm( 249): DexOpt: load 49ms, verify 23ms, opt 1ms
    D/installd( 32): DexInv: --- END '/system/app/PicoTts.apk' (success) ---
    D/AndroidRuntime( 242): --- registering native functions ---
    I/ActivityManager( 59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCH
    ER] flg=0x10200000 cmp=pt.inesc.l2f/com.unity3d.player.UnityPlayerProxyActivity }
    I/ActivityManager( 59): Start proc pt.inesc.l2f for activity pt.inesc.l2f/com.unity3d.player.UnityPlayerProxyActivity:
    pid=255 uid=10028 gids={3003, 1015}
    D/AndroidRuntime( 242): Shutting down VM
    D/dalvikvm( 242): DestroyJavaVM waiting for non-daemon threads to exit
    D/dalvikvm( 242): DestroyJavaVM shutting VM down
    D/dalvikvm( 242): HeapWorker thread shutting down
    D/dalvikvm( 242): HeapWorker thread has shut down
    D/jdwp ( 242): JDWP shutting down net...
    I/jdwp ( 242): adbd disconnected
    D/dalvikvm( 242): VM cleaning up
    D/dalvikvm( 255): Not late-enabling CheckJNI (already on)
    D/dalvikvm( 242): LinearAlloc 0x0 used 637292 of 5242880 (12%)
    E/AndroidRuntime( 242): ERROR: thread attach failed
    I/ARMAssembler( 59): generated scanline__00000177:03515104_00000001_00000000 [ 73 ipp] (95 ins) at [0x407250:0x4073cc]
    in 824713 ns
    I/ARMAssembler( 59): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x4073d0:0x4074dc]
    in 433311 ns
    I/ActivityManager( 59): Starting activity: Intent { flg=0x10000 cmp=pt.inesc.l2f/com.unity3d.player.UnityPlayerActivit
    y }
    I/Unity ( 255): cpuarch.GetCpuFeatures() = 134
    I/Unity ( 255): cpuarch.GetTotalMemory() = 250
    I/Unity ( 255): gles_mode = 1 (integer)
    I/Unity ( 255): splash_mode = 0 (integer)
    I/Unity ( 255): hide_status_bar = True (bool)
    I/Unity ( 255): 32bit_display = False (bool)
    I/Unity ( 255): 24bit_depth = False (bool)
    I/Unity ( 255): default_aa = 0 (integer)
    I/Unity ( 255): development_player = True (bool)
    D/AndroidRuntime( 255): Shutting down VM
    W/dalvikvm( 255): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
    E/AndroidRuntime( 255): Uncaught handler: thread main exiting due to uncaught exception
    E/AndroidRuntime( 255): java.lang.UnsatisfiedLinkError: Library mono not found
    E/AndroidRuntime( 255): at java.lang.Runtime.loadLibrary(Runtime.java:489)
    E/AndroidRuntime( 255): at java.lang.System.loadLibrary(System.java:557)
    E/AndroidRuntime( 255): at com.unity3d.player.UnityPlayer.<init>(Unknown Source)
    E/AndroidRuntime( 255): at com.unity3d.player.UnityPlayerActivity.onCreate(Unknown Source)
    E/AndroidRuntime( 255): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    E/AndroidRuntime( 255): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
    E/AndroidRuntime( 255): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
    E/AndroidRuntime( 255): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
    E/AndroidRuntime( 255): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
    E/AndroidRuntime( 255): at android.os.Handler.dispatchMessage(Handler.java:99)
    E/AndroidRuntime( 255): at android.os.Looper.loop(Looper.java:123)
    E/AndroidRuntime( 255): at android.app.ActivityThread.main(ActivityThread.java:4363)
    E/AndroidRuntime( 255): at java.lang.reflect.Method.invokeNative(Native Method)
    E/AndroidRuntime( 255): at java.lang.reflect.Method.invoke(Method.java:521)
    E/AndroidRuntime( 255): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
    E/AndroidRuntime( 255): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
    E/AndroidRuntime( 255): at dalvik.system.NativeStart.main(Native Method)
    I/Process ( 59): Sending signal. PID: 255 SIG: 3
    I/dalvikvm( 255): threadid=7: reacting to signal 3
    E/dalvikvm( 255): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
    I/ARMAssembler( 59): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x436710:0x4367cc]
    in 352408 ns
    I/ARMAssembler( 59): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x4367d0:0x436998
    ] in 645412 ns
    I/Process ( 255): Sending signal. PID: 255 SIG: 9
    I/ActivityManager( 59): Process pt.inesc.l2f (pid 255) has died.
    I/UsageStats( 59): Unexpected resume of com.android.launcher while already resumed in pt.inesc.l2f
    W/InputManagerService( 59): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClie
    nt$Stub$Proxy@44d03518
    E/gralloc ( 59): [unregister] handle 0x3c8368 still locked (state=40000001)
    W/ActivityManager( 59): Activity destroy timeout for HistoryRecord{44c17ea0 pt.inesc.l2f/com.unity3d.player.UnityPlaye
    rProxyActivity}
     
  2. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    It can't be stressed enough: The emulator is useless for testing games. Test it on the real device. There is no way around it if you want to develop Games for Android. 70% of the testing can be done inside of the Unity Editor (with or without UnityRemote). The remaining 30% are performance (can only be tested on real device) or Java Plugin functionality (which is also best tested on real device).
     
  3. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    Even then Unity remote is misleading. You can play a game 100+ MB in size with the remote without knowing it absolutely won't work on an actual build.
     
  4. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    Need a phone with remote to debug and build, need to actually build and deploy on a phone to truely test how it works. Emulator IS worthless.

    Crap, I meant to edit not reply to myself :)
     
  5. Tseng

    Tseng

    Joined:
    Nov 29, 2010
    Posts:
    1,217
    Then you obviously have no Idea what the Unity Remote is for, otherwise this statement would be needles.

    UnityRemote is there to proxy the touch input from your device to UnityEditor. Nothing more. That's the only point of Unity remote, because other wise you would have to rebuild your game and push it on the phone when you change something touch control related. 90% of the non-control related can be done in the Editor.

    You need the device for:
    a) performance testing - obviously
    b) final input control testing - Not everything can be tested well on Unity Remote (since it's legs somewhat)
    c) UI - testing if the UI looks well and if the buttons can be pressed nicely
    d) test Android specific stuff (OpenFeint, Ads, GoogleAnalytics, TapJoy etc.)
     
  6. lmbarns

    lmbarns

    Joined:
    Jul 14, 2011
    Posts:
    1,628
    Well I figured it out the second I made my first build!!

    But initially I was under the impression since it was also rendering the game on the phone it was also an indication that it worked on the phone.

    It was quickly apparent, however, that the heavy lifting is being done by my desktop and only the input is used by the phone.

    On Google Play, I believe I saw other people who had the same misconception, as I saw a couple 1 star games where everyone said it crashed on the unity loading screen, yet the person who made it acted like it was running all this crazy amount of high res textured content. I can only imagine it worked on their remote so they thought it worked on mobiles.

    Remote is great for checking errors in the log on the PC, and quickly testing stuff (especially minor tweaks not worth building+uploading).

    Emulator is worthless in all accounts.
     
  7. pfialho

    pfialho

    Joined:
    Oct 24, 2011
    Posts:
    13
    The "Library mono not found" changes to "Couldn't load mono: findLibrary returned null" (as also stated in other thread of this forum) on some player setups (target android version and "Device filter").

    However, these java errors disappear when using Unity 3.4, as also stated in other thread of this forum, and a simple version of my Unity app (only an animated 3D model with a plane and a point light) runs on an emulated 2.3.3 android (although logcat shows an infinite loop of "called unimplemented OpenGL ES API"). Any hints on the fix to get the same result on Unity 3.5 ?

    EDIT: it works on 3.5, but only for an emulated android 4.0.3 (with arm 7 system image) and Unity player with "device filter" as "ARMv7only". So, Unity 3.5 android basic is only working with ARMv7 emulators (which means only android 4.0.x, as these are the only with this CPU/ABI image).
     
    Last edited: Mar 29, 2012
  8. Parikshit Singh

    Parikshit Singh

    Joined:
    Sep 19, 2012
    Posts:
    6
    I am testing it on android 4.0 emulator nut still its not working unit version is 3.5.0f5 but still getting error "Couldn't load mono: findLibrary returned null"
    How to solve it please tell
     
  9. Parikshit Singh

    Parikshit Singh

    Joined:
    Sep 19, 2012
    Posts:
    6
    I am testing it on android 4.0 emulator nut still its not working unit version is 3.5.0f5 but still getting error "Couldn't load mono: findLibrary returned null"
    How to solve it please tell