Android Packaging Failed,NullReferenceException

时间:2011-06-09 19:55:24

标签: c# android deployment build mono

      C:\Program Files (x86)\MSBuild\Novell\mandroid.exe -v --nosign --sdk-dir="C:\android-sdk-windows" --builddir="C:\dotnetdev\MapDroid\obj\Debug\android" --framework-dir="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v2.2" --framework-dir="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0" -S="C:\dotnetdev\MapDroid\obj\Debug\res" --package="MapDroid.MapDroid"   --nolink --abi="armeabi" --java-sdk-dir="C:\Program Files (x86)\Java\jdk1.6.0_26" --debug --manifest-template="C:\dotnetdev\MapDroid\Properties\AndroidManifest.xml" --sdk-platform="8" "C:\dotnetdev\MapDroid\bin\Debug\MapDroid.dll" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v2.2\Mono.Android.dll" "C:\dotnetdev\MonoMap\bin\Debug\MonoMap.dll" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.dll" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.Linq.dll" 
monodroid : error 1: System.NullReferenceException: Object reference not set to an instance of an object [C:\dotnetdev\MapDroid\MapDroid.csproj]
    at MonoDroid.Utils.ProcessRocks+<ReadStandardOutput>c__Iterator5.MoveNext () [0x00000] in <filename unknown>:0 
    at Monodroid.Toolbox.InvokeCommand (IEnumerable`1 commandLine) [0x00000] in <filename unknown>:0 
    at Monodroid.Toolbox.InvokeAapt (System.String packageName) [0x00000] in <filename unknown>:0 
    at Monodroid.Droidinator.CreatePackagedResources (System.Collections.Generic.List`1 javaTypes) [0x00000] in <filename unknown>:0 
    at Monodroid.Droidinator.CreateApk () [0x00000] in <filename unknown>:0 
    at Monodroid.MainClass.Main (System.String[] argv) [0x00000] in <filename unknown>:0 
Done Building Project "C:\dotnetdev\MapDroid\MapDroid.csproj" (SignAndroidPackage target(s)) -- FAILED.

这就是我认为构建日志中最相关的部分,尤其是......

error 1: System.NullReferenceException: Object reference not set to an instance of an object [C:\dotnetdev\MapDroid\MapDroid.csproj]

任何想法为什么会这样?

如果我只是运行构建,它会成功完成,但设备的打包错误......

使用Mono for Android

我还更新了包含完整的构建输出 - &gt; http://pastie.org/2044724

1 个答案:

答案 0 :(得分:0)

如果您使用的是免费版MonoDroid,您将无法从VS内部直接打包,签名和部署到设备。我猜最后一行包含错误的来源。 否则,我看到构建引擎找不到Newtonsoft.Json.Silverlight。 如果应用程序在模拟器上运行,则可以确认第一个问题的性质。