Приложение работает на эмуляторе, но не работает на телефоне? - PullRequest
0 голосов
/ 04 июля 2018

Когда я пытаюсь установить приложение на свой телефон через USB, но оно не открывается, и приложение останавливается на заставке. Итак, я попытался запустить приложение на эмуляторе, затем оно успешно и приложение работает.

Я новичок в Android, не могу отладить ошибку? Итак, кто-нибудь может ответить на следующую ошибку?

07-04 19:45:48.009 28227-28227/com.example.dell.foodapplication E/HAL: PATH3 /odm/lib64/hw/gralloc.qcom.so
    PATH2 /vendor/lib64/hw/gralloc.qcom.so
    PATH1 /system/lib64/hw/gralloc.qcom.so
    PATH3 /odm/lib64/hw/gralloc.msm8953.so
    PATH2 /vendor/lib64/hw/gralloc.msm8953.so
    PATH1 /system/lib64/hw/gralloc.msm8953.so
07-04 19:45:52.731 28227-28227/com.example.dell.foodapplication E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.dell.foodapplication, PID: 28227
    java.lang.OutOfMemoryError: Failed to allocate a 298598412 byte allocation with 14026592 free bytes and 171MB until OOM
        at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
        at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
        at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:624)
        at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:457)
        at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1152)
        at android.content.res.ResourcesImpl.createFromResourceStream(ResourcesImpl.java:1272)
        at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:743)
        at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:585)
        at android.content.res.MiuiResourcesImpl.loadDrawable(MiuiResourcesImpl.java:308)
        at android.content.res.Resources.loadDrawable(Resources.java:872)
        at android.content.res.TypedArray.getDrawable(TypedArray.java:930)
        at android.widget.ImageView.<init>(ImageView.java:157)
        at android.widget.ImageView.<init>(ImageView.java:145)
        at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:72)
        at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:68)
        at android.support.v7.app.AppCompatViewInflater.createImageView(AppCompatViewInflater.java:182)
        at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:106)
        at android.support.v7.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1263)
        at android.support.v7.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1313)
        at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:192)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:752)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:883)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:886)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:886)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
        at android.view.LayoutInflater.parseInclude(LayoutInflater.java:1019)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:879)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:886)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:886)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:886)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:846)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:522)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:430)
        at com.example.dell.foodapplication.SelectFragment.onCreateView(SelectFragment.java:38)
        at android.support.v4.app.Fragment.performCreateView(Fragment.java:2425)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1460)
        at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
        at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:802)
        at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2623)
        at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2410)
        at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2365)
        at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:2242)
        at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:654)
        at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:146)
        at android.support.v4.view.ViewPager.populate(ViewPager.java:1244)
        at android.support.v4.view.ViewPager.populate(ViewPager.java:1092)
        at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1622)
        at android.view.View.measure(View.java:19759)
        at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
        at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
        at android.view.View.measure(View.java:19759)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6122)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
        at android.view.View.measure(View.java:19759)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6122)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
        at android.view.View.measure(View.java:19759)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6122)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.view.View.measure(View.java:19759)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6122)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
        at android.view.View.measure(View.java:19759)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6122)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at com.android.internal.policy.DecorView.onMeasure(DecorView.java:690)
        at android.view.View.measure(View.java:19759)
        at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2308)
        at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1395)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1644)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1283)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6354)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:873)
        at android.view.Choreographer.doCallbacks(Choreographer.java:685)
        at android.view.Choreographer.doFrame(Choreographer.java:621)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:859)
        at android.os.Handler.handleCallback(Handler.java:754)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:163)
        at android.app.ActivityThread.main(ActivityThread.java:6342)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)

1 Ответ

0 голосов
/ 04 июля 2018

Сурав Мунд проверяет размер нарисованного food_logo и позволяет узнать размер, который, я думаю, оттуда исходит от вас.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...