Error inflating class TextView causes a acticity not to launch - android

I am using Firebase Test Lab to test my app and i get this error on several devices
This stops one of my activities to launch,
I am an new to android
I do not know how to fix this any help would be appreciated
android.view.InflateException: Binary XML file line #27: Error inflating class TextView
FATAL EXCEPTION: main
Process: com.smartpractice.dukatholesmartapp, PID: 6608
android.view.InflateException: Binary XML file line #27: Error inflating class TextView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.widget.Toast.makeText(Toast.java:262)
at es.dmoral.toasty.Toasty.custom(Toasty.java:300)
at es.dmoral.toasty.Toasty.info(Toasty.java:174)
at es.dmoral.toasty.Toasty.info(Toasty.java:162)
at com.smartpractice.myapplication.SecondActivity$5.onResponse(SecondActivity.java:209)
at com.smartpractice.myapplication.SecondActivity$5.onResponse(SecondActivity.java:206)
at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:82)
at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:29)
at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:102)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=16; index=19
at android.content.res.StringBlock.get(StringBlock.java:65)
at android.content.res.XmlBlock$Parser.getPooledString(XmlBlock.java:458)
at android.content.res.TypedArray.loadStringValueAt(TypedArray.java:991)
at android.content.res.TypedArray.getString(TypedArray.java:176)
at androidx.appcompat.widget.TintTypedArray.getString(TintTypedArray.java:143)
at androidx.appcompat.widget.AppCompatTextHelper.updateTypefaceAndStyle(AppCompatTextHelper.java:449)
at androidx.appcompat.widget.AppCompatTextHelper.loadFromAttributes(AppCompatTextHelper.java:204)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:105)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:95)
at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:182)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1407)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1457)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:725)
Here is the line where the error occurs
I am not sure Which line causes the error
* Line 27 from the error
*<TextView
android:id="#+id/textView"
android:layout_width="match_parent"
android:layout_height="48dp"
android:fontFamily="#font/nunito"
android:gravity="center_horizontal"
android:text="#string/welcome_to_smartpractice"
android:textSize="24sp"
app:fontFamily="#font/nunito"
app:layout_alignSelf="baseline"
/>

Please check caused by tag in your error log first.
It clearly says java.lang.ArrayIndexOutOfBoundsException.
So I suggest you to reverify your code of SecondActivity.java file near line 209 where you are getting some item from list.

Related

App keeps stopping when I try running it on phone (android studio)

I am getting an error when I run my android studio app on my phone. It says my app keeps stopping and won't load it.
Here is the error I got from the logs:
06-05 17:22:55.578 2715-2715/com.app.supermarketaislefinder E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.supermarketaislefinder, PID: 2715
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.app.supermarketaislefinder/com.app.supermarketaislefinder.MainActivity}: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class android.support.constraint.ConstraintLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2724)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6251)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
Caused by: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class android.support.constraint.ConstraintLayout
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.constraint.ConstraintLayout
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 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:787)
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 android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.app.supermarketaislefinder.MainActivity.onCreate(MainActivity.java:11)
at android.app.Activity.performCreate(Activity.java:6676)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6251)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
Caused by: java.lang.OutOfMemoryError: Failed to allocate a 207936012 byte allocation with 4154252 free bytes and 186MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:655)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:483)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1157)
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:720)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:571)
at android.content.res.Resources.loadDrawable(Resources.java:972)
at android.content.res.TypedArray.getDrawable(TypedArray.java:931)
at android.view.View.(View.java:4226)
at android.view.ViewGroup.(ViewGroup.java:603)
at android.view.ViewGroup.(ViewGroup.java:599)
at android.view.ViewGroup.(ViewGroup.java:595)
at android.support.constraint.ConstraintLayout.(ConstraintLayout.java:565)
Thanks.
It's a view inflation error,
recheck what your inflating in your activity (R.id.activitylayouttoinflate)
try to CTRL+click it to reach the xml,
and then check that xml for syntex error \ unsupported library.
post a different question for the second question you have.

FirebaseUI InflateException, Error inflating class TextView

