Android Studio 2.3.3仿真应用程序(Nexus 5x API 23)中的错误消息

Android Studio 2.3.3仿真应用程序(Nexus 5x API 23)中的错误消息,android,android-studio,Android,Android Studio,我在Android Studio中创建了一个动画应用程序。当我模拟它时,IDE没有显示任何错误消息。但是,当我单击程序中的按钮时,会显示一条消息: “不幸的是,应用程序已停止”。 请帮我找出错误。以下是相关的代码块: import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.vie

我在Android Studio中创建了一个动画应用程序。当我模拟它时,IDE没有显示任何错误消息。但是,当我单击程序中的按钮时,会显示一条消息: “不幸的是,应用程序已停止”。 请帮我找出错误。以下是相关的代码块:

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.ImageView;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        final Animation animTranslate = AnimationUtils.loadAnimation(this,R.anim.anim_translate);
        final ImageView imgTranslate = (ImageView) findViewById(R.id.imgTranslate);
        Button bounceBallButton = (Button) findViewById(R.id.bounceBallButton);
        bounceBallButton.setOnClickListener(new OnClickListener()
        {

            @Override
            public void onClick(View v)
            {
                //v.startAnimation(animTranslate);
                imgTranslate.startAnimation(animTranslate);
            }
        });

    }


}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anim_translate.xml

<?xml version="1.0" encoding="utf-8"?>
<translate
    android:fromXDelta="0"
    android:toXDelta="1000"
    android:fromYDelta="0"
    android:toYDelta="1500"
    android:duration="500"
    android:repeatCount="infinite"
    android:repeatMode="reverse"
    xmlns:android="http://schemas.android.com/apk/res/android">
</translate>

使用LogCat检查与崩溃相关的Java堆栈跟踪:检查LogCat并将其添加到POST中。我不确定这是否是Android Studio中的LogCat窗口。其标签为“事件日志”。这里是在尝试使用Debug:8:52 PM运行它之后的内容执行任务:[:app:assembleDebug]8:52 PM Gradle build在5s 806ms中完成8:53 PM无法绑定到本地8631 for debuggerLogCat:07-05 21:14:27.900 2433-2518/com.example.easypc.myballanimation W/OpenGLRenderer:未能选择保留EGL_交换_行为的配置,在没有。。。07-05 21:14:27.908 2433-2518/com.example.easypc.myballanimation D/EGL_仿真:eglCreateContext:0x7f813b061820:maj 2 min 0 rcv 2 07-05 21:14:27.912 2433-2518/com.example.easypc.myballanimation D/EGL_仿真:eglMakeCurrent:0x7f813b061820:ver 2 0(tinfo 0x7f813b042860)07-05 21:14:27.938 2433-2518/com.example.easypc.myballanimation D/EGL_仿真:eglMakeCurrent:0x7f813b061820:ver 2 0(tinfo 0x7f813b042860)Obs:我只列出了最后的LogCat行,因为注释框不接受更多文本。使用LogCat检查与崩溃相关的Java堆栈跟踪:检查您的LogCat并将其添加到日志中。我不确定这是否是Android Studio中的LogCat窗口。其标签为“事件日志”。这里是在尝试使用Debug:8:52 PM运行它之后的内容执行任务:[:app:assembleDebug]8:52 PM Gradle build在5s 806ms中完成8:53 PM无法绑定到本地8631 for debuggerLogCat:07-05 21:14:27.900 2433-2518/com.example.easypc.myballanimation W/OpenGLRenderer:未能选择保留EGL_交换_行为的配置,在没有。。。07-05 21:14:27.908 2433-2518/com.example.easypc.myballanimation D/EGL_仿真:eglCreateContext:0x7f813b061820:maj 2 min 0 rcv 2 07-05 21:14:27.912 2433-2518/com.example.easypc.myballanimation D/EGL_仿真:eglMakeCurrent:0x7f813b061820:ver 2 0(tinfo 0x7f813b042860)07-05 21:14:27.938 2433-2518/com.example.easypc.myballanimation D/EGL_仿真:eglMakeCurrent:0x7f813b061820:ver 2 0(tinfo 0x7f813b042860)Obs:I只列出了最后一行日志,因为注释框不接受更多文本。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical">

    <Button
        android:id="@+id/bounceBallButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/bounce_ball"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />
    <ImageView
        android:id="@+id/imageTranslate"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:src="@drawable/ball_shape"
        tools:layout_editor_absoluteX="16dp"
        tools:layout_editor_absoluteY="46dp" />
    </RelativeLayout>
07-05 21:14:25.167 2433-2433/? I/art: Not late-enabling -Xcheck:jni (already on)
07-05 21:14:25.181 2433-2438/? I/art: Debugger is no longer active
07-05 21:14:25.214 2433-2433/? W/ActivityThread: Application com.example.easypc.myballanimation is waiting for the debugger on port 8100...
07-05 21:14:25.216 2433-2433/? I/System.out: Sending WAIT chunk
07-05 21:14:26.412 2433-2438/com.example.easypc.myballanimation I/art: Debugger is active
07-05 21:14:26.421 2433-2433/com.example.easypc.myballanimation I/System.out: Debugger has connected
07-05 21:14:26.422 2433-2433/com.example.easypc.myballanimation I/System.out: waiting for debugger to settle...
07-05 21:14:26.622 2433-2433/com.example.easypc.myballanimation I/System.out: waiting for debugger to settle...
07-05 21:14:26.823 2433-2433/com.example.easypc.myballanimation I/System.out: waiting for debugger to settle...
07-05 21:14:27.024 2433-2433/com.example.easypc.myballanimation I/System.out: waiting for debugger to settle...
07-05 21:14:27.225 2433-2433/com.example.easypc.myballanimation I/System.out: waiting for debugger to settle...
07-05 21:14:27.426 2433-2433/com.example.easypc.myballanimation I/System.out: waiting for debugger to settle...
07-05 21:14:27.627 2433-2433/com.example.easypc.myballanimation I/System.out: waiting for debugger to settle...
07-05 21:14:27.828 2433-2433/com.example.easypc.myballanimation I/System.out: debugger has settled (1322)
07-05 21:14:27.833 2433-2433/com.example.easypc.myballanimation W/System: ClassLoader referenced unknown path: /data/app/com.example.easypc.myballanimation-1/lib/x86_64
07-05 21:14:27.863 2433-2518/com.example.easypc.myballanimation D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true

                                                                                  [ 07-05 21:14:27.866  2433: 2433 D/         ]
                                                                                  HostConnection::get() New Host Connection established 0x7f81376e1080, tid 2433


                                                                                  [ 07-05 21:14:27.867  2433: 2433 W/         ]
                                                                                  Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 

                                                                                  [ 07-05 21:14:27.897  2433: 2518 D/         ]
                                                                                  HostConnection::get() New Host Connection established 0x7f813b051360, tid 2518


                                                                                  [ 07-05 21:14:27.898  2433: 2518 W/         ]
                                                                                  Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 
07-05 21:14:27.900 2433-2518/com.example.easypc.myballanimation I/OpenGLRenderer: Initialized EGL, version 1.4
07-05 21:14:27.900 2433-2518/com.example.easypc.myballanimation W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
07-05 21:14:27.908 2433-2518/com.example.easypc.myballanimation D/EGL_emulation: eglCreateContext: 0x7f813b061820: maj 2 min 0 rcv 2
07-05 21:14:27.912 2433-2518/com.example.easypc.myballanimation D/EGL_emulation: eglMakeCurrent: 0x7f813b061820: ver 2 0 (tinfo 0x7f813b042860)
07-05 21:14:27.938 2433-2518/com.example.easypc.myballanimation D/EGL_emulation: eglMakeCurrent: 0x7f813b061820: ver 2 0 (tinfo 0x7f813b042860)