How to build x86 and ARM in a single apk under Xamarin?

回眸只為那壹抹淺笑 提交于 2019-12-12 02:16:58

问题


In my setup, I have a simple Xamarin app MyApp under Visual Studio 2015. The wizard automatically generates various sub-projects such as MyApp.Droid, MyApp.iOS, etc. I also have a C++ Android Shared Dynamic Library project MyShared in the solution and MyApp.Droid has a reference to MySharedproject. Here is the relevant information from MyApp.Droid.csproj file:

<ItemGroup>
  <ProjectReference Include="..\..\MyShared\MyShared.vcxproj">
    <Project>{4301be08-ecf3-4c36-a487-473858bc5506}</Project>
    <Name>MyShared</Name>
    <TargetPlatformIdentifier>Android</TargetPlatformIdentifier>
    <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
  </ProjectReference>
  <ProjectReference Include="..\MyApp\MyApp.csproj">
    <Project>{321FA0D9-3F50-4AC3-8F86-4E97DCA3FA86}</Project>
    <Name>MyApp</Name>
  </ProjectReference>
</ItemGroup>

Project MyApp.Droid also has armeabi-v7a and x86 platforms selected under Properties-->Android Options-->Advanced settings.

When I build the solution and export the apk file, here is what I see under lib/ directory:

lib/x86/libMyShared.so
lib/x86/libmonodroid.so
lib/x86/libmonosgen-2.0.so

lib/armeabi-v7a/libmonodroid.so
lib/armeabi-v7a/libmonosgen-2.0.so

As you can see, libMyShared.so is missing for armeabi-v7a architecture.

How do I configure the project such that libMyShared.so is built and pulled in for both the architectures? Regards.

来源:https://stackoverflow.com/questions/39456262/how-to-build-x86-and-arm-in-a-single-apk-under-xamarin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!