Git Product home page Git Product logo

Comments (4)

alexkempton avatar alexkempton commented on August 17, 2024

By looking at Niffy's fix at nicolasgramlich/AndEngineTexturePackerExtension#2, there seems to be an easy fix. The solution is to change onCreateResources() in SpriteExample.java to:

@Override
public void onCreateResources() {
    try {
        this.mTexture = new BitmapTexture(this.getTextureManager(),  new IInputStreamOpener() {
            @Override
            public InputStream open() throws IOException {
                return getAssets().open("gfx/face_box.png");
            }
        });

        this.mTexture.load();
        this.mFaceTextureRegion = TextureRegionFactory.extractFromTexture(this.mTexture);
    } catch (IOException e) {
        Debug.e(e);
    }
}

from andengineexamples.

tauame avatar tauame commented on August 17, 2024

to get this fix working, it is also needed this import:

import org.andengine.util.adt.io.in.IInputStreamOpener;

from andengineexamples.

kpsfoo avatar kpsfoo commented on August 17, 2024

I tried the above fix but while the AndEngine Examples force close before starting....Here is my logcat,

03-13 04:50:47.611: E/AndroidRuntime(8241): FATAL EXCEPTION: main
03-13 04:50:47.611: E/AndroidRuntime(8241): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.andengine.examples/org.andengine.examples.launcher.ExampleLauncher}: java.lang.ClassNotFoundException: org.andengine.examples.launcher.ExampleLauncher in loader dalvik.system.PathClassLoader[/data/app/org.andengine.examples-1.apk]
03-13 04:50:47.611: E/AndroidRuntime(8241): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1680)
03-13 04:50:47.611: E/AndroidRuntime(8241): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
03-13 04:50:47.611: E/AndroidRuntime(8241): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
03-13 04:50:47.611: E/AndroidRuntime(8241): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
03-13 04:50:47.611: E/AndroidRuntime(8241): at android.os.Handler.dispatchMessage(Handler.java:99)
03-13 04:50:47.611: E/AndroidRuntime(8241): at android.os.Looper.loop(Looper.java:130)
03-13 04:50:47.611: E/AndroidRuntime(8241): at android.app.ActivityThread.main(ActivityThread.java:3835)
03-13 04:50:47.611: E/AndroidRuntime(8241): at java.lang.reflect.Method.invokeNative(Native Method)
03-13 04:50:47.611: E/AndroidRuntime(8241): at java.lang.reflect.Method.invoke(Method.java:507)
03-13 04:50:47.611: E/AndroidRuntime(8241): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
03-13 04:50:47.611: E/AndroidRuntime(8241): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
03-13 04:50:47.611: E/AndroidRuntime(8241): at dalvik.system.NativeStart.main(Native Method)
03-13 04:50:47.611: E/AndroidRuntime(8241): Caused by: java.lang.ClassNotFoundException: org.andengine.examples.launcher.ExampleLauncher in loader dalvik.system.PathClassLoader[/data/app/org.andengine.examples-1.apk]
03-13 04:50:47.611: E/AndroidRuntime(8241): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
03-13 04:50:47.611: E/AndroidRuntime(8241): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
03-13 04:50:47.611: E/AndroidRuntime(8241): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-13 04:50:47.611: E/AndroidRuntime(8241): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
03-13 04:50:47.611: E/AndroidRuntime(8241): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1672)
03-13 04:50:47.611: E/AndroidRuntime(8241): ... 11 more
03-13 04:51:32.902: E/jdwp(8341): Failed sending reply to debugger: Broken pipe

What did I do wrong?

from andengineexamples.

tauame avatar tauame commented on August 17, 2024

I don't believe this issue alexkempton reported has anything to do with your error, perhaps you should try the andengine forums.

It seems like your project has some kind of configuration (project properties or androidManifest.xml) error, in you place i would try to get it from the repository again and re-run it.

from andengineexamples.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.