YCPCS-481-TeamB / BaseballSim-Android

BaseballSim App for Android
0 stars 0 forks source link

Start game crashes Android Emulator #28

Closed bcoov closed 7 years ago

bcoov commented 7 years ago

When debugging/running the app within an Android Emulator (as opposed to a physical device), pressing the "Start New Game" button on the GameFragment will crash the app with the following stacktrace:

android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class <unknown>
                  Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
                  Caused by: java.lang.reflect.InvocationTargetException
                      at java.lang.reflect.Constructor.newInstance0(Native Method)
                      at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
                      at android.view.LayoutInflater.createView(LayoutInflater.java:645)
                      at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
                      at android.view.LayoutInflater.onCreateView(LayoutInflater.java:717)
                      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:785)
                      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
                      at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:414)
                      at android.app.Dialog.setContentView(Dialog.java:506)
                      at kylemeyers22.heroku.GameFragment.createStartGameForm(GameFragment.java:83)
                      ...

This behavior does not occur on the physical devices used so far.

kyleMeyers commented 7 years ago

Pack it up

kyleMeyers commented 7 years ago

Try the super before the layout since it is only called in OnActivityCreated -super. createStartGameForm(savedInstanceState); need a bundle for it though

http://stackoverflow.com/questions/21598165/showing-error-caused-by-java-lang-reflect-invocationtargetexception

bcoov commented 7 years ago

Pro Tip: When you're posting a url-link, put the text you want to display in the brackets "[]" and the url in the parens "()" :-)

I'll give this a try when I'm back at my PC this evening.

bcoov commented 7 years ago

Fixed in 30f4b23304bd343204bddd9565f53fe93914ff6e