Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servo does not start on Android #6002

Closed
Jinwoo-Song opened this issue May 11, 2015 · 7 comments
Closed

Servo does not start on Android #6002

Jinwoo-Song opened this issue May 11, 2015 · 7 comments
Assignees
Labels

Comments

@Jinwoo-Song
Copy link
Contributor

@Jinwoo-Song Jinwoo-Song commented May 11, 2015

I've built the servo on Ubuntu(14.04) with ndk-r10d and latest Android SDK. But after launching the servo with following command, servo terminated immediately.

am start com.example.native_activity/rust.glutin.MainActivity

I get the below logs and it seems that libmozjs.so is not found. Could anyone help for this?

D/AndroidRuntime(27896): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime(27896): CheckJNI is OFF
D/AndroidRuntime(27896): Calling main entry com.android.commands.am.Am
I/ActivityManager( 485): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.native_activity/rust.glutin.MainActivity} from uid 2000 on display 0
D/AndroidRuntime(27896): Shutting down VM
I/ActivityManager( 485): Start proc com.example.native_activity for activity com.example.native_activity/rust.glutin.MainActivity: pid=27907 uid=10085 gids={50085, 9997, 3003, 1028, 1015} abi=armeabi
I/art (27907): Late-enabling -Xcheck:jni
V/PhoneStatusBar( 658): setLightsOn(true)
D/AndroidRuntime(27907): Shutting down VM
E/AndroidRuntime(27907): FATAL EXCEPTION: main
E/AndroidRuntime(27907): Process: com.example.native_activity, PID: 27907
E/AndroidRuntime(27907): java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.native_activity-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.native_activity-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libmozjs.so.so"
E/AndroidRuntime(27907): at java.lang.Runtime.loadLibrary(Runtime.java:366)
E/AndroidRuntime(27907): at java.lang.System.loadLibrary(System.java:989)
E/AndroidRuntime(27907): at rust.glutin.MainActivity.(MainActivity.java:5)
E/AndroidRuntime(27907): at java.lang.reflect.Constructor.newInstance(Native Method)
E/AndroidRuntime(27907): at java.lang.Class.newInstance(Class.java:1572)
E/AndroidRuntime(27907): at android.app.Instrumentation.newActivity(Instrumentation.java:1065)
E/AndroidRuntime(27907): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199)
E/AndroidRuntime(27907): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
E/AndroidRuntime(27907): at android.app.ActivityThread.access$800(ActivityThread.java:144)
E/AndroidRuntime(27907): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
E/AndroidRuntime(27907): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(27907): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(27907): at android.app.ActivityThread.main(ActivityThread.java:5221)
E/AndroidRuntime(27907): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(27907): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(27907): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
E/AndroidRuntime(27907): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
W/ActivityManager( 485): Force finishing activity com.example.native_activity/rust.glutin.MainActivity
I/OpenGLRenderer( 485): Initialized EGL, version 1.4
W/ActivityManager( 485): Activity pause timeout for ActivityRecord{2b4f7dec u0 com.example.native_activity/rust.glutin.MainActivity t58 f}
I/MicrophoneInputStream(23626): mic_close gfk@1665329d
I/SoundTriggerHwService::Module( 203): void android::SoundTriggerHwService::Module::onCallbackEvent(const android::spandroid::SoundTriggerHwService::CallbackEvent&) mClient == 0
I/HotwordRecognitionRnr(23626): Hotword detection finished
I/HotwordRecognitionRnr(23626): Stopping hotword detection.
W/OpenGLRenderer( 918): Incorrectly called buildLayer on View: adg, destroying layer...
I/Process (27907): Sending signal. PID: 27907 SIG: 9
W/InputMethodManagerService( 485): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@15761faa attribute=null, token = android.os.BinderProxy@13e57e74
W/LocationOracleImpl(23626): Best location was null
I/MicrophoneInputStream(23626): mic_starting gfk@8c79c96
I/SoundTriggerHwService::Module( 203): void android::SoundTriggerHwService::Module::onCallbackEvent(const android::spandroid::SoundTriggerHwService::CallbackEvent&) mClient == 0
I/HotwordRecognitionRnr(23626): Starting hotword detection.
I/AudioFlinger( 203): AudioFlinger's thread 0xab8364b8 ready to run
I/ActivityManager( 485): Process com.example.native_activity (pid 27907) has died
I/MicrophoneInputStream(23626): mic_started gfk@8c79c96
I/art ( 485): Explicit concurrent mark sweep GC freed 33948(2043KB) AllocSpace objects, 7(11MB) LOS objects, 30% free, 36MB/52MB, paused 4.137ms total 147.933ms
I/HotwordWorker(23626): onReady

@Jinwoo-Song
Copy link
Contributor Author

@Jinwoo-Song Jinwoo-Song commented May 11, 2015

@larsbergstrom
Copy link
Contributor

@larsbergstrom larsbergstrom commented May 11, 2015

@Jinwoo-Song I will look at this today; it must be an error introduced during the latest Rust upgrade.

Additionally, even before this upgrade we had a bug on Android that may still need to be resolved - #5795

