App does not run on other phones

Asked

Viewed 48 times

2

I developed some apps that ran smoothly on my mobile, but when I install in another just give the message that the app stopped and this error message in Android Studio.

05-17 09:03:55.571 15862-15862/com.example.roma0x.heitorapp E/AndroidRuntime:
FATAL EXCEPTION: main
Process: com.example.roma0x.heitorapp, PID: 15862
android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class ImageButton
at android.view.LayoutInflater.inflate(LayoutInflater.java:551)
at android.view.LayoutInflater.inflate(LayoutInflater.java:429)
at com.example.roma0x.heitorapp.Fragmentos.BichosFragment.onCreateView(BichosFragment.java:30)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2354)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1419)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1740)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1809)
at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:799)
at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2580)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2367)
at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2322)
at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:2199)
at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:651)
at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:145)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1236)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1084)
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1614)
at android.view.View.measure(View.java:20214)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:747)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:20214)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
at android.view.View.measure(View.java:20214)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
at android.support.v7.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:400)
at android.view.View.measure(View.java:20214)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:20214)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:747)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:20214)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:3111)
at android.view.View.measure(View.java:20214)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2683)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1636)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1928)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1524)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7520)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:622)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.ja

XML-Fagmento Bichos: I’m making an app for my nephew to learn to speak

  • In which folder the image of the Imagebutton of the Fragment Bichosfragment is?

  • check if the image is in the "drawable"

  • exactly is in the drawable

  • Please send the xml of this Fragment

  • only the length exceeded when I glue here...

  • Avoid putting this kind of thing in the comments, edit the question :D

  • can view the xml now?

Show 2 more comments

2 answers

1

The reason for the error was where the images were being saved my drawable was saving the images inside a folder called drawable-v24 that was inside the drawable, I just switched the folder images and the app ran normally on other phones.

0

In Android Studio has a function to generate the apk file to be an installer and has another function to compile and run, are two separate routines but the two generate an apk, and the build generates an incomplete apk.

Go on Build\Builds APK, this routine does generate the installer. The Routines Run, Make, Debug generate incomplete apk, a version to run directly on the emulator or USB cable.

  • 1

    error keeps happening, in vi search which may be problem with the images

  • ok then. With me it has happened similar.

  • as I imagined, when I remove the images the app runs, I soon came to the conclusion that the problem is with adapting the image on other smartphones, someone knows the solution to this problem?

  • What is the format of the images? What folder are they in? What is the android version of other phones?

  • 1

    The reason for the error was where the images were being saved my drawable was saving the images inside a folder called drawable-v24 that was inside the drawable, I just switched the folder images and the app ran normally on other phones.

  • this folder suffix -v24 should be used if Voce wants the image to be different in the verses above android 24, would be for different images each version, tembem serve for layout

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.