1

我是 android 新手...我想使用 Andengine 创建简单的 android 游戏。你能告诉我如何在 Eclipse 中安装 Andengine……我在 linux 上使用 Eclipse。

编辑:

Andengine 已安装,但我在 logcat 中收到此错误消息:

  02-09 00:36:53.562: ERROR/AndEngine(501): java.io.FileNotFoundException: ggg
  02-09 00:36:53.562: ERROR/AndEngine(501): at android.content.res.AssetManager.
  openAsset(Native Method)
 02-09 00:36:53.562: ERROR/AndEngine(501): at android.content.res.AssetManager
 .open(AssetManager.java:313)
 02-09 00:36:53.562: ERROR/AndEngine(501): at android.content.res.AssetManager
 .open(AssetManager.java:287)
 02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.opengl.texture
.source.AssetTextureSource.<init>(AssetTextureSource.java:46)
 02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.opengl.texture
 .region.TextureRegionFactory.createFromAsset(TextureRegionFactory.java:66)
  02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.examples.minimal
   .AndEngineMinimalExample.onLoadResources(AndEngineMinimalExample.java:59)
 02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.ui.activity
 .BaseGameActivity.doResume(BaseGameActivity.java:158)
 02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.ui.activity
 .BaseGameActivity.onWindowFocusChanged(BaseGameActivity.java:83)
 02-09 00:36:53.562: ERROR/AndEngine(501): at com.android.internal.policy.impl
 .PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:1981)
 02-09 00:36:53.562: ERROR/AndEngine(501): at android.view.View
 .dispatchWindowFocusChanged(View.java:3788)
 02-09 00:36:53.562: ERROR/AndEngine(501): at android.view.ViewGroup
 .dispatchWindowFocusChanged(ViewGroup.java:658)
  02-09 00:36:53.562: ERROR/AndEngine(501):     at   
  android.view.ViewRoot.handleMessage(ViewRoot.java:1921)
  02-09 00:36:53.562: ERROR/AndEngine(501):     at 
  android.os.Handler.dispatchMessage(Handler.java:99)
  02-09 00:36:53.562: ERROR/AndEngine(501): at android.os.Looper.loop(Looper.java:123)
  02-09 00:36:53.562: ERROR/AndEngine(501): at
  android.app.ActivityThread.main(ActivityThread.java:4627)
  02-09 00:36:53.562: ERROR/AndEngine(501):     at 
   java.lang.reflect.Method.invokeNative(Native Method)
   02-09 00:36:53.562: ERROR/AndEngine(501):     at 
   java.lang.reflect.Method.invoke(Method.java:521)
   02-09 00:36:53.562: ERROR/AndEngine(501):     at 
   com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
   02-09 00:36:53.562: ERROR/AndEngine(501):     at 
   com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
   02-09 00:36:53.562: ERROR/AndEngine(501):     at dalvik.system.NativeStart.main
   (Native Method)
   02-09 00:36:53.821: DEBUG/dalvikvm(501): GC_EXTERNAL_ALLOC freed 1797 objects / 
   148120 bytes in 173ms
   02-09 00:36:54.160: DEBUG/libEGL(501): egl.cfg not found, using default config
   02-09 00:36:54.230: DEBUG/libEGL(501): loaded /system/lib/egl/libGLES_android.so
   02-09 00:36:54.425: DEBUG/AndEngine(501): onSurfaceCreated
   02-09 00:36:54.441: DEBUG/AndEngine(501): RENDERER: Android PixelFlinger 1.3
   02-09 00:36:54.500: DEBUG/AndEngine(501): VERSION: OpenGL ES-CM 1.0
   02-09 00:36:54.511: DEBUG/AndEngine(501): EXTENSIONS: GL_OES_byte_coordinates 
   GL_OES_fixed_point GL_OES_single_precision GL_OES_read_format  
   GL_OES_compressed_paletted_texture GL_OES_draw_texture GL_OES_matrix_get 
   GL_OES_query_matrix GL_OES_EGL_image GL_OES_compressed_ETC1_RGB8_texture 
   GL_ARB_texture_compression GL_ARB_texture_non_power_of_two   
   GL_ANDROID_user_clip_plane 
   GL_ANDROID_vertex_buffer_object GL_ANDROID_generate_mipmap 
   02-09 00:36:54.531: DEBUG/AndEngine(501): EXTENSIONS_VERXTEXBUFFEROBJECTS = false
   02-09 00:36:54.531: DEBUG/AndEngine(501): EXTENSIONS_DRAWTEXTURE = true
   02-09 00:36:54.541: DEBUG/AndEngine(501): onSurfaceChanged: pWidth=480  pHeight=320
   02-09 00:36:54.630: ERROR/AndEngine(501): Failed loading Bitmap in 
   AssetTextureSource. AssetPath: ggg
   02-09 00:36:54.630: ERROR/AndEngine(501): java.io.FileNotFoundException: ggg
   02-09 00:36:54.630: ERROR/AndEngine(501):     at 
   android.content.res.AssetManager.openAsset(Native Method)
   02-09 00:36:54.630: ERROR/AndEngine(501):     at 
   android.content.res.AssetManager.open(AssetManager.java:313)
   02-09 00:36:54.630: ERROR/AndEngine(501):     at 
   android.content.res.AssetManager.open(AssetManager.java:287)
   02-09 00:36:54.630: ERROR/AndEngine(501):     at 
   org.anddev.andengine.opengl.texture.source
  .AssetTextureSource.onLoadBitmap(AssetTextureSource.java:95)
   02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.texture
  .Texture$TextureSourceWithLocation.onLoadBitmap(Texture.java:364)
  02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.texture
  .Texture.writeTextureToHardware(Texture.java:208)
  02-09 00:36:54.630: ERROR/AndEngine(501):     at 
  org.anddev.andengine.opengl.texture.Texture.loadToHardware(Texture.java:175)
  02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.texture
  .TextureManager.updateTextures(TextureManager.java:136)
  02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.engine.Engine
 .onDrawFrame(Engine.java:508)
  02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.view
 .RenderSurfaceView$Renderer.onDrawFrame(RenderSurfaceView.java:148)
  02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.view
 .GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:617)
 02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.view
 .GLSurfaceView$GLThread.run(GLSurfaceView.java:549)
 02-09 00:36:54.751: ERROR/AndEngine(501): Error loading: AssetTextureSource(ggg)
 02-09 00:36:54.751: ERROR/AndEngine(501): java.lang.IllegalArgumentException: 
 TextureSource: AssetTextureSource(ggg) returned a null Bitmap.
 02-09 00:36:54.751: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.texture
 .Texture.writeTextureToHardware(Texture.java:211)
 02-09 00:36:54.751: ERROR/AndEngine(501):     at 
 org.anddev.andengine.opengl.texture.Texture.loadToHardware(Texture.java:175)
 02-09 00:36:54.751: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.texture
.TextureManager.updateTextures(TextureManager.java:136)
 02-09 00:36:54.751: ERROR/AndEngine(501):     at 
 org.anddev.andengine.engine.Engine.onDrawFrame(Engine.java:508)
 02-09 00:36:54.751: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.view
.RenderSurfaceView$Renderer.onDrawFrame(RenderSurfaceView.java:148)
 02-09 00:36:54.751: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.view
.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:617)
 02-09 00:36:54.751: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.view
 .GLSurfaceView$GLThread.run(GLSurfaceView.java:549)
 02-09 00:36:54.793: WARN/dalvikvm(501): threadid=7: thread exiting with uncaught 
 exception (group=0x4001d800)
 02-09 00:36:54.831: ERROR/AndroidRuntime(501): FATAL EXCEPTION: GLThread
 02-09 00:36:54.831: ERROR/AndroidRuntime(501): java.lang.IllegalArgumentException: 
 TextureSource: AssetTextureSource(ggg) returned a null Bitmap.
 02-09 00:36:54.831: ERROR/AndroidRuntime(501): at org.anddev.andengine.opengl.texture
 .Texture.writeTextureToHardware(Texture.java:211)
  02-09 00:36:54.831: ERROR/AndroidRuntime(501):at org.anddev.andengine.opengl.texture
  .Texture.loadToHardware(Texture.java:175)
 02-09 00:36:54.831: ERROR/AndroidRuntime(501):   at 
 org.anddev.andengine.opengl.texture
 .TextureManager.updateTextures(TextureManager.java:136)
 02-09 00:36:54.831: ERROR/AndroidRuntime(501):     at org.anddev.andengine.engine
 .Engine.onDrawFrame(Engine.java:508)
 02-09 00:36:54.831: ERROR/AndroidRuntime(501):     at org.anddev.andengine.opengl.view
 .RenderSurfaceView$Renderer.onDrawFrame(RenderSurfaceView.java:148)
 02-09 00:36:54.831: ERROR/AndroidRuntime(501):     at org.anddev.andengine.opengl.view
 .GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:617)
 02-09 00:36:54.831: ERROR/AndroidRuntime(501):     at org.anddev.andengine.opengl.view
 .GLSurfaceView$GLThread.run(GLSurfaceView.java:549)
 02-09 00:36:54.983: WARN/ActivityManager(66):Force finishing 
 activityorg.anddev.andengine.examples.minimal/.AndEngineMinimalExample
 02-09 00:36:55.661: DEBUG/dalvikvm(66): GC_EXPLICIT freed 2704 objects / 
 163368 bytes in 265ms
02-09 00:36:55.743: INFO/WindowManager(66): Setting rotation to 0, animFlags=1
02-09 00:36:55.781: INFO/ActivityManager(66): Config changed: { scale=1.0 imsi=310/260 
loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=1 layout=18 uiMode=17 seq=13}
02-09 00:36:56.240: WARN/ActivityManager(66): Activity pause timeout for 
HistoryRecord{43fd2338 org.anddev
.andengine.examples.minimal/.AndEngineMinimalExample}
 02-09 00:36:56.922: WARN/IInputConnectionWrapper(288): showStatusIcon on inactive 
 InputConnection
  02-09 00:36:57.416: WARN/WindowManager(66): Window freeze timeout expired.
  02-09 00:36:57.416: WARN/WindowManager(66): Force clearing orientation change: 
  Window{43fecea8 StatusBarExpanded paused=false}
  02-09 00:36:57.431: WARN/WindowManager(66): Force clearing orientation change: 
   Window{43fba7b0 com.android.launcher/com.android.launcher2.Launcher paused=false}
   02-09 00:36:59.090: DEBUG/dalvikvm(335): GC_EXPLICIT freed 85 objects / 3560bytes   
  in 12084ms
 02-09 00:36:59.891: DEBUG/dalvikvm(66): GC_EXPLICIT freed 1126 objects / 61592 bytes 
 in 399ms
 02-09 00:37:07.941: WARN/ActivityManager(66): Activity destroy timeout for 
 HistoryRecord{43fd2338 org.anddev.andengine.examples.minimal/
 .AndEngineMinimalExample}
4

2 回答 2

2

只需将其添加andengine.jar到项目中的 lib 文件夹中(如果您没有创建它)

然后在项目构建路径上添加jar

你有它,你成功安装和引擎

于 2011-09-05T18:14:52.503 回答
1

如何真实获取完整资源

cd EclipseWorkspace/
hg clone https://code.google.com/p/andengine/ AndEngine
hg clone https://code.google.com/p/andenginelivewallpaperextension/ AndEngineLiveWallpaperExtension
hg clone https://code.google.com/p/andenginemodplayerextension/ AndEngineMODPlayerExtension
hg clone https://code.google.com/p/andenginemultiplayerextension/ AndEngineMultiplayerExtension
hg clone https://code.google.com/p/andenginemultitouchextension/ AndEngineMultiTouchExtension
hg clone https://code.google.com/p/andenginephysicsbox2dextension/ AndEnginePhysicsBox2DExtension
hg clone https://code.google.com/p/andengineaugmentedrealityextension/ AndEngineAugmentedRealityExtension
hg clone https://code.google.com/p/andenginesvgtextureregionextension/ AndEngineSVGTextureRegionExtension
hg clone https://code.google.com/p/andenginetexturepackerextension/ AndEngineTexturePackerExtension
hg clone https://code.google.com/p/andengineexamples/ AndEngineExamples
mkdir AndEngine/res
mkdir AndEngineLiveWallpaperExtension/res
mkdir AndEngineMODPlayerExtension/res
mkdir AndEngineMultiplayerExtension/res
mkdir AndEngineMultiTouchExtension/res
mkdir AndEnginePhysicsBox2DExtension/res
mkdir AndEngineAugmentedRealityExtension/res
mkdir AndEngineSVGTextureRegionExtension/res
mkdir AndEngineTexturePackerExtension/res

然后将所有项目导入eclipse的工作区并运行AndEngineExamples

于 2011-10-25T22:50:44.197 回答