1. Are you ready for the Galaxy S20? Here is everything we know so far!

android.view.InflateException for some devices (mostly Android 4.4)

Discussion in 'Android Development' started by bloggeroliver, Jun 28, 2017.

  1. bloggeroliver

    bloggeroliver Lurker
    Thread Starter

    Hello people!

    For my android app I see quite a number of crashes with an android.view.InflateException. Unfortunately, it does not happen on my device or simulators and the error is telling me nothing. I am assuming it works for most of the devices, the error is mostly occuring in Android 4.x and rarely on 5. Could any of you help me? That would be great! It seems to happen when the users open up my preference activity. Here is the stacktrace:

    java.lang.RuntimeException:
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2413)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2471)
    at android.app.ActivityThread.access$900(ActivityThread.java:175)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:146)
    at android.app.ActivityThread.main(ActivityThread.java:5603)
    at java.lang.reflect.Method.invokeNative(Native Method:0)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
    at dalvik.system.NativeStart.main(Native Method:0)
    Caused by: android.view.InflateException:
    at android.preference.GenericInflater.createItem(GenericInflater.java:397)
    at android.preference.GenericInflater.onCreateItem(GenericInflater.java:417)
    at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:428)
    at android.preference.GenericInflater.rInflate(GenericInflater.java:481)
    at android.preference.GenericInflater.inflate(GenericInflater.java:326)
    at android.preference.GenericInflater.inflate(GenericInflater.java:263)
    at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:272)
    at android.preference.PreferenceFragment.addPreferencesFromResource(PreferenceFragment.java:315)
    at bloggersoft.sudokuoftheday.EinstellungenActivity$MyPreferenceFragment.onCreate(EinstellungenActivity.java:305)
    at android.app.Fragment.performCreate(Fragment.java:1678)
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:859)
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
    at android.app.BackStackRecord.run(BackStackRecord.java:684)
    at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1453)
    at android.app.Activity.performStart(Activity.java:5467)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2386)​
     



    1. Download the Forums for Android™ app!


      Download

       
  2. Deleted User

    Deleted User Guest

    Hi. First your question is impossible to answer without seeing the code.
    Second, have you tried running the app on a virtual device running Android 4.x?
     
  3. bloggeroliver

    bloggeroliver Lurker
    Thread Starter

    Hi, first thanks for your answer.
    Indeed I didnt have the correct Android version in my emulator, but now I can replicate it. However, the error still doesnt give me a clue unfortunately. Which code do you need? The java code for the activity is quite long (some billing stuff, etc.), but I guess the error seems to me in the xml anyways?
    Best
    Oliver
     
  4. Deleted User

    Deleted User Guest

    Need to see at least the code of class EinstellungenActivity.java, and its corresponding XML layout.

    But really inflateException is usually a side effect of some other issue, which is the root cause of the problem. Are you sure that you're showing all of the stack trace?
     
  5. Deleted User

    Deleted User Guest

    Things to look out for are errors in the resources required by your app. It's likely that your app is trying to use something that isn't present in Android 4.x. Again, any such errors would be visible in your log output, but I don't see anything in the stuff you've shown.
     
  6. bloggeroliver

    bloggeroliver Lurker
    Thread Starter

    I have to apologize. The code I posted was the full output from the developer console stacktrace and did not help me as well, upon testing it in the right emulator the error was shown: I forgot to set a default value for a MultiSelectList preference. This fixed it. Thanks for your help!
     
  7. Deleted User

    Deleted User Guest

    That's great news. Pleased that you found the problem.
     
    sweetndreemy73 likes this.
Loading...
Similar Threads - android view InflateException
  1. BoolTech
    Replies:
    1
    Views:
    52
  2. tube517
    Replies:
    2
    Views:
    267
  3. stealthpaws
    Replies:
    3
    Views:
    248
  4. BuckLikesAndroid
    Replies:
    6
    Views:
    332
  5. kumaranil13k
    Replies:
    8
    Views:
    3,750
  6. haniya
    Replies:
    0
    Views:
    1,927
  7. haniya
    Replies:
    1
    Views:
    1,347
  8. JHolt
    Replies:
    0
    Views:
    2,119
  9. Frederik Frandsen
    Replies:
    0
    Views:
    2,175
  10. Fabrizio Ferrari
    Replies:
    0
    Views:
    2,606

Share This Page

Loading...