Reputation: 44
I need your help. Am struggling with this bug for sometime. Thanks for your help.
Do let me know if you need more information.
I am developing a game with custom android activities. So I created a sample project and changed the source code to handle custom android activity. I got it to compile and build the app properly, but when I run it, i get an error message. The log cat has the following error message:
6-08 14:15:37.548 14319 14319 W linker : /data/app/com.MyTestCompany.puzzle-1/lib/arm/libUE4.so: is missing DT_SONAME will use basename as a replacement: "libUE4.so"
06-08 14:15:37.720 3751 6317 D audio_hw_primary: disable_audio_route: reset and update mixer path: low-latency-playback
06-08 14:15:37.721 3751 6317 D audio_hw_primary: disable_snd_device: snd_device(2: speaker)
06-08 14:15:37.734 3751 6317 D audio_hw_primary: disable_snd_device: snd_device(71: vi-feedback)
06-08 14:15:37.735 3751 6317 D audio_hw_primary: disable_audio_route: reset and update mixer path: spkr-vi-record
06-08 14:15:37.737 3751 6317 I soundtrigger: audio_extn_sound_trigger_update_device_status: device 0x2 of type 0 for Event 0
06-08 14:15:38.194 14319 14319 D UE4 : In the JNI_OnLoad function
06-08 14:15:38.202 14319 14319 D UE4 : Path found as '/storage/emulated/0'
06-08 14:15:38.204 14319 14319 D UE4 : Font Path found as '/system/fonts/'
06-08 14:15:38.204 14319 14319 D UE4 : In the JNI_OnLoad function 5
06-08 14:15:38.224 14319 14319 D AndroidRuntime: Shutting down VM
06-08 14:15:38.240 14319 14319 E AndroidRuntime: FATAL EXCEPTION: main
06-08 14:15:38.240 14319 14319 E AndroidRuntime: Process: com.MyTestCompany.puzzle, PID: 14319
06-08 14:15:38.240 14319 14319 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.MyTestCompany.puzzle/com.epicgames.ue4.GameActivity}: java.lang.IllegalArgumentException: Unable to find native library: main
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5422)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: Unable to find native library: main
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at android.app.NativeActivity.onCreate(NativeActivity.java:170)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at com.epicgames.ue4.GameActivity.onCreate(GameActivity.java:266)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:6251)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
06-08 14:15:38.240 14319 14319 E AndroidRuntime: ... 9 more
Here is my app manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com" android:versionCode="1" android:versionName="1.0">
<!-- Application Definition -->
<application android:label="@string/app_name" android:icon="@drawable/icon" android:hasCode="true">
<activity android:name="com.epicgames.ue4.SplashActivity" android:label="@string/app_name" android:theme="@style/UE4SplashTheme" android:launchMode="singleTask" android:screenOrientation="landscape" android:debuggable="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.hazardnetworking.unrealandroidtest2.MainActivity" android:label="@string/app_name" android:theme="@style/AppTheme" android:configChanges="screenSize|orientation|keyboardHidden|keyboard" android:launchMode="singleTask" android:screenOrientation="landscape" android:debuggable="true">
<meta-data android:name="android.app.lib_name" android:value="UE4" />
</activity>
<activity android:name="com.epicgames.ue4.GameActivity" android:label="@string/app_name" android:theme="@style/UE4SplashTheme" android:configChanges="screenSize|orientation|keyboardHidden|keyboard">
</activity>
<activity android:name=".DownloaderActivity" android:screenOrientation="landscape" android:configChanges="screenSize|orientation|keyboardHidden|keyboard" android:theme="@style/UE4SplashTheme" />
<meta-data android:name="com.epicgames.ue4.GameActivity.DepthBufferPreference" android:value="0" />
<meta-data android:name="com.epicgames.ue4.GameActivity.bPackageDataInsideApk" android:value="false" />
<meta-data android:name="com.epicgames.ue4.GameActivity.bVerifyOBBOnStartUp" android:value="false" />
<meta-data android:name="com.epicgames.ue4.GameActivity.bShouldHideUI" android:value="false" />
<meta-data android:name="com.epicgames.ue4.GameActivity.ProjectName" android:value="PuzzleTestProject2" />
<meta-data android:name="com.epicgames.ue4.GameActivity.bHasOBBFiles" android:value="false" />
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<service android:name="OBBDownloaderService" />
<receiver android:name="AlarmReceiver" />
</application>
<!-- Requirements -->
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
</manifest>
Thanks for looking
Upvotes: 0
Views: 2087
Reputation: 44
I got it to work. The problems I noticed seems specific to my project and I don't know why this is so. Here is what I found:
1) For some reason, the method MakeApk in UEDeployAndroid.cs delets the files as part of the clean up. During the clean-up, it also deletes the project's build.xml. You can see this in line 1936 in the file UEDeployAndroid.cs. I am not sure why the cleanup deletes the build.xml. Now since the build.xml is deleted, the Ant does not build the project. Hence I had to run the command 'android update project'. I was able to use commandline build tools to continue the build process.
2) Everytime the UE editor updates the project, it seems to create a new version the native library libUE4.so. Hence it is not finding the library when I run the GameActivity.java. I was able to use dumpsys to find out the folder path and the native library versions. Deleting the olde packages before reinstalling works.
Thanks
Upvotes: 0
Reputation: 57203
Your meta-data is wrong: main is the default native library name if not specified in the manifest, see https://developer.android.com/reference/android/app/NativeActivity.html
Or maybe your derived Activity ignores the manifest. NativeActivity was not built to be extended, so you should be extra-careful.
Upvotes: 1