1

So I'm creating a simple app that will show a googlemap. I have no project errors but I am getting the unfortunately "application" has stopped error.

Here is my logcat

10-29 13:10:00.916: D/AndroidRuntime(458): Shutting down VM
10-29 13:10:00.916: W/dalvikvm(458): threadid=1: thread exiting with uncaught exception (group=0x409961f8)
10-29 13:10:00.936: E/AndroidRuntime(458): FATAL EXCEPTION: main
10-29 13:10:00.936: E/AndroidRuntime(458): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bossapps.campusmapped/com.bossapps.campusmapped.MainActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.app.ActivityThread.access$600(ActivityThread.java:122)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.os.Handler.dispatchMessage(Handler.java:99)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.os.Looper.loop(Looper.java:137)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.app.ActivityThread.main(ActivityThread.java:4340)
10-29 13:10:00.936: E/AndroidRuntime(458):  at java.lang.reflect.Method.invokeNative(Native Method)
10-29 13:10:00.936: E/AndroidRuntime(458):  at java.lang.reflect.Method.invoke(Method.java:511)
10-29 13:10:00.936: E/AndroidRuntime(458):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
10-29 13:10:00.936: E/AndroidRuntime(458):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
10-29 13:10:00.936: E/AndroidRuntime(458):  at dalvik.system.NativeStart.main(Native Method)
10-29 13:10:00.936: E/AndroidRuntime(458): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.view.LayoutInflater.createView(LayoutInflater.java:606)
10-29 13:10:00.936: E/AndroidRuntime(458):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
10-29 13:10:00.936: E/AndroidRuntime(458):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.app.Activity.setContentView(Activity.java:1835)
10-29 13:10:00.936: E/AndroidRuntime(458):  at com.bossapps.campusmapped.MainActivity.onCreate(MainActivity.java:12)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.app.Activity.performCreate(Activity.java:4465)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
10-29 13:10:00.936: E/AndroidRuntime(458):  ... 11 more
10-29 13:10:00.936: E/AndroidRuntime(458): Caused by: java.lang.reflect.InvocationTargetException
10-29 13:10:00.936: E/AndroidRuntime(458):  at java.lang.reflect.Constructor.constructNative(Native Method)
10-29 13:10:00.936: E/AndroidRuntime(458):  at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.view.LayoutInflater.createView(LayoutInflater.java:586)
10-29 13:10:00.936: E/AndroidRuntime(458):  ... 23 more
10-29 13:10:00.936: E/AndroidRuntime(458): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f050000 a=-1 r=0x7f050000}
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.content.res.Resources.loadDrawable(Resources.java:1899)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.view.View.<init>(View.java:2780)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.view.View.<init>(View.java:2717)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.view.ViewGroup.<init>(ViewGroup.java:379)
10-29 13:10:00.936: E/AndroidRuntime(458):  at android.widget.RelativeLayout.<init>(RelativeLayout.java:174)
10-29 13:10:00.936: E/AndroidRuntime(458):  ... 26 more

Anyone have any ideas?

EDIT: Keep in mind that I only added some dummy buttons for testing its basically a brand new application. The only thing that I created other than the buttons were the string variables that hold the strings shown on the buttons, other than that it's a brand new application.

Here is my MainActivity.java

package com.bossapps.campusmapped;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}

Running on a API version 16 AVD

XML activity_main file

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@style/AppTheme" >

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="14dp"
        android:text="@string/Welcome"
        tools:context=".MainActivity" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/textView2"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="30dp"
        android:text="@string/View_Mode"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <RadioButton
        android:id="@+id/radioButton1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/textView1"
        android:layout_marginLeft="34dp"
        android:layout_marginTop="23dp"
        android:text="@string/Regular" />

    <RadioButton
        android:id="@+id/radioButton2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/radioButton1"
        android:layout_below="@+id/radioButton1"
        android:text="@string/Augmented " />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/radioButton2"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="33dp"
        android:text="@string/Go" />

</RelativeLayout>
Sam
  • 86,580
  • 20
  • 181
  • 179
Vasman
  • 7
  • 6

3 Answers3

3

Have you checked that you've got an Apptheme in @style/Apptheme? Because it is the only resource that the parser can't find (i.e: not a drawable (color or path)):

10-29 13:10:00.936: E/AndroidRuntime(458): Caused by: 
  android.content.res.Resources$NotFoundException: Resource is not a Drawable 
  (color or path): TypedValue{t=0x1/d=0x7f050000 a=-1 r=0x7f050000}
SchmitzIT
  • 9,227
  • 9
  • 65
  • 92
marcnc27
  • 146
  • 3
0

Guessing from your trace, ther's something wrong with your xml layout.... android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout.

Can you post it?

sataniccrow
  • 372
  • 2
  • 7
0
 10-29 13:10:00.936: E/AndroidRuntime(458): Caused by: android.view.InflateException:     Binary XML file line #1: Error inflating class android.widget.RelativeLayout

 10-29 13:10:00.936: E/AndroidRuntime(458): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f050000 a=-1 r=0x7f050000}

Some Drawable in some RelativeLayout from MainActivity setContentView() method?

Mrusful
  • 1,503
  • 1
  • 18
  • 32