问题
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