Problem generating APK with native libraries

pdsrpdsr Member

Hello there,

I'm fairly new using Xamarin and am trying to build my apk using the VS command line (yes, it needs to be via the command line).​

From all the threads and articles I've read, I found that I need to run something like this:
msbuild MyProject.csproj /p:Configuration=Release /t:PackageForAndroid

The problem lies on the fact that I have a Native library (.so) that I need to attach to the APK.

So, when I run that command, msbuild throws me an error saying that:

_BuildLibraryImportsCache: Skipping target "_BuildLibraryImportsCache" because all output files are up-to-date with respect to the input files. C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common\ImportAfter\Microsoft.Cpp.Android.targets(39,9): error : Building the project outside of a solution is not supported since it contains project references to native libraries that need to be built for specific platforms and configurations. [C:\code\MyProject\src\Interop.Android\Interop.Android.csproj] Done Building Project "C:\code\MyProject\src\Interop.Android\Interop.Android.csproj" (default targets) -- FAILED.

Has anyone encountered this issue or managed to find a solution?

Every single post or thread that I read, people can successfully run that command because they're not dependant on any native libraries, so I couldn't find any way of doing what I need to do.

Thanks in advance.

Sign In or Register to comment.