Select to view content in your preferred language

Including OpenSSL .so libraries for Android? (resolved)

1252
0
09-07-2022 05:23 PM
m_d
by
New Contributor II

All,

I'd love to know how you included the two OpenSSL libraries in your Unreal project for Android. I've done a ton of Googling; research suggests the right way to do this is to create a plugin.

Using the ArcGIS SDK plugin as a model along with the little that exists in the way of docs, I've cobbled together a plugin that will copy the libcrypto_1_1.so and libssl_1_1.so files to the libs/arm64-v8a directory in the .apk.

However, I get one of two problems at runtime:

* If I follow the Esri doc and create a very simple AndroidOpenSSL.Build.cs file that merely calls the AdditionalPropertiesForReceipt.Add function, I get a runtime dialog box saying Unreal couldn't find the module "AndroidOpenSSL".

* If I add lines calling "PublicAdditionalLibraries.Add" for each of the two OpenSSL libraries, the app crashes on startup, and LogCat tells me "dlopen failed: library "libcrypto.so.1.1" not found: needed by /data/app/~~4rD_korI4tweVUi6c70fBA==/com.esri.apl.myproj3-lsFLIEb_hOa95NYNOXaEzg==/lib/arm64/libUnreal.so in namespace classloader-namespace".

 

Most of the unreal forum discussions on this date back to 2015-2016 and most don't have any responses to the question. Any help you can give here would be greatly appreciated.

[Edit] I should add that the libcrypto and libssl libraries in question were compiled from source and target an arm64 architecture. They function just fine in a Unity app.

Thanks in advance.

[Update]

While it would be most elegant to create a plugin for the Android OpenSSL libraries, in the interest of time I tried modifying the ArcGISMapsSDK plugin.

  • I added the two .so files to <project>\Plugins\ArcGISMapsSDK\Binaries\ThirdParty\ArcGISMapsSDK\Android\arm64
  • Modified <project>\Plugins\ArcGISMapsSDK\Source\ArcGISMapsSDK\ArcGISMapsSDK_APL.xml to include these lines:

 

<log text="Copying libcrypto_1_1.so"/>
<copyFile
	src="$S(PluginDir)/../../Binaries/ThirdParty/ArcGISMapsSDK/Android/arm64/libcrypto_1_1.so"
	dst="$S(BuildDir)/libs/arm64-v8a/libcrypto_1_1.so"
/>
<log text="Copying libssl_1_1.so"/>
<copyFile
	src="$S(PluginDir)/../../Binaries/ThirdParty/ArcGISMapsSDK/Android/arm64/libssl_1_1.so"
	dst="$S(BuildDir)/libs/arm64-v8a/libssl_1_1.so"
/>

 

This seems to do the trick. I'll just keep a copy of this augmented ArcGISMapsSDK Plugin for use in future projects.

0 Kudos
0 Replies