I'm trying to sign in with Firebase Auth. When I open the app, I recieve the following error:
03-09 16:25:02.532 20054-20054/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.udacity.gradle.builditbigger, PID: 20054
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.udacity.gradle.builditbigger/com.firebase.ui.auth.KickoffActivity}: android.view.InflateException: Binary XML file line #29: Binary XML file line #29: Error inflating class TextView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3003)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Caused by: android.view.InflateException: Binary XML file line #29: Binary XML file line #29: Error inflating class TextView
Caused by: android.view.InflateException: Binary XML file line #29: Error inflating class TextView
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x2/d=0x7f040077 a=4 r=0x7f06002c}
at android.content.res.TypedArray.getColorStateList(TypedArray.java:545)
at android.widget.TextView.<init>(TextView.java:1137)
at android.widget.TextView.<init>(TextView.java:1038)
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:75)
at android.support.v7.widget.AppCompatTextView.<init>(AppCompatTextView.java:71)
at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
at android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1024)
at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1081)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:865)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.inflate(LayoutInflater.java:525)
at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
at android.view.LayoutInflater.inflate(LayoutInflater.java:378)
at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:383)
at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:323)
at android.support.v7.app.AppCompatDelegateImplV9.onPostCreate(AppCompatDelegateImplV9.java:170)
at android.support.v7.app.AppCompatActivity.onPostCreate(AppCompatActivity.java:97)
at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1207)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2975)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064)
at android.app.ActivityThread.-wrap14(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
I've looked through a number of S/O posts haven't seemed to find something that'll work. Is there an easy fix for this or should I just remove the FirebaseUI dependency and make my own login screen?

AndroidRuntime: FatalException:

I really don't know what's happening. On Android Studio every thing is working fine, but when I try to run the app on my phone it gives this error.
AndroidRuntime: FatalException:
Process: com.example.vb.textreader, PID: 29524
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.vb.textreader/com.example.vb.textreader.ocrcapture}: android.view.InflateException: Binary XML file line #10: Error inflating class com.example.vb.textreader.CameraSourcePreview
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394)
at android.app.ActivityThread.access$800(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5276)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class com.example.vb.textreader.CameraSourcePreview
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:761)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:810)
at android.view.LayoutInflater.inflate(LayoutInflater.java:508)
at android.view.LayoutInflater.inflate(LayoutInflater.java:418)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.vb.textreader.ocrcapture.onCreate(ocrcapture.java:67)
at android.app.Activity.performCreate(Activity.java:6041)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2285)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394)
at android.app.ActivityThread.access$800(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5276)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.vb.textreader.CameraSourcePreview" on path: DexPathList[[zip file "/data/app/com.example.vb.textreader-1/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.view.LayoutInflater.createView(LayoutInflater.java:575)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:747)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:810)
at android.view.LayoutInflater.inflate(LayoutInflater.java:508)
at android.view.LayoutInflater.inflate(LayoutInflater.java:418)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.vb.textreader.ocrcapture.onCreate(ocrcapture.java:67)
at android.app.Activity.performCreate(Activity.java:6041)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1109)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2285)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2394)
at android.app.ActivityThread.access$800(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5276)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
Suppressed: java.lang.ClassNotFoundException: Didn't find class "com.example.vb.textreader.CameraSourcePreview" on path: DexPathList[[dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-support-annotations-23.4.0_932ddf769cdf6f7ff910db3bda1b13074bfa8aca-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.example.vb.textreader/files/instant-run/dex/slice-internal_impl-23.4.0_ed28e3a48cbb17d2b91d4065fb1975ae0dafdc68-classes.dex", dex file "/data/data/com.example.vb.textreader/fil
I am trying to create an OCR app on android. There is no error in the code as viewed in Android Studio. Any help is greatly appreciated.
XML Code
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/topLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true">
<com.example.vb.textreader.proprietary.CameraSourcePreview
android:id="#+id/preview"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.example.vb.textreader.GraphicOverlay
android:id="#+id/graphicOverlay"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.example.vb.textreader.proprietary.CameraSourcePreview>
It seems that there is a custom view com.example.vb.textreader.CameraSourcePreview that's used in a XML layout file that's causing the problem.
Check it's attributes and implementation. if it depends on a library, check the dependencies in build.gradle.
It seems you are trying to use com.example.vb.textreader.CameraSourcePreview which must be a custom view you implemented. One thing that comes to my mind is to check to see if the custom view resides exactly at that location.
I'm not sure whether the provided solution is related to your issue but
try tocompile 'com.android.support:design:*****' instead of com.android.support:appcompat-v7:*****