@mmatyas
Copy link
Contributor

@mmatyas mmatyas commented May 11, 2015

I have a similar issue, launching a release build on an Arndale Octa (Android 4.2.2), built using the latest tools gives the following error:

I/AudioHardware( 1796): mHandle is NULL
I/AudioHardware( 1796): Try to open ALSA PLAYBACK device AndroidPlayback
I/ActivityManager( 2151): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.native_activity/rust.glutin.MainActivity bnds=[162,377][250,465]} from pid 2372
I/AudioHardware( 1796): Initialized ALSA PLAYBACK device AndroidPlayback
D/AudioHardware( 1796): Set PLAYBACK PCM format to S16_LE (Signed 16 bit Little Endian)
D/AudioHardware( 1796): Using 2 channels for PLAYBACK.
D/AudioHardware( 1796): Set PLAYBACK sample rate to 48000 HZ
D/AudioHardware( 1796): Samples in buffer : 768
D/AudioHardware( 1796): Latency: 16000
D/dalvikvm( 6834): Not late-enabling CheckJNI (already on)
I/ActivityManager( 2151): Start proc com.example.native_activity for activity com.example.native_activity/rust.glutin.MainActivity: pid=6834 uid=10044 gids={50044, 3003, 1028, 1015}
I/dalvikvm( 6834): Turning on JNI app bug workarounds for target SDK version 9...
W/dalvikvm( 6834): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lrust/glutin/MainActivity;
W/dalvikvm( 6834): Class init failed in newInstance call (Lrust/glutin/MainActivity;)
D/AndroidRuntime( 6834): Shutting down VM
W/dalvikvm( 6834): threadid=1: thread exiting with uncaught exception (group=0x41caa930)
E/AndroidRuntime( 6834): FATAL EXCEPTION: main
E/AndroidRuntime( 6834): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 6834):    at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 6834):    at java.lang.Class.newInstance(Class.java:1319)
E/AndroidRuntime( 6834):    at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
E/AndroidRuntime( 6834):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
E/AndroidRuntime( 6834):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
E/AndroidRuntime( 6834):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
E/AndroidRuntime( 6834):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
E/AndroidRuntime( 6834):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 6834):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 6834):    at android.app.ActivityThread.main(ActivityThread.java:5041)
E/AndroidRuntime( 6834):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 6834):    at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 6834):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime( 6834):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
E/AndroidRuntime( 6834):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 6834): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load mozjs.so from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.example.native_activity-1.apk,libraryPath=/data/app-lib/com.example.native_activity-1]: findLibrary returned null
E/AndroidRuntime( 6834):    at java.lang.Runtime.loadLibrary(Runtime.java:365)
E/AndroidRuntime( 6834):    at java.lang.System.loadLibrary(System.java:535)
E/AndroidRuntime( 6834):    at rust.glutin.MainActivity.<clinit>(MainActivity.java:5)
E/AndroidRuntime( 6834):    ... 15 more
W/ActivityManager( 2151):   Force finishing activity com.example.native_activity/rust.glutin.MainActivity
D/dalvikvm( 2151): GC_CONCURRENT freed 1041K, 27% free 6442K/8776K, paused 4ms+6ms, total 45ms
W/ActivityManager( 2151): Activity pause timeout for ActivityRecord{4224afb8 u0 com.example.native_activity/rust.glutin.MainActivity}
D/mali_winsys( 2372): new_window_surface returns 0x3000
@jdm jdm added the P-android label May 11, 2015
@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented May 11, 2015

I get the same error as @mmatyas, above. libmozjs.so is present in the APK, and I can load both libmozjs.so and libmain.so on the device using dlopen in a simple test program.

couldn't find "libmozjs.so.so"

It looks like an extra .so is sneaking into the filename somewhere.

@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented May 11, 2015

Caused by this change in rust-windowing/android-rs-glue#48. (The slice is incorrect, and no longer removes the .so extension.)

@mbrubeck mbrubeck self-assigned this May 11, 2015
mbrubeck added a commit to mbrubeck/android-rs-glue that referenced this issue May 11, 2015
The end of this slice range was accidentally removed in rust-windowing#48.
Fixes servo/servo#6002.
mbrubeck added a commit to mbrubeck/servo that referenced this issue May 11, 2015
The end of this slice range was accidentally removed in servo#48.
Fixes servo#6002.
mbrubeck added a commit to mbrubeck/android-rs-glue that referenced this issue May 11, 2015
The end of the slice range was accidentally removed in rust-windowing#48.
Fixes servo/servo#6002.
@Jinwoo-Song
Copy link
Contributor Author

@Jinwoo-Song Jinwoo-Song commented May 12, 2015

Is there any news for #5795? I got same problem now.

@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented May 12, 2015

Is there any news for #5795? I got same problem now.

We haven't figured out the cause of that issue yet, though we hope to fix it as soon as possible. If anyone is able to help out, that would be great!

bors-servo pushed a commit that referenced this issue May 12, 2015
fixes #6002

r? @mbrubeck

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6024)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.