Open
Description
Running the sample project with shared objects on you'll see the following error on Android
2025-05-08 13:09:35.676 26697-26788 Urho3D io.urho3d E [13:09:35] [error] [main] : Failed to load plugin 'App.Main'
The problems are in (1)
ModulePlugin::NameToPath
and (2)
DynamicModule::ReadModuleInformation
These are the workarounds so far, a better fix to come...
(1) ModulePlugin::NameToPath:
Gives the wrong path name for an APK as there is no option for Android
Workaround:
ea::string ModulePlugin::NameToPath(const ea::string& name) const
{
FileSystem* fs = context_->GetSubsystem<FileSystem>();
ea::string result;
#if defined(__ANDROID__)
return Format("lib{}{}", name, DYN_LIB_SUFFIX);
#elif __linux__ || __APPLE__
result = Format("{}lib{}{}", fs->GetProgramDir(), name, DYN_LIB_SUFFIX);
if (fs->FileExists(result))
return result;
#endif
#if !_WIN32
...
}
(2) DynamicModule::ReadModuleInformation
Same issue, no case for android. Function needs updated.
Workaround:
bool DynamicModule::Load(const ea::string& path)
{
...
#if defined(__ANDROID__) // Hack to just pass the module as native on android for now
if (path.ends_with(".so")) {
moduleType_ = MODULE_NATIVE;
}
#else
// Needs to be fixed in here
moduleType_ = ReadModuleInformation(context_, path);
#endif
...
}
Metadata
Metadata
Assignees
Labels
No labels