Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

FileDescriptor must not be null,Failed to load native library error #22

Open
bluequator opened this issue Sep 24, 2018 · 8 comments
Open

Comments

@bluequator
Copy link

While launching this app on Samsung device ( Galaxy On7) app is crashing immediately with following error.

Logs related to crash is as follows:--
1/org.chromium.chrome:privileged_process1 E/cr_ChildProcessService: Failed to load native library.
java.lang.NullPointerException: FileDescriptor must not be null
at android.os.ParcelFileDescriptor.(ParcelFileDescriptor.java:176)
at android.os.ParcelFileDescriptor$2.createFromParcel(ParcelFileDescriptor.java:953)
at android.os.ParcelFileDescriptor$2.createFromParcel(ParcelFileDescriptor.java:944)
at org.chromium.base.library_loader.Linker$LibInfo.(Linker.java:666)
at org.chromium.base.library_loader.Linker$LibInfo$1.createFromParcel(Linker.java:700)
at org.chromium.base.library_loader.Linker$LibInfo$1.createFromParcel(Linker.java:697)

@flickstree
Copy link

blue

While launching this app on Samsung device ( Galaxy On7) app is crashing immediately with following error.

Logs related to crash is as follows:--
1/org.chromium.chrome:privileged_process1 E/cr_ChildProcessService: Failed to load native library.
java.lang.NullPointerException: FileDescriptor must not be null
at android.os.ParcelFileDescriptor.(ParcelFileDescriptor.java:176)
at android.os.ParcelFileDescriptor$2.createFromParcel(ParcelFileDescriptor.java:953)
at android.os.ParcelFileDescriptor$2.createFromParcel(ParcelFileDescriptor.java:944)
at org.chromium.base.library_loader.Linker$LibInfo.(Linker.java:666)
at org.chromium.base.library_loader.Linker$LibInfo$1.createFromParcel(Linker.java:700)
at org.chromium.base.library_loader.Linker$LibInfo$1.createFromParcel(Linker.java:697)

hi you get any updates about this issue?

@kuoruan
Copy link
Owner

kuoruan commented Nov 17, 2018

NativeLibraries.java defines the library files load when app initialize.
If app crash with Failed to load native library, I will check this file. but I don't know the FileDescriptor must not be null error.

@flickstree
Copy link

NativeLibraries.java defines the library files load when app initialize.
If app crash with Failed to load native library, I will check this file. but I don't know the FileDescriptor must not be null error.

yes my app crash with Failed to load native library.can you please tell how to solve this issue?

@flickstree
Copy link

NativeLibraries.java defines the library files load when app initialize.
If app crash with Failed to load native library, I will check this file. but I don't know the FileDescriptor must not be null error.

My app crash with 'Failed to load native library'. what can i do?

@s9iper1
Copy link

s9iper1 commented Dec 2, 2018

solution ?

@kuoruan
Copy link
Owner

kuoruan commented Dec 3, 2018

@s9iper1 No solution at this time. Still woking on it. but library load success on android O.

@DickCowBoy
Copy link

@s9iper1 @flickstree @kuoruan
My app has this problem too. i had solved it,but i am not sure it would work for you.
Analysis:
see the source code https://github.com/chromium/chromium/blob/fd2efc13427db48d7ffc9457e38e06ca1dc55257/base/android/linker/BUILD.gn in line 16 it says
The NDK contains the crazy_linker here: '<(android_ndk_root)/crazy_linker.gyp:crazy_linker' However, we use our own fork. See bug 384700.

libchromium_android_linker.so is complied with a own fork crazy_linker.gyp instead of one in standard ndk. so i guessed when we use ./gradlew assemble to build this project ndk will do something to libchromium_android_linker.so if we had set "ANDROID_NDK" OR "ANDROID_NDK_HOME".

try:
1.remove "ANDROID_NDK" and "ANDROID_NDK_HOME" system variable
2.remove or rename ndk-bundle folder in your anroid sdk home path if there has one
3.build the project to check this problem

My project is build with jenkins in sever machine so my final solution is to add these code to gradlew's header.

`#!/usr/bin/env bash

echo "================set ndk path to null to void compile libchrom_linker.so==================="
export ANDROID_NDK=
export ANDROID_NDK_HOME=
env | grep "ANDROID"
env | grep "NDK"

@kuoruan
Copy link
Owner

kuoruan commented Dec 5, 2018

@DickCowBoy Great! Thank you for the information.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants