File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unhandled exception prevents my game from running

 
John Nellany
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used to be in college doing computer games development, I haven't programmed in years but recently something came up and I need to start again. Android really frustrates me I'm running some source code and i had it working but now there are errors once it runs and then the app crashes (emulator 4.0 and phone 2.1) and the project is set for 2.0 is that the issue? I assume backward compatability.

03-01 02:01:51.876: D/AndroidRuntime(7464): Shutting down VM
03-01 02:01:51.876: W/dalvikvm(7464): threadid=3: thread exiting with uncaught exception (group=0x40026160)
03-01 02:01:51.876: E/AndroidRuntime(7464): Uncaught handler: thread main exiting due to uncaught exception
03-01 02:01:51.876: E/AndroidRuntime(7464): java.lang.IllegalArgumentException: Supplied TextureSource must not exceed bounds of Texture.
03-01 02:01:51.876: E/AndroidRuntime(7464): at org.anddev.andengine.opengl.texture.Texture.checkTextureSourcePosition(Texture.java:145)
03-01 02:01:51.876: E/AndroidRuntime(7464): at org.anddev.andengine.opengl.texture.Texture.addTextureSource(Texture.java:131)
03-01 02:01:51.876: E/AndroidRuntime(7464): at org.anddev.andengine.opengl.texture.region.TextureRegionFactory.createFromSource(TextureRegionFactory.java:89)
03-01 02:01:51.876: E/AndroidRuntime(7464): at org.anddev.andengine.opengl.texture.region.TextureRegionFactory.createFromAsset(TextureRegionFactory.java:67)
03-01 02:01:51.876: E/AndroidRuntime(7464): at theHardestGame.pac.GameLogicController.onLoadResources(GameLogicController.java:207)
03-01 02:01:51.876: E/AndroidRuntime(7464): at org.anddev.andengine.ui.activity.BaseGameActivity.doResume(BaseGameActivity.java:158)
03-01 02:01:51.876: E/AndroidRuntime(7464): at org.anddev.andengine.ui.activity.BaseGameActivity.onWindowFocusChanged(BaseGameActivity.java:83)
03-01 02:01:51.876: E/AndroidRuntime(7464): at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:1969)
03-01 02:01:51.876: E/AndroidRuntime(7464): at android.view.View.dispatchWindowFocusChanged(View.java:3785)
03-01 02:01:51.876: E/AndroidRuntime(7464): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:741)
03-01 02:01:51.876: E/AndroidRuntime(7464): at android.view.ViewRoot.handleMessage(ViewRoot.java:1819)
03-01 02:01:51.876: E/AndroidRuntime(7464): at android.os.Handler.dispatchMessage(Handler.java:99)
03-01 02:01:51.876: E/AndroidRuntime(7464): at android.os.Looper.loop(Looper.java:123)
03-01 02:01:51.876: E/AndroidRuntime(7464): at android.app.ActivityThread.main(ActivityThread.java:4370)
03-01 02:01:51.876: E/AndroidRuntime(7464): at java.lang.reflect.Method.invokeNative(Native Method)
03-01 02:01:51.876: E/AndroidRuntime(7464): at java.lang.reflect.Method.invoke(Method.java:521)
03-01 02:01:51.876: E/AndroidRuntime(7464): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-01 02:01:51.876: E/AndroidRuntime(7464): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-01 02:01:51.876: E/AndroidRuntime(7464): at dalvik.system.NativeStart.main(Native Method)
03-01 02:01:51.916: E/SemcCheckin(7464): Get crash dump level : java.io.FileNotFoundException: /data/semc-checkin/crashdump

03-01 02:01:51.926: I/dalvikvm(7464): threadid=7: reacting to signal 3
03-01 02:01:51.926: I/dalvikvm(7464): Wrote stack trace to '/data/anr/traces.txt'


Thank you peter for the introduction,
You're help would be greatly appericated


I'm loading all my images to the screen onLoadResources

this.mMenuTexture = new Texture(256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
this.mMenuResetTextureRegion = TextureRegionFactory.createFromAsset(this.mMenuTexture, this, "gfx/menuPlay.png", 0, 0);
this.mMenuQuitTextureRegion = TextureRegionFactory.createFromAsset(this.mMenuTexture, this, "gfx/menuQuit.png", 0, 50);
this.mMenuSettingsTextureRegion = TextureRegionFactory.createFromAsset(this.mMenuTexture, this, "gfx/menuSettings.png", 0, 100);

this.mSubMenuTexture = new Texture(256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
this.mMenuOkTextureRegion = TextureRegionFactory.createFromAsset(this.mSubMenuTexture, this, "gfx/menuOk.png", 0, 0);
this.mMenuBackTextureRegion = TextureRegionFactory.createFromAsset(this.mSubMenuTexture, this, "gfx/menuBack.png", 0, 50);

this.mEnemyTexture = new Texture(64, 64, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
enemyTextureRegion = TextureRegionFactory.createFromAsset(this.mEnemyTexture, this, "gfx/enemyA.png", 0, 0);
...
...

...

this.mEngine.registerUpdateHandler(new FPSLogger());
this.mEngine.getTextureManager().loadTextures(this.mLevelButtonDisabled,this.mLevelSignTextures, this.mMenuTexture, this.mSubMenuTexture, this.mTexture, this.mEnemyTexture, this.mFinishLineTexture, this.mBlockTexture, this.mDiamantTexture, this.mLevelMenuTexture
, this.mLevelChooseBackTexture, this.mLevelChooseMenuTexture, this.mLevelChooseNextTexture, this.mLevelTexture1, this.mBackgroundTexture);

}
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John, welcome to Java Ranch!

It would have been better if you copied and pasted the text, rather than posting a screen shot. We need to see the rest of the exception that starts:

java.lang.IllegalArgumentExcpetion: Supplied TextureSource must not exceed...

Also, check what you are doing in theHardestGame.pac.GameLogicController.onLoadResources().

It would also help you to see the line numbers...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic