---
title: "AndEngineExamples 运行编译"
author: "喧嚣求静"
date: "2013-05-01T14:38:51Z"
tags: []
categories: ["移动开发"]
slug: "andengineexamples"
draft: false
lastmod: "2014-09-19T17:24:06Z"
id: 1857127
url: "https://913.iteye.com/blog/1857127"
---

1.[AndEngine介绍](http://baike.baidu.com/view/4614511.htm)（百度百科）

 

2.下载git工具

 a.下载git for windows版(这个客户端)

b.下载windows install安装服务包()，在博客附件中(xp版的，其他版本可找TortoiseGit for windows 安装提示)，提供，也可以去微软下载

c.下载客户端操作工具TortoiseGit for windows

 

3.[下载AndEngineExamples源码](https://github.com/nicolasgramlich/AndEngineExamples)

有图有文字有真相 [AdnEngine开发环境搭建](http://www.apk-doc.net/game/andengine-cfg.html)

下面列出编译必须扩展，在AndEngineExamples工程

/AndEngineExamples/project.properties

target=android-17  
split.density=false  
android.library.reference.3=../AndEngineMODPlayerExtension  
android.library.reference.4=../AndEngineSVGTextureRegionExtension  
android.library.reference.1=../AndEngine  
android.library.reference.2=../AndEngineAugmentedRealityExtension  
android.library.reference.6=../AndEngineTexturePackerExtension  
android.library.reference.5=../AndEnginePhysicsBox2DExtension  
android.library.reference.7=../AndEngineMultiplayerExtension  
android.library.reference.8=../AndEngineLiveWallpaperExtension  
android.library.reference.9=../AndEngineTMXTiledMapExtension  
android.library.reference.10=../AndEngineScriptingExtension

  下载引用源码

[去代码库](https://github.com/nicolasgramlich)

 

4.编译AndEngineExamples源码

![](http://dl.iteye.com/upload/attachment/0083/8738/eed51ccb-0661-3d77-aab9-129c1d2c3298.jpg)

有编译错误

![](http://dl.iteye.com/upload/attachment/0083/8740/3d7439dc-e450-3093-b3b7-278fe649b01f.jpg)

 

解决错误：

Description Resource Path Location Type  
DrawMode cannot be resolved to a variable HullAlgorithmExample.java /AndEngineExamples/src/org/andengine/examples line 168 Java Problem  
引入 这个import org.andengine.entity.primitive.DrawMode;

 

Description Resource Path Location Type  
The constructor TextOptions(AutoWrap, float, float, HorizontalAlign) is undefined TextBreakExample.java /AndEngineExamples/src/org/andengine/examples line 106 Java Problem  
注释的为报错的

//this.mText = new Text(50, 40, this.mFont, "", 1000, new TextOptions(AutoWrap.LETTERS, AUTOWRAP\_WIDTH, Text.LEADING\_DEFAULT, HorizontalAlign.CENTER), vertexBufferObjectManager);  
  this.mText = new Text(50, 40, this.mFont, "", 1000, new TextOptions(AutoWrap.LETTERS, AUTOWRAP\_WIDTH,  HorizontalAlign.CENTER, Text.LEADING\_DEFAULT), vertexBufferObjectManager);    
 

 

Description Resource Path Location Type  
Type mismatch: cannot convert from void to AnimatedSprite BoundCameraExample.java /AndEngineExamples/src/org/andengine/examples line 220 Java Problem

注释的为报错的  
//final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager()).animate(100);  
  final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager());   
  face.animate(100);

 

Description Resource Path Location Type  
Type mismatch: cannot convert from void to AnimatedSprite SplitScreenExample.java /AndEngineExamples/src/org/andengine/examples line 179 Java Problem

注释的为报错的  
//final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager()).animate(100);  
  final AnimatedSprite face = new AnimatedSprite(pX, pY, this.mBoxFaceTextureRegion, this.getVertexBufferObjectManager());   
  face.animate(100);

 

编译通过啦

 

参考文档：

[http://blog.csdn.net/lc204/article/details/8071876](http://blog.csdn.net/lc204/article/details/8071876) -编译报错问题

[http://blog.csdn.net/onerain88/article/details/7257659](http://blog.csdn.net/onerain88/article/details/7257659)-源码下载操作