# How to load libUE4.so from local folder on Android?

**URL:** <https://forums.unrealengine.com/t/how-to-load-libue4-so-from-local-folder-on-android/578524>\
**Category:** Mobile\
**Tags:** unreal-engine, Android, UE4, UE4-27, question\
**Created:** [June 10, 2022, 8:32am UTC](https://forums.unrealengine.com/t/how-to-load-libue4-so-from-local-folder-on-android/578524 "2022-06-10T08:32:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jozzhn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jozzhn](https://forums.unrealengine.com/u/Jozzhn)\
**Post date:** [June 10, 2022, 8:32am UTC](https://forums.unrealengine.com/t/how-to-load-libue4-so-from-local-folder-on-android/578524/1 "2022-06-10T08:32:05Z")

</div>

In GameActivity.java.template, UE load libUE4.so like this:

```auto
System.loadLibrary("UE4");

```

But I want to load libUE4.so from Android app files dir, instead of loading from native library dir:

```auto
System.loadLibrary(path_to_local_libue4);

```

However, when I modified the GameActivity.java.template, and change System.loadLibrary(“UE4”) to System.load(path\_to\_local\_libue4)，the game will crash on start with “java.lang.UnsatisfiedLinkError: undefined symbol: \_\_swrite”

```auto
06-10 16:01:47.843 13709 13709 E AndroidRuntime: java.lang.UnsatisfiedLinkError: undefined symbol: __swrite

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at java.lang.Runtime.loadLibrary(Runtime.java:373)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1076)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at com.epicgames.ue4.GameActivity.onCreate(GameActivity.java:2349)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6279)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2499)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2606)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1444)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5654)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:759)

06-10 16:01:47.843 13709 13709 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:649)

```

I know that maybe it can not find other .so files that depends on by this way. So I tried to load other .so files before libUE4.so.

It works, but game will also crash after load. The app loads the libUE4.so from local file successfully but it will load libUE4.so again from native library path. So it will crash finally.

Anybody knows why? Please help me.

I wonder if UE did something in AndroidJNI Onload that causing this problem?
