我正在尝试使用Mac上的msbuild和Mono构建Android项目。
这是我尝试过的:
为MacOSX安装了mono
从github repo安装的msbuild工具(分支xplat)
https://github.com/Microsoft/msbuild/wiki/Building-Testing-and-Debugging-on-.Net-Core-MSBuild
我在msbuild clonned dir中执行了命令
使用Mono MSBuild主机:./ cibuild --host Mono
安装dependecies后,我尝试使用以下命令构建应用程序:
msbuild BuildTypes/InstrumentMobileAndroid.proj /t:projectName_DeveloperBuild /p:Configuration=debug /p:Clean=no /p:Abi=armeabi-v7a /p:Parallelize=8 /m /fileLogger /flp:LogFile=AndroidBuild.log
以下异常返回:
"myWorkspace/myProject/myProject_II_/BuildTypes/InstrumentMobileAndroid.proj" (myProjectII_DeveloperBuild target) (1) ->
myWorkspace/myProject/myProject_II_/BuildTypes/InstrumentMobile.targets(15,13): error MSB4226: The imported project "/Library/Frameworks/Mono.framework/Versions/4.4.2/lib/mono/xbuild/ExtensionPack/4.0/MSBuild.ExtensionPack.tasks" was not found. Also, tried to find "ExtensionPack/4.0/MSBuild.ExtensionPack.tasks" in the fallback search path(s) for $(MSBuildExtensionsPath) - "/Library/Frameworks/Mono.framework/External/xbuild/" . These search paths are defined in "/Library/Frameworks/Mono.framework/Versions/4.4.2/lib/mono/msbuild/14.1/bin/MSBuild.exe.config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths. [myWorkspace/myProject/myProject_II_/BuildTypes/InstrumentMobileAndroid.proj]
我尝试为此找到任何有用的解决方案(例如使用 ./ cibuild.sh --target CoreCLR 定位到.NetCore),但总是有相同的结果。
我是新用的Mac上的msbuild,我坚持这个。
如何以正确的方式做到这一点?
非常感谢您的任何建议。