Xamarin - 使用xbuild构建一个添加了xamarin组件的项目

时间:2014-04-02 11:42:05

标签: xamarin json.net xbuild

Mac OS X上的Xbuild [Xamarin Studio]

我正在努力建立一个解决方案& (Visual Studio项目文件)csproj使用xbuild。 此解决方案包含一个项目 - 这不是启动项目,并且引用了Newtonsoft [使用xamarin组件添加]请注意该组件标记为“包含在此项目中。”

解决方案和项目在Xamarin中构建良好,但是删除整个解决方案及其文件。现在使用team city下载项目,然后使用Xbuild构建相同的解决方案,项目都失败,并显示以下错误消息:

我附上了错误消息的快照

    [18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Evidence/EvidenceNotRequired.cs(1,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Evidence/PhotoEvidence.cs(1,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Evidence/TextEvidence.cs(1,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Questions/BoundedQuestion.cs(3,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Questions/ExtendedInfoQuestion.cs(11,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Questions/InfoItem.cs(4,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Questions/MultiResponseQuestion.cs(11,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Questions/Question.cs(11,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

[18:01:48]  [Step 3/4] ../../../../NESQuestionFramework/NESQuestionFramework/Model/Questions/QuestionSet.cs(2,7): error CS0246: The type or namespace name `Newtonsoft' could not be found. Are you missing an assembly reference?

Xbuild会尝试使用ValidateAndroidPackage路径但是找不到Newtonsoft.Json包。

        Target _ValidateAndroidPackageProperties:

            GetAndroidPackageName Task

              ManifestFile: 

              AssemblyName: NESQuestionFramework

              PackageName: NESQuestionFramework.NESQuestionFramework

        Target _AndroidResolveAssemblyReferences:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:警告:参考'Newtonsoft.Json'未解决

            For searchpath {CandidateAssemblyFiles}

            Warning: {CandidateAssemblyFiles} not supported currently

            For searchpath {HintPathFromItem}

            Considered ../../Components/json.net-4.5.11/lib/android/Newtonsoft.Json.dll, but it does not exist.

            For searchpath {TargetFrameworkDirectory}

            Considered target framework dir /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v4.0.3, assembly named 'Newtonsoft.Json' not found.

            Considered target framework dir /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0, assembly named 'Newtonsoft.Json' not found.

            Considered target framework dir /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/, assembly named 'Newtonsoft.Json' not found.

            For searchpath {PkgConfig}

            Considered Newtonsoft.Json, but could not find in any pkg-config files.

            For searchpath {GAC}

            Considered Newtonsoft.Json, but could not find in the GAC.

            For searchpath {RawFileName}

            Considered '/Users/admin/Downloads/TeamCity/buildAgent/work/b998b8d1d0b0ff61/NESTouch/NESTouch.Android/NESQuestionFramework.Android/NESQuestionFramework.Android/Newtonsoft.Json' as a file, but the file does not exist

            For searchpath bin/Debug/

            Considered '/Users/admin/Downloads/TeamCity/buildAgent/work/b998b8d1d0b0ff61/NESTouch/NESTouch.Android/NESQuestionFramework.Android/NESQuestionFramework.Android/bin/Debug/Newtonsoft.Json' as a file, but the file does not exist

            Considered '/Users/admin/Downloads/TeamCity/buildAgent/work/b998b8d1d0b0ff61/NESTouch/NESTouch.Android/NESQuestionFramework.Android/NESQuestionFramework.Android/bin/Debug/Newtonsoft.Json.exe' as a file, but the file does not exist

            Considered '/Users/admin/Downloads/TeamCity/buildAgent/work/b998b8d1d0b0ff61/NESTouch/NESTouch.Android/NESQuestionFramework.Android/NESQuestionFramework.Android/bin/Debug/Newtonsoft.Json.dll' as a file, but the file does not exist

解决此问题的正确方法是什么? 目前我正在强迫开发人员登录服务器并使用xamarin studio手动构建解决方案[我相信会下载Newtonsoft]并使用xbuild随后每次运行它。 非常感谢你的时间

拉​​杰什

1 个答案:

答案 0 :(得分:0)

这有点旧,但我们正在使用nuget的json.net(newtonsoft) 这允许在解决方案上轻松运行nuget恢复。

作为一个解决方法,您可以从xamarin工作室运行mdtool,该工作正常(有一些限制)