“找不到类型或名称空间Box2D".在Android(Xamarin/CocosSharp)上 [英] "Type or namespace Box2D could not be found" on Android (Xamarin/CocosSharp)

查看:126
本文介绍了“找不到类型或名称空间Box2D".在Android(Xamarin/CocosSharp)上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在共享项目中使用Xamarin/Cocossharp构建了一个简单的游戏. 我在Box2D中添加了一些物理原理,并且在WP8.1上一切正常.

Im building a simple game with Xamarin/Cocossharp in a Shared Project. I added some physics with Box2D and everything works well on WP8.1.

我导入Box2D并可以在Windows Phone上毫无问题地访问所提供的方法和类,但是当我尝试为Android对其进行编译时,它说找不到类型或名称空间"Box2D". Intellisense没有显示任何错误...

I import Box2D and i access to the methods and class provided without problem on Windows Phone, but when i try to compile it for Android it says that the type or namespace "Box2D" could not be found. Intellisense doesn't shows any error...

错误输出

我是游戏开发人员和VS2015的新手,所以这可能很简单,但我不明白我在这里缺少什么.

I'm new to game dev and also to VS2015 so it may be something simple but i dont understand what I'm missing here.

预先感谢

推荐答案

在为此苦苦挣扎之后,我设法解决了这个问题:

After struggling around with this i managed to fix this:

Sven-Michael 指出,解决方案是安装:

As pointed out from Sven-Michael in his answer the solution was to install:

CocosSharp.PCL.Shared 

来自NuGet.就我而言,只需要添加对包含在软件包中的Box2D.DLL文件的引用.

from NuGet. In my case was only necessary to add the reference to the Box2D.DLL file contained into the package.

它对我不起作用的原因可能是因为试图解决此问题,我弄乱了我的解决方案并引起了其他问题.因此,我从skratch创建了一个新项目,然后再次导入了我的源代码.

The reason why it was not working for me it's probably that because of trying to solve this problem I've messed up whit my solution and caused other problems. So I created a new Project from skratch and I've imported my source code again.

这篇关于“找不到类型或名称空间Box2D".在Android(Xamarin/CocosSharp)上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