MyApp has stoped

0

Android app starter asking for help. Coincidentally, after running a direct app on my phone, I could not do the same thing in the emulator.

Follow Logcat:

01-25 15:55:24.348 15565-15565/com.sdr.flappybird E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.sdr.flappybird, PID: 15565
java.lang.RuntimeException: Unable to resume activity {com.sdr.flappybird/com.sdr.flappybird.AndroidLauncher}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.badlogic.gdx.backends.android.AndroidInput.onResume()' on a null object reference
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3581)
    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
    at android.app.ActivityThread.-wrap11(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6494)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.badlogic.gdx.backends.android.AndroidInput.onResume()' on a null object reference
    at com.badlogic.gdx.backends.android.AndroidApplication.onResume(AndroidApplication.java:299)
    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
    at android.app.Activity.performResume(Activity.java:7107)
    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621) 
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862) 
    at android.app.ActivityThread.-wrap11(Unknown Source:0) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 
    at android.os.Handler.dispatchMessage(Handler.java:106) 
    at android.os.Looper.loop(Looper.java:164) 
    at android.app.ActivityThread.main(ActivityThread.java:6494) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 

Follow .java:

package com.sdr.flappybird;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class FlappyBird extends ApplicationAdapter {

    private SpriteBatch batch;
    private Texture passaro;

    @Override
    public void create () {

        batch = new SpriteBatch();
        passaro = new Texture( "passaro1.png" );

    }

    @Override
    public void render () {

        batch.begin();

        batch.draw(passaro, 0, 0);

        batch.end();

    }

    @Override
    public void dispose () {

    }
}

Detail (I do not know if important): it is the first app I make of game, using gdx and with folder created in the Desktop.

Thank you in advance! :)

    
asked by anonymous 25.01.2018 / 22:11

0 answers