Click here to Skip to main content
15,896,730 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
i tried making an android app with andengine and i used eclipse for it ,but when i run it, it shows the message "unfortunately,app has stopped". what is the reason? here is the java code:

package your.packhage.namespace;
import java.io.IOException;
import org.andengine.engine.camera.Camera;
import org.andengine.engine.options.EngineOptions;
import org.andengine.engine.options.ScreenOrientation;
import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.andengine.entity.scene.Scene;
import org.andengine.entity.sprite.Sprite;
import org.andengine.entity.util.FPSLogger;
import org.andengine.opengl.texture.ITexture;
import org.andengine.opengl.texture.bitmap.AssetBitmapTexture;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.texture.region.TextureRegionFactory;
import org.andengine.ui.activity.SimpleBaseGameActivity;
import org.andengine.util.adt.color.Color;

public class GgActivity extends SimpleBaseGameActivity {

private static final int CAMERA_WIDTH = 800;
private static final int CAMERA_HEIGHT = 480;
private ITexture mHelloWorldTexture;
private ITextureRegion mHelloWorldTextureRegion;
@Override
public EngineOptions onCreateEngineOptions() {
final Camera camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
return new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR,
new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera);
}
@Override
public void onCreateResources() throws IOException {
this.mHelloWorldTexture = new AssetBitmapTexture(this.getTextureManager(),
this.getAssets(), "helloworld.png");
this.mHelloWorldTextureRegion = TextureRegionFactory.extractFromTexture(
this.mHelloWorldTexture);
this.mHelloWorldTexture.load();
}
@Override
public Scene onCreateScene() {
this.mEngine.registerUpdateHandler(new FPSLogger());
final Scene scene = new Scene();
scene.getBackground().setColor(Color.YELLOW);
final float centerX = CAMERA_WIDTH / 2;
final float centerY = CAMERA_HEIGHT / 2;
final Sprite sprite = new Sprite(centerX, centerY,
this.mHelloWorldTextureRegion, this.getVertexBufferObjectManager());
scene.attachChild(sprite);
return scene;
}
}
here is the logcat:

??-?? ??:??:??.???: INFO/<unknown>(<unknown>): No JNI_OnLoad found in /data/app-lib/your.packhage.namespace-1/libandengine.so 0x416ecf98, skipping init

??-?? ??:??:??.???: INFO/<unknown>(<unknown>): Skipped 48 frames! The application may be doing too much work on its main thread.
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-02 07:41:19.986 1288: 1288 D/gralloc_goldfish ]
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): Emulator without GPU emulation detected.
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-02 07:41:19.996 1288: 1304 W/dalvikvm ]
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): threadid=13: thread exiting with uncaught exception (group=0x41465700)
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-02 07:41:20.006 1288: 1304 E/AndroidRuntime ]
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): FATAL EXCEPTION: GLThread 117
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): java.lang.IllegalArgumentException: No EGLConfig found!
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at org.andengine.opengl.view.ConfigChooser.chooseConfig(ConfigChooser.java:229)
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at org.andengine.opengl.view.ConfigChooser.chooseConfig(ConfigChooser.java:203)
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1024)
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1401)
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-02 07:41:20.036 285: 530 W/ActivityManager ]
Posted
Comments
[no name] 2-Jul-15 10:50am    
http://www.bing.com/search?q=No+EGLConfig+found
Member 11807654 3-Jul-15 9:28am    
thanks a lot.I searched it and the problem was solved :)))))

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900