Chromium-Android icon indicating copy to clipboard operation
Chromium-Android copied to clipboard

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

Open bluequator opened this issue 5 years ago • 8 comments

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)

bluequator avatar Sep 24 '18 08:09 bluequator

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?

flickstree avatar Nov 17 '18 06:11 flickstree

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.

kuoruan avatar Nov 17 '18 06:11 kuoruan

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 avatar Nov 17 '18 06:11 flickstree

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?

flickstree avatar Nov 19 '18 04:11 flickstree

solution ?

s9iper1 avatar Dec 02 '18 14:12 s9iper1

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

kuoruan avatar Dec 03 '18 02:12 kuoruan

@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"

DickCowBoy avatar Dec 05 '18 11:12 DickCowBoy

@DickCowBoy Great! Thank you for the information.

kuoruan avatar Dec 05 '18 11:12 kuoruan