Project

General

Profile

Bug #2366

library "libcrystax.so" not found

Added by Marcel O'Neil almost 2 years ago. Updated almost 2 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
02/08/2018
Due date:
% Done:

0%

Estimated time:
CPU Architecture:
arm, arm64, mips, mips64, x86, x86_64
Host OS:
Linux
Toolchain:
Android version:
4.3 (android-18)
CrystaX Version:

Description

When I run the compiled apk, I get this error:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.marceloneil.test, PID: 3893
    java.lang.UnsatisfiedLinkError: dlopen failed: library "libcrystax.so" not found

MainActivity.java (shortened)

    static {
        System.loadLibrary("main");
    }

Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE            := main
LOCAL_SRC_FILES         := $(LOCAL_PATH)/libs/start.c
LOCAL_LDLIBS            := -llog
LOCAL_SHARED_LIBRARIES  := python_shared
include $(BUILD_SHARED_LIBRARY)

$(call import-module,python/3.5)

build.gradle (shortened)

    externalNativeBuild {
        ndkBuild {
            path 'Android.mk'
        }
    }

Futher analysis of the APK shows that libpython3.5m.so and libmain.so are available for each architecture, but libcrystax.so is missing. I was under the impression that the python module would import any other modules that it requires (ie. libcrystax.so), but I apologize if I'm wrong. Either way, some tips on how to get this sorted out would be appriciated.

History

#1

Updated by Marcel O'Neil almost 2 years ago

Marcel O'Neil wrote:

When I run the compiled apk, I get this error:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.marceloneil.test, PID: 3893
    java.lang.UnsatisfiedLinkError: dlopen failed: library "libcrystax.so" not found

MainActivity.java (shortened)

    static {
        System.loadLibrary("main");
    }

Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE            := main
LOCAL_SRC_FILES         := $(LOCAL_PATH)/libs/start.c
LOCAL_LDLIBS            := -llog
LOCAL_SHARED_LIBRARIES  := python_shared
include $(BUILD_SHARED_LIBRARY)

$(call import-module,python/3.5)

build.gradle (shortened)

    externalNativeBuild {
        ndkBuild {
            path 'Android.mk'
        }
    }

Futher analysis of the APK shows that libpython3.5m.so and libmain.so are available for each architecture, but libcrystax.so is missing. I was under the impression that the python module would import any other modules that it requires (ie. libcrystax.so), but I apologize if I'm wrong. Either way, some tips on how to get this sorted out would be appriciated.

So it turns out gradle's ndkBuild command uses the ndk-build tool from the sdk, not from the ndk. It's not a crystax problem. Also I recognize i did some weird stuff with the libs/start.c and I resolved that.

#2

Updated by Marcel O'Neil almost 2 years ago

Marcel O'Neil wrote:

Marcel O'Neil wrote:

When I run the compiled apk, I get this error:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.marceloneil.test, PID: 3893
    java.lang.UnsatisfiedLinkError: dlopen failed: library "libcrystax.so" not found

MainActivity.java (shortened)

    static {
        System.loadLibrary("main");
    }

Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE            := main
LOCAL_SRC_FILES         := $(LOCAL_PATH)/libs/start.c
LOCAL_LDLIBS            := -llog
LOCAL_SHARED_LIBRARIES  := python_shared
include $(BUILD_SHARED_LIBRARY)

$(call import-module,python/3.5)

build.gradle (shortened)

    externalNativeBuild {
        ndkBuild {
            path 'Android.mk'
        }
    }

Futher analysis of the APK shows that libpython3.5m.so and libmain.so are available for each architecture, but libcrystax.so is missing. I was under the impression that the python module would import any other modules that it requires (ie. libcrystax.so), but I apologize if I'm wrong. Either way, some tips on how to get this sorted out would be appriciated.

So it turns out gradle's ndkBuild command uses the ndk-build tool from the sdk, not from the ndk. It's not a crystax problem. Also I recognize i did some weird stuff with the libs/start.c and I resolved that.

I take that back, it runs the correct ndk-build, but doesn't copy libcrystax.so

This is what it runs:

/home/marcel/crystax-ndk-10.3.2/ndk-build-backup NDK_PROJECT_PATH=$(pwd) APP_BUILD_SCRIPT=/home/marcel/workspace/Test/app/src/main/jni/Android.mk APP_ABI=mips NDK_ALL_ABIS=mips NDK_DEBUG=1 APP_PLATFORM=android-18 NDK_OUT=/home/marcel/workspace/Test/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/home/marcel/workspace/Test/app/build/intermediates/ndkBuild/debug/lib /home/marcel/workspace/Test/app/build/intermediates/ndkBuild/debug/obj/local/mips/libmain.so
[mips] Compile        : main <= start.c
[mips] Prebuilt       : libpython3.5m.so <= <NDK>/sources/python/3.5/libs/mips/
[mips] SharedLibrary  : libmain.so
#3

Updated by Marcel O'Neil almost 2 years ago

Marcel O'Neil wrote:

Marcel O'Neil wrote:

Marcel O'Neil wrote:

When I run the compiled apk, I get this error:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.marceloneil.test, PID: 3893
    java.lang.UnsatisfiedLinkError: dlopen failed: library "libcrystax.so" not found

MainActivity.java (shortened)

    static {
        System.loadLibrary("main");
    }

Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE            := main
LOCAL_SRC_FILES         := $(LOCAL_PATH)/libs/start.c
LOCAL_LDLIBS            := -llog
LOCAL_SHARED_LIBRARIES  := python_shared
include $(BUILD_SHARED_LIBRARY)

$(call import-module,python/3.5)

build.gradle (shortened)

    externalNativeBuild {
        ndkBuild {
            path 'Android.mk'
        }
    }

Futher analysis of the APK shows that libpython3.5m.so and libmain.so are available for each architecture, but libcrystax.so is missing. I was under the impression that the python module would import any other modules that it requires (ie. libcrystax.so), but I apologize if I'm wrong. Either way, some tips on how to get this sorted out would be appriciated.

So it turns out gradle's ndkBuild command uses the ndk-build tool from the sdk, not from the ndk. It's not a crystax problem. Also I recognize i did some weird stuff with the libs/start.c and I resolved that.

I take that back, it runs the correct ndk-build, but doesn't copy libcrystax.so

This is what it runs:

/home/marcel/crystax-ndk-10.3.2/ndk-build-backup NDK_PROJECT_PATH=$(pwd) APP_BUILD_SCRIPT=/home/marcel/workspace/Test/app/src/main/jni/Android.mk APP_ABI=mips NDK_ALL_ABIS=mips NDK_DEBUG=1 APP_PLATFORM=android-18 NDK_OUT=/home/marcel/workspace/Test/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/home/marcel/workspace/Test/app/build/intermediates/ndkBuild/debug/lib /home/marcel/workspace/Test/app/build/intermediates/ndkBuild/debug/obj/local/mips/libmain.so
[mips] Compile        : main <= start.c
[mips] Prebuilt       : libpython3.5m.so <= <NDK>/sources/python/3.5/libs/mips/
[mips] SharedLibrary  : libmain.so

It works with just:

/home/marcel/crystax-ndk-10.3.2/ndk-build NDK_PROJECT_PATH=$(pwd) APP_BUILD_SCRIPT=/home/marcel/workspace/Test/app/src/main/jni/Android.mk APP_ABI=mips NDK_ALL_ABIS=mips NDK_DEBUG=1 APP_PLATFORM=android-18 NDK_OUT=/home/marcel/workspace/Test/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/home/marcel/workspace/Test/app/build/intermediates/ndkBuild/debug/lib

Also available in: Atom PDF