x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

java.lang.UnsatisfiedLinkError: dlopen failed: library

I am using a thirdparty of library in android.I write the project of build.cs as follows // Fill out your copyright notice in the Description page of Project Settings.

 using UnrealBuildTool;
 using System.IO;
 
 public class androidtest2 : ModuleRules
 {
     public androidtest2(TargetInfo Target)
     {
         PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG"});
 
         //PrivateDependencyModuleNames.AddRange(new string[] {  });
         PublicIncludePaths.Add("E:/Program Files (x86)/Epic Games/4.11/Engine/Source/Runtime/Launch/Public");
         PrivateIncludePaths.Add("E:/Program Files (x86)/Epic Games/4.11/Engine/Source/Runtime/Launch/Private");
         // Uncomment if you are using Slate UI
         // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
 
         // Uncomment if you are using online features
         // PrivateDependencyModuleNames.Add("OnlineSubsystem");
         // if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
         // {
         //        if (UEBuildConfiguration.bCompileSteamOSS == true)
         //        {
         //            DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
         //        }
         // }
 
         if (Target.Platform == UnrealTargetPlatform.Android)
         {
             PublicIncludePaths.AddRange(new string[] { "Core" });
             PublicIncludePaths.Add("E:/NVPACK/android-ndk-r10e/platforms/android-19/arch-arm/usr/include");
            // PrivateIncludePaths.Add("/Source/Runtime/Launch/Private");
             LoadBobsMagic(Target);
         }
     }
 
     private string ThirdPartyPath
     {
         get { return Path.GetFullPath("F:/ueproject/androidtest2/ThirdParty/"); }
     }
 
     public bool LoadBobsMagic(TargetInfo Target)
     {
         bool isLibrarySupported = false;
 
         if (Target.Platform == UnrealTargetPlatform.Android)
         {
             isLibrarySupported = true;
             string LibrariesPath = Path.Combine(ThirdPartyPath, "tango_client_api", "lib");
             PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libtango_client_api.so"));
         }
         
         if (isLibrarySupported)
         {
             // Include path
             PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "tango_client_api", "include"));
         }
         //Definitions.Add(string.Format("WITH_LIBZPLAY_BINDING={0}", isLibrarySupported ? 1 : 0));
         return isLibrarySupported;
     }
 }
 It  builded success and installed on my phone.However,it lanched failed.There is the error log as follows

[link text][1]

How can I fix the error? Many Thanks! By the way I also change the android.mk file in 'E:\Program Files (x86)\Epic Games\4.11\Engine\Build\Android\Java\jni' and add this code

 include $(CLEAR_VARS)
 LOCAL_MODULE := tango_client_api
 LOCAL_SRC_FILES := libtango_client_api.so
 include $(PREBUILT_SHARED_LIBRARY)

it is also not work! [1]: /storage/temp/103158-log.txt

Product Version: Not Selected
Tags:
log.txt (2.4 kB)
more ▼

asked Aug 17 '16 at 03:16 AM in C++ Programming

avatar image

kevinsir
13 7 5 10

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I have got it! Maybe it will help others! 1.you should modify the android.mk in engine folder. just add as follows

 include $(CLEAR_VARS)
 LOCAL_MODULE := tango_client_api
 LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libtango_client_api.so
 include $(PREBUILT_SHARED_LIBRARY)

2.you should add the .so file in yourprojectname/Intermediate/Android/APK/jni/armeabi-v7a which is matched the $(TARGET_ARCH_ABI) maybe then your should delete all the file in yourprojectname/Binaries/Android to force it recompile

So they are always copied to Intermediate directory during build time. I also edited GameActivity.java there to load my library.

I'm afraid this is not a recommended way because I edited default installation. Please let me know better and recommended way.

more ▼

answered Aug 22 '16 at 05:57 AM

avatar image

kevinsir
13 7 5 10

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question