简单图像视图无法正常工作Android Studios 3.1.1可以正常工作。我的原木猫

时间:2018-08-02 20:50:10

标签: android imageview

---------崩溃开始 08-03 02:12:29.254 29641-29641 / com.example.riyaz.myapplication E / AndroidRuntime:FATAL EXCEPTION:main     流程:com.example.riyaz.myapplication,PID:29641     java.lang.OutOfMemoryError:无法分配298598412字节分配和10742036可用字节以及240MB,直到OOM         在dalvik.system.VMRuntime.newNonMovableArray(本机方法)         在android.graphics.BitmapFactory.nativeDecodeAsset(本地方法)         在android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609)         在android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)         在android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1080)         在android.content.res.Resources.loadDrawableForCookie(Resources.java:2636)         在android.content.res.Resources.loadDrawable(Resources.java:2541)         在android.content.res.TypedArray.getDrawable(TypedArray.java:870)         在android.widget.ImageView(ImageView.java:152)         在android.widget.ImageView。(ImageView.java:140)         在android.support.v7.widget.AppCompatImageView。(AppCompatImageView.java:72)         在android.support.v7.widget.AppCompatImageView(AppCompatImageView.java:68)         在android.support.v7.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:182)         在android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:106)         在android.support.v7.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1266)         在android.support.v7.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1316)         在android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:746)         在android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)         在android.view.LayoutInflater.rInflate(LayoutInflater.java:835)         在android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)         在android.view.LayoutInflater.inflate(LayoutInflater.java:515)         在android.view.LayoutInflater.inflate(LayoutInflater.java:423)         在android.view.LayoutInflater.inflate(LayoutInflater.java:374)         在android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)         在android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)         在com.example.riyaz.myapplication.MainActivity.onCreate(MainActivity.java:11)         在android.app.Activity.performCreate(Activity.java:6289)         在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)         在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2405)         在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2535)         在android.app.ActivityThread.access $ 900(ActivityThread.java:155)         在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1380)         在android.os.Handler.dispatchMessage(Handler.java:102)         在android.os.Looper.loop(Looper.java:152)         在android.app.ActivityThread.main(ActivityThread.java:5497)         在java.lang.reflect.Method.invoke(本机方法)         在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:726)         在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 08-03 02:12:29.260 29641-29641 / com.example.riyaz.myapplication D / AppTracker:应用事件:崩溃 08-03 02:12:29.677 29641-29641 / com.example.riyaz.myapplication I / Process:正在发送信号。 PID:29641 SIG:9

1 个答案:

答案 0 :(得分:0)

您的图片文件有问题(@ drawable / g)

1-Build + Clean项目 2-再次运行 如果这不起作用!替换图片文件