"Error inflating class com.android.internal.widget.ActionBarContainer" on some Sony devices

I've got a lot of error reports from Sony devices with Android 5.0.2 in the past few weeks. It seems that a ArrayIndexOutOfBoundsException occurs when inflating ActionBarContainer. ActionBarContainer is an internal class, never used directly in my code. The only line of my code in the stack trace is a call to Activity.setContentView(). Any ideas? Thanks.
The stack trace:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.app/com.my.app.MainActivity}: android.view.InflateException: Binary XML file line #31: Error inflating class com.android.internal.widget.ActionBarContainer
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2345)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)
at android.app.ActivityThread.access$800(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1324)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:5317)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)
Caused by: android.view.InflateException: Binary XML file line #31: Error inflating class com.android.internal.widget.ActionBarContainer
at android.view.LayoutInflater.createView(LayoutInflater.java:633)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:3500)
at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3572)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:371)
at android.app.Activity.setContentView(Activity.java:2144)
at com.my.app.MainActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:5933)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
... 10 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
... 23 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=7; index=7
at android.content.res.Resources.toPreloadCookie(Resources.java:2447)
at android.content.res.Resources.loadDrawable(Resources.java:2475)
at android.content.res.TypedArray.getDrawable(TypedArray.java:749)
at android.view.View.<init>(View.java:3806)
at android.view.ViewGroup.<init>(ViewGroup.java:492)
at android.widget.FrameLayout.<init>(FrameLayout.java:115)
at android.widget.FrameLayout.<init>(FrameLayout.java:111)
at android.widget.FrameLayout.<init>(FrameLayout.java:107)
at com.android.internal.widget.ActionBarContainer.<init>(ActionBarContainer.java:57)
... 26 more
The list of Build.FINGERPRINT of these devices includes:
Sony/C6802/C6802:5.0.2/14.5.A.0.270/3305956307:user/release-keys
Sony/C6833/C6833:5.0.2/14.5.A.0.270/3305956307:user/release-keys
Sony/C6902/C6902:5.0.2/14.5.A.0.270/3750474323:user/release-keys
Sony/C6903/C6903:5.0.2/14.5.A.0.270/3750474323:user/release-keys
Sony/C6943/C6943:5.0.2/14.5.A.0.270/3750474323:user/release-keys
Sony/D5503/D5503:5.0.2/14.5.A.0.270/3750474323:user/release-keys
Sony/D5803/D5803:5.0.2/23.1.A.1.28/151083418:user/release-keys
Sony/D6503/D6503:5.0.2/23.1.A.1.28/151083418:user/release-keys
Sony/D6603/D6603:5.0.2/23.1.A.1.28/151083418:user/release-keys
Sony/D6616/D6616:5.0.2/23.1.C.0.385/498118161:user/release-keys
Sony/D6633/D6633:5.0.2/23.1.1.E.0.1/937646546:user/release-keys
Sony/D6653/D6653:5.0.2/23.1.A.1.28/151083418:user/release-keys

Complete beginner following Androids tutorial for first app - Fatal Java error

So I'm on Mac osx, downloaded Android studio, downloaded intel HAXM, started scripting and got to the end of this tutorial:
https://developer.android.com/training/basics/firstapp/building-ui.html
The script actually runs, but when I go to run it through my emulator the emulator says "My First App has stopped working" and I get the below in the debug menu.
I followed the instructions carefully and have a basic understanding of Java so but am not familiar with Android whatsoever. Could anyone let me know where I'm going wrong?
Thanks in advance!
Cab_Russell
02-24 22:41:24.798 2781-2781/com.example.dannyrussell.myfirstapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.dannyrussell.myfirstapp, PID: 2781
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.dannyrussell.myfirstapp/com.example.dannyrussell.myfirstapp.MyActivity}: android.view.InflateException: Binary XML file line #15: Error inflating class button
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class button
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:757)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at com.example.dannyrussell.myfirstapp.MyActivity.onCreate(MyActivity.java:14)
at android.app.Activity.performCreate(Activity.java:5933)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
           
The problem is identified in the stack trace (although perhaps obscurely).
When creating the view, Android creates Java objects for objects in the layout XML. It is saying it can't create a Java object for class "button". Since the class you probably want is "Button", make sure your layout XML is correct (it is case sensitive)

Categories

Resources