0

I'm relatively new to android programming and am trying to run the application on a device but keep getting returned with the above message on the device that the application has stopped. I've been searching around trying all sorts of different fixes but it's supposedly unique to my code, this is the errors returned in the log:

EDIT

04-23 12:24:09.609: E/AndroidRuntime(6535): FATAL EXCEPTION: main
04-23 12:24:09.609: E/AndroidRuntime(6535): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.chris.myapplication/com.example.chris.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #67: Error inflating class <unknown>
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.app.ActivityThread.access$600(ActivityThread.java:123)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.os.Looper.loop(Looper.java:137)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.app.ActivityThread.main(ActivityThread.java:4424)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at java.lang.reflect.Method.invokeNative(Native Method)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at java.lang.reflect.Method.invoke(Method.java:511)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at dalvik.system.NativeStart.main(Native Method)
04-23 12:24:09.609: E/AndroidRuntime(6535): Caused by: android.view.InflateException: Binary XML file line #67: Error inflating class <unknown>
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.view.LayoutInflater.createView(LayoutInflater.java:606)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:268)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.app.Activity.setContentView(Activity.java:1837)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at com.example.chris.myapplication.MainActivity.onCreate(MainActivity.java:21)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.app.Activity.performCreate(Activity.java:4470)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    ... 11 more
 04-23 12:24:09.609: E/AndroidRuntime(6535): Caused by: java.lang.reflect.InvocationTargetException
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at java.lang.reflect.Constructor.constructNative(Native Method)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.view.LayoutInflater.createView(LayoutInflater.java:586)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    ... 24 more
 04-23 12:24:09.609: E/AndroidRuntime(6535): Caused by: java.lang.OutOfMemoryError
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.graphics.Bitmap.nativeCreate(Native Method)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:531)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:506)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:358)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
04-23 12:24:09.609: E/AndroidRuntime(6535):     at android.content.res.Resources.loadDrawable(Resources.java:1939)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.widget.ImageView.<init>(ImageView.java:119)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.widget.ImageButton.<init>(ImageButton.java:85)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    at android.widget.ImageButton.<init>(ImageButton.java:81)
 04-23 12:24:09.609: E/AndroidRuntime(6535):    ... 27 more
 04-23 12:24:09.639: I/ActivityManager(350): Process com.google.android.apps.maps:FriendService (pid 6260) has died.
 04-23 12:24:09.669: W/ActivityManager(350):   Force finishing activity com.example.chris.myapplication/.MainActivity

Originally the problem seemed to be with the theme, but now I'm being returned with different errors once I had fixed the theme problem. Thanks in advance for any help

Slevin
  • 1
  • 1
  • Can you post your code? – Karthikeyan Apr 23 '15 at 09:49
  • [This](http://stackoverflow.com/questions/21814825/you-need-to-use-a-theme-appcompat-theme-or-descendant-with-this-activity) seems to address the same issue – Catalina Apr 23 '15 at 09:52
  • I had similar issue, Try to replace ActionBarACtivity with Activity. – Raghavendra Apr 23 '15 at 09:53
  • Check these answers : 1)http://stackoverflow.com/questions/21814825/you-need-to-use-a-theme-appcompat-theme-or-descendant-with-this-activity 2)http://stackoverflow.com/questions/18063395/actionbarcompat-java-lang-illegalstateexception-you-need-to-use-a-theme-appcom 3)http://stackoverflow.com/questions/26689279/java-lang-illegalstateexception-you-need-to-use-a-theme-appcompat-theme-or-des – N Kaushik Apr 23 '15 at 09:58
  • Do you inherit from Activity in your class? – Daniel Krzyczkowski Apr 23 '15 at 10:04
  • Thanks for the responses, I changed the ActionBarActivity with Activity and it seems to have gotten ridden of that particular error, however, I still have the same problem with new errors that I updated in the OP – Slevin Apr 23 '15 at 11:32

1 Answers1

0

Try to add below line

 parent="@style/Theme.AppCompat"

to your style .xml

OR

Add this attribute to your activity

android:theme="@style/Theme.AppCompat"
Krupa Patel
  • 3,309
  • 3
  • 23
  • 28