我在我的android工作室上升级了我的SDK,从那时起,我的模拟器上的以前正常工作的应用程序出现以下错误。
以下是日志:
05-24 08:27:26.297 21141-21141/? I/art: Not late-enabling -Xcheck:jni (already on)
05-24 08:27:26.298 21141-21141/? W/art: Unexpected CPU variant for X86 using defaults: x86
05-24 08:27:29.194 21141-21141/x.x.x.x W/System: ClassLoader referenced unknown path: /data/app/x.x.x.x-2/lib/x86
05-24 08:27:42.848 21141-21141/x.x.x.x I/Choreographer: Skipped 41 frames! The application may be doing too much work on its main thread.
05-24 08:27:46.497 21141-21241/x.x.x. I/OpenGLRenderer: Initialized EGL, version 1.4
05-24 08:27:46.497 21141-21241/x.x.x.x D/OpenGLRenderer: Swap behavior 1
05-24 08:27:46.498 21141-21241/x.x.x.x W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
05-24 08:27:46.498 21141-21241/x.x.x.x D/OpenGLRenderer: Swap behavior 0
05-24 08:28:03.756 21141-21141/x.x.x.x I/Choreographer: Skipped 1254 frames! The application may be doing too much work on its main thread.
以下是我活动的存根
import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import java.io.IOException;
import model.DatabaseHelper;
public class MainActivity extends AppCompatActivity {
Button genbutton;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
即使是这个空活动,它也会跳过超过1000帧。活动的XML非常简单,只有很少的按钮和图片(100k)。我该如何解决这个问题?互联网上的大多数解决方案都建议使用异步任务和线程。但在这里,我有空的活动。