Ogen
Ogen

Reputation: 6709

Android project working on emulator but not on mobile device

As the question title states. I am gettign this logcat error:

10-14 15:57:54.319: E/AndroidRuntime(771): FATAL EXCEPTION: main
10-14 15:57:54.319: E/AndroidRuntime(771): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.contactmanager/com.example.contactmanager.HomeScreenActivity}: android.view.InflateException: Binary XML file line #49: Error inflating class <unknown>
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.os.Handler.dispatchMessage(Handler.java:99)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.os.Looper.loop(Looper.java:130)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.app.ActivityThread.main(ActivityThread.java:3687)
10-14 15:57:54.319: E/AndroidRuntime(771):  at java.lang.reflect.Method.invokeNative(Native Method)
10-14 15:57:54.319: E/AndroidRuntime(771):  at java.lang.reflect.Method.invoke(Method.java:507)
10-14 15:57:54.319: E/AndroidRuntime(771):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
10-14 15:57:54.319: E/AndroidRuntime(771):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
10-14 15:57:54.319: E/AndroidRuntime(771):  at dalvik.system.NativeStart.main(Native Method)
10-14 15:57:54.319: E/AndroidRuntime(771): Caused by: android.view.InflateException: Binary XML file line #49: Error inflating class <unknown>
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.view.LayoutInflater.createView(LayoutInflater.java:518)
10-14 15:57:54.319: E/AndroidRuntime(771):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
10-14 15:57:54.319: E/AndroidRuntime(771):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:209)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.app.Activity.setContentView(Activity.java:1657)
10-14 15:57:54.319: E/AndroidRuntime(771):  at com.example.contactmanager.HomeScreenActivity.onCreate(HomeScreenActivity.java:58)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
10-14 15:57:54.319: E/AndroidRuntime(771):  ... 11 more
10-14 15:57:54.319: E/AndroidRuntime(771): Caused by: java.lang.reflect.InvocationTargetException
10-14 15:57:54.319: E/AndroidRuntime(771):  at java.lang.reflect.Constructor.constructNative(Native Method)
10-14 15:57:54.319: E/AndroidRuntime(771):  at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.view.LayoutInflater.createView(LayoutInflater.java:505)
10-14 15:57:54.319: E/AndroidRuntime(771):  ... 22 more
10-14 15:57:54.319: E/AndroidRuntime(771): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x10102fd a=-1}
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.content.res.Resources.loadDrawable(Resources.java:1681)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.view.View.<init>(View.java:1951)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.view.View.<init>(View.java:1899)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.view.ViewGroup.<init>(ViewGroup.java:286)
10-14 15:57:54.319: E/AndroidRuntime(771):  at android.widget.RelativeLayout.<init>(RelativeLayout.java:173)
10-14 15:57:54.319: E/AndroidRuntime(771):  ... 25 more

Why is it not working?

Upvotes: 0

Views: 115

Answers (1)

six-k
six-k

Reputation: 398

Your Android phone might be preventing the app from executing, check for the debugging privileges. Also, just in case, check whether the target platform of your project and the Android version on your phone corresponds(at least shouldn't be running a lower version on your phone.) These are just the basic checks, you might have done these already, even so, doesn't hurt reminding :)

Upvotes: 2

Related Questions