Monodroid 打包时空指针
Windows 7 x64 / VS 2010 Pro 上最新版本的 MonoDroid。
简单的示例效果很好,但在我的“真实”应用程序上,我在打包时得到一个空指针(在尝试运行应用程序后,或从构建菜单中选择“包”选项后)。
相关输出如下所示:
C:\程序文件 (x86)\MSBuild\Novell\mandroid.exe -v --nosign --sdk-dir="C:\Program Files (x86)\Android\android-sdk-windows" --builddir="[LOCALPATH]Clients[NAMESPACE].Android\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="[LOCALPATH]Clients[NAMESPACE].Android\obj\Debug\res" --package="[NAMESPACE]" --nolink --noshared --abi="armeabi" --java-sdk-dir= “C:\ Program Files(x86)\ Java \ jdk1.6.0_24”--debug --manifest-template =“[LOCALPATH]Clients [NAMESPACE].Android \ Properties \ AndroidManifest.xml” --sdk-platform="8" "[LOCALPATH]Clients[NAMESPACE].Android\bin\Debug[ASSEMBLY].dll" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v2. 2\Mono.Android.dll”“C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll” “[LOCALPATH]Android\Core[NAMESPACE].Client.Android\bin\Debug[NAMESPACE].Client.Android.dll”“[LOCALPATH]Android\Core[NAMESPACE].Core.Android\bin\Debug[NAMESPACE]。 Core.Android.dll" "[LOCALPATH]Android[NAMESPACE].Diagnostics.Android\bin\Debug[NAMESPACE].Diagnostics.Android.dll" “[LOCALPATH]Android[NAMESPACE].Logging.Android\bin\Debug[NAMESPACE].Logging.Android.dll”“[LOCALPATH]Android\Core[NAMESPACE].Services.Android\bin\Debug[NAMESPACE].Services。 Android.dll" "[LOCALPATH]Android\Shared[NAMESPACE].Utils.Android\bin\Debug[NAMESPACE].Utils.Android.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文件 (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.Linq.dll" monodroid:错误1:System.NullReferenceException:未将对象引用设置为对象的实例[[LOCALPATH]Clients[NAMESPACE].Android[NAMESPACE].Android.csproj] 在 MonoDroid.Utils.ProcessRocks+c__Iterator5.MoveNext () [0x00000] 处:0 在 Monodroid.Toolbox.InvokeCommand (IEnumerable1 commandLine) [0x00000] in <文件名未知>:0 在 Monodroid.Toolbox.InvokeAapt (System.String packageName) [0x00000] <文件名未知>:0 在 Monodroid.Droidinator.CreatePackagingResources (System.Collections.Generic.List
1 javaTypes) [0x00000] 中:0 在 Monodroid.Droidinator.CreateApk () [0x00000] 中:0 在 Monodroid.MainClass.Main (System.String[] argv) [0x00000] 中:0 完成构建项目“[LOCALPATH]Clients[NAMESPACE].Android[NAMESPACE].Android.csproj”(SignAndroidPackage 目标)——失败。
构建失败。
“[LOCALPATH]Clients[NAMESPACE].Android[NAMESPACE].Android.csproj”(SignAndroidPackage 目标)(1) -> (_CompileAndroidPackage目标)-> monodroid :错误 1:System.NullReferenceException:未将对象引用设置为对象的实例 [[LOCALPATH]Clients[NAMESPACE].Android[NAMESPACE].Android.csproj]
由于一个简单的示例有效,因此它必须是我的项目中的内容但我不知道从哪里开始寻找...有人有提示吗?
提前致谢
Latest version of MonoDroid on Windows 7 x64 / VS 2010 Pro.
Simple examples work great, but on my 'real' app I get a null pointer when packaging (either after trying to run the app, or selecting the 'package' options from the build menu.
The relevant output looks like this:
C:\Program Files (x86)\MSBuild\Novell\mandroid.exe -v --nosign --sdk-dir="C:\Program Files (x86)\Android\android-sdk-windows" --builddir="[LOCALPATH]Clients[NAMESPACE].Android\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="[LOCALPATH]Clients[NAMESPACE].Android\obj\Debug\res" --package="[NAMESPACE]" --nolink --noshared --abi="armeabi" --java-sdk-dir="C:\Program Files (x86)\Java\jdk1.6.0_24" --debug --manifest-template="[LOCALPATH]Clients[NAMESPACE].Android\Properties\AndroidManifest.xml" --sdk-platform="8" "[LOCALPATH]Clients[NAMESPACE].Android\bin\Debug[ASSEMBLY].dll" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v2.2\Mono.Android.dll" "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll" "[LOCALPATH]Android\Core[NAMESPACE].Client.Android\bin\Debug[NAMESPACE].Client.Android.dll" "[LOCALPATH]Android\Core[NAMESPACE].Core.Android\bin\Debug[NAMESPACE].Core.Android.dll" "[LOCALPATH]Android[NAMESPACE].Diagnostics.Android\bin\Debug[NAMESPACE].Diagnostics.Android.dll" "[LOCALPATH]Android[NAMESPACE].Logging.Android\bin\Debug[NAMESPACE].Logging.Android.dll" "[LOCALPATH]Android\Core[NAMESPACE].Services.Android\bin\Debug[NAMESPACE].Services.Android.dll" "[LOCALPATH]Android\Shared[NAMESPACE].Utils.Android\bin\Debug[NAMESPACE].Utils.Android.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 [[LOCALPATH]Clients[NAMESPACE].Android[NAMESPACE].Android.csproj]
at MonoDroid.Utils.ProcessRocks+c__Iterator5.MoveNext () [0x00000] in :0
at Monodroid.Toolbox.InvokeCommand (IEnumerable1 commandLine) [0x00000] in <filename unknown>:0
1 javaTypes) [0x00000] in :0
at Monodroid.Toolbox.InvokeAapt (System.String packageName) [0x00000] in <filename unknown>:0
at Monodroid.Droidinator.CreatePackagedResources (System.Collections.Generic.List
at Monodroid.Droidinator.CreateApk () [0x00000] in :0
at Monodroid.MainClass.Main (System.String[] argv) [0x00000] in :0
Done Building Project "[LOCALPATH]Clients[NAMESPACE].Android[NAMESPACE].Android.csproj" (SignAndroidPackage target(s)) -- FAILED.
Build FAILED.
"[LOCALPATH]Clients[NAMESPACE].Android[NAMESPACE].Android.csproj" (SignAndroidPackage target) (1) ->
(_CompileAndroidPackage target) ->
monodroid : error 1: System.NullReferenceException: Object reference not set to an instance of an object [[LOCALPATH]Clients[NAMESPACE].Android[NAMESPACE].Android.csproj]
Since a simple example works, it must be something in my project but I have no idea where to start looking... Does anyone have a hint?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过创建一个新的 Android 应用程序并逐步向其中添加项目,直到遇到问题为止,解决了这个问题。
问题出在我的 AndroidManifest.xml 上,其中包含以下内容:
最初该应用程序仅支持 2.3 及更高版本,但在某些时候我们将其回滚到 2.2。我不知道这是否是导致问题的原因。 删除: 可以解决问题。
但是,通过从该标签中
Figured this out by creating a new Android app and progressively adding items to it until I hit the problem.
The issue was with my AndroidManifest.xml, which contained the following:
Originally the app supported 2.3 and higher only, but at some point we rolled it back to 2.2. Whether this is what introduced the issue or not, I don't know. However the problem is resolved by removing:
From that tag.