I am trying to reuse csipsimple as a library. and calling ui which is present in the same library
My xml file looks like
<LinearLayout 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"
tools:context=".DialerActivity" >
<view
class="com.csipsimple.widgets.Dialpad"
android:id="#+id/dialPad"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:paddingBottom="10dip"
android:paddingLeft="5dip"
android:paddingRight="5dip" />
</LinearLayout>
My activity from which i am calling the
package com.*****.payphone;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class DialerActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dialer);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_dialer, menu);
return true;
}
}
and stack trace for the same is I don't understand what have i done wrong
03-28 18:52:18.847: I/ActivityThread(16221): Pub com.csipsimple.db: com.csipsimple.db.DBProvider
03-28 18:52:18.870: D/dalvikvm(16221): GC_CONCURRENT freed 152K, 2% free 9116K/9296K, paused 8ms+6ms, total 71ms
03-28 18:52:18.894: V/DummySetUp(16206): <sip:****#*****.net> IwYzK5IbKJv8DQT 1
03-28 18:52:18.956: D/AndroidRuntime(16206): Shutting down VM
03-28 18:52:18.956: W/dalvikvm(16206): threadid=1: thread exiting with uncaught exception (group=0x41f27930)
03-28 18:52:18.964: E/AndroidRuntime(16206): FATAL EXCEPTION: main
03-28 18:52:18.964: E/AndroidRuntime(16206): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.novanet.payphone/com.*****.payphone.DialerActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class com.csipsimple.widgets.Dialpad
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.app.ActivityThread.access$600(ActivityThread.java:141)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.os.Handler.dispatchMessage(Handler.java:99)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.os.Looper.loop(Looper.java:137)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.app.ActivityThread.main(ActivityThread.java:5039)
03-28 18:52:18.964: E/AndroidRuntime(16206): at java.lang.reflect.Method.invokeNative(Native Method)
03-28 18:52:18.964: E/AndroidRuntime(16206): at java.lang.reflect.Method.invoke(Method.java:511)
03-28 18:52:18.964: E/AndroidRuntime(16206): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-28 18:52:18.964: E/AndroidRuntime(16206): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-28 18:52:18.964: E/AndroidRuntime(16206): at dalvik.system.NativeStart.main(Native Method)
03-28 18:52:18.964: E/AndroidRuntime(16206): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class com.csipsimple.widgets.Dialpad
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-28 18:52:18.964: E/AndroidRuntime(16206): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.app.Activity.setContentView(Activity.java:1881)
03-28 18:52:18.964: E/AndroidRuntime(16206): at com.novanet.payphone.DialerActivity.onCreate(DialerActivity.java:12)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.app.Activity.performCreate(Activity.java:5104)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
03-28 18:52:18.964: E/AndroidRuntime(16206): ... 11 more
03-28 18:52:18.964: E/AndroidRuntime(16206): Caused by: java.lang.reflect.InvocationTargetException
03-28 18:52:18.964: E/AndroidRuntime(16206): at java.lang.reflect.Constructor.constructNative(Native Method)
03-28 18:52:18.964: E/AndroidRuntime(16206): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
03-28 18:52:18.964: E/AndroidRuntime(16206): ... 22 more
03-28 18:52:18.964: E/AndroidRuntime(16206): Caused by: android.view.InflateException: Binary XML file line #31: Error inflating class android.widget.ImageButton
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
03-28 18:52:18.964: E/AndroidRuntime(16206): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.inflate(LayoutInflater.java:459)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-28 18:52:18.964: E/AndroidRuntime(16206): at com.csipsimple.widgets.Dialpad.<init>(Dialpad.java:105)
03-28 18:52:18.964: E/AndroidRuntime(16206): ... 25 more
03-28 18:52:18.964: E/AndroidRuntime(16206): Caused by: java.lang.reflect.InvocationTargetException
03-28 18:52:18.964: E/AndroidRuntime(16206): at java.lang.reflect.Constructor.constructNative(Native Method)
03-28 18:52:18.964: E/AndroidRuntime(16206): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
03-28 18:52:18.964: E/AndroidRuntime(16206): ... 33 more
03-28 18:52:18.964: E/AndroidRuntime(16206): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x7f01000f a=2}
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.content.res.Resources.loadDrawable(Resources.java:1927)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.view.View.<init>(View.java:3328)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.widget.ImageView.<init>(ImageView.java:114)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.widget.ImageButton.<init>(ImageButton.java:87)
03-28 18:52:18.964: E/AndroidRuntime(16206): at android.widget.ImageButton.<init>(ImageButton.java:83)
03-28 18:52:18.964: E/AndroidRuntime(16206): ... 36 more
My Library project is outside my main project which is in package com.*.payphone and the lisbrary project being used is com.csipsimple.widget.Dialpad
have you tried to use <com.csipsimple.widgets.Dialpad instead of
<view
class="com.csipsimple.widgets.Dialpad"
?
You should define your custom view in XML as below:
<com.csipsimple.widgets.Dialpad
android:id="#+id/dialPad"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:paddingBottom="10dip"
android:paddingLeft="5dip"
android:paddingRight="5dip" />
Make sure your theme extends one of the ActionBarSherlock themes. The dialpad buttons use a background from ABS. See this similar issue.
Related
I have google plus login working fine on devices > 4.1 but some devices cause a crash on 4.0
My best guess is that there is a issue(or it is outdated) with google play services installed on the device.
This is the error I get:
java.lang.RuntimeException: Unable to start activity ComponentInfo{me.frankly/me.frankly.view.activity.NewLoginActivity}: android.view.InflateException: Binary XML file line #103: Error inflating class com.google.android.gms.common.SignInButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2077)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
at android.app.ActivityThread.access$600(ActivityThread.java:134)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4624)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: android.view.InflateException: Binary XML file line #103: Error inflating class com.google.android.gms.common.SignInButton
at android.view.LayoutInflater.createView(LayoutInflater.java:608)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:682)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:741)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:744)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:744)
at android.view.LayoutInflater.inflate(LayoutInflater.java:491)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:254)
at android.app.Activity.setContentView(Activity.java:1837)
at me.frankly.view.activity.NewLoginActivity.onCreate(NewLoginActivity.java:112)
at android.app.Activity.performCreate(Activity.java:4479)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2041)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
at android.app.ActivityThread.access$600(ActivityThread.java:134)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4624)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:588)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:682)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:741)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:744)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:744)
at android.view.LayoutInflater.inflate(LayoutInflater.java:491)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:254)
at android.app.Activity.setContentView(Activity.java:1837)
at me.frankly.view.activity.NewLoginActivity.onCreate(NewLoginActivity.java:112)
at android.app.Activity.performCreate(Activity.java:4479)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2041)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
at android.app.ActivityThread.access$600(ActivityThread.java:134)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4624)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.lang.NoClassDefFoundError: com.google.android.gms.R$drawable
at com.google.android.gms.common.internal.q.b()
at com.google.android.gms.common.internal.q.a()
at com.google.android.gms.common.SignInButton.a()
at com.google.android.gms.common.SignInButton.G()
at com.google.android.gms.common.SignInButton.setStyle()
at com.google.android.gms.common.SignInButton.<init>()
at com.google.android.gms.common.SignInButton.<init>()
at java.lang.reflect.Constructor.constructNative(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:588)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:682)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:741)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:744)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:744)
at android.view.LayoutInflater.inflate(LayoutInflater.java:491)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:254)
at android.app.Activity.setContentView(Activity.java:1837)
at me.frankly.view.activity.NewLoginActivity.onCreate(NewLoginActivity.java:112)
at android.app.Activity.performCreate(Activity.java:4479)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2041)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
at android.app.ActivityThread.access$600(ActivityThread.java:134)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4624)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
at dalvik.system.NativeStart.main(NativeStart.java)
Going through your stack traces I noticed
Caused by: java.lang.NoClassDefFoundError: com.google.android.gms.R$drawable
That leads me to assume that you added the jar for the Play Services SDK but didn't add the Android library project and that is why it could not be found. It may also be possibility that you may be using an outdated version of the Play Service SDK.
I suggest viewing CommonsWare solution by clicking here.
I'm experiencing an odd behaviour in my Android app. I have a drawable , walkthrough_safe.png and have a version in drawable-mdpi, drawable-hdpi and drawable-xhdpi folders.
I'm seeing this crash in analytics
{main} android.view.InflateException: Binary XML file line #7: Error inflating class
<unknown> at android.view.LayoutInflater.createView(LayoutInflater.java:613) at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:
56) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660) at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685) at
android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at
android.view.LayoutInflater.inflate(LayoutInflater.java:489) at
android.view.LayoutInflater.inflate(LayoutInflater.java:396) at
com.a.b.activity.WalkThroughLoginActivity$WalkthroughFragment.onCreateView(WalkThroughLoginA
ctivity.java:247) at android.support.v4.app.Fragment.performCreateView(Fragment.java:1504)
at android.support.v4.app.y.a(FragmentManager.java:942) at
android.support.v4.app.y.a(FragmentManager.java:1121) at
android.support.v4.app.l.run(BackStackRecord.java:682) at
android.support.v4.app.y.d(FragmentManager.java:1484) at
android.support.v4.app.y.b(FragmentManager.java:482) at
android.support.v4.app.ad.finishUpdate(FragmentPagerAdapter.java:141) at
android.support.v4.view.ViewPager.a(ViewPager.java:1073) at
android.support.v4.view.ViewPager.b(ViewPager.java:919) at
android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1441) at
android.view.View.measure(View.java:15264) at
android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617) at
android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1390) at
android.widget.LinearLayout.measureVertical(LinearLayout.java:681) at
android.widget.LinearLayout.onMeasure(LinearLayout.java:574) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1390) at
android.widget.LinearLayout.measureVertical(LinearLayout.java:681) at
android.widget.LinearLayout.onMeasure(LinearLayout.java:574) at
android.view.View.measure(View.java:15264) at
android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4916) at
android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at
com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2339) at
android.view.View.measure(View.java:15264) at
android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2131) at
android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1242) at
android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1435) at
android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1127) at
android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4606) at
android.view.Choreographer$CallbackRecord.run(Choreographer.java:747) at
android.view.Choreographer.doCallbacks(Choreographer.java:567) at
android.view.Choreographer.doFrame(Choreographer.java:536) at
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:733) at
android.os.Handler.handleCallback(Handler.java:615) at
android.os.Handler.dispatchMessage(Handler.java:92) at
android.os.Looper.loop(Looper.java:153) at
android.app.ActivityThread.main(ActivityThread.java:5006) at
java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke(Method.java:511) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:821) at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584) at
dalvik.system.NativeStart.main(Native Method) Caused by:
java.lang.reflect.InvocationTargetException at
java.lang.reflect.Constructor.constructNative(Native Method) at
java.lang.reflect.Constructor.newInstance(Constructor.java:417) at
android.view.LayoutInflater.createView(LayoutInflater.java:587) ... 59 more Caused by:
android.content.res.Resources$NotFoundException: File res/drawable-mdpi-
v4/walkthrough_safe.png from drawable resource ID #0x7f02015c at
android.content.res.Resources.loadDrawable(Resources.java:2054) at
android.content.res.TypedArray.getDrawable(TypedArray.java:601) at android.widget.ImageView.
<init>(ImageView.java:120) at android.widget.ImageView.<init>(ImageView.java:110) ... 62
more Caused by: java.io.FileNotFoundException: res/drawable-mdpi-v4/walkthrough_safe.png at
android.content.res.AssetManager.openNonAssetNative(Native Method) at
android.content.res.AssetManager.openNonAsset(AssetManager.java:410) at
android.content.res.Resources.loadDrawable(Resources.java:2046) ... 65 more
In the line WalkThroughLoginActivity.java:247 I have this:
inflater.inflate(R.layout.fragment_login_walkthrough_2,
container, false);
And this is the layout file for fragment_login_walkthrough_2.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
style="#style/icon_walkthrough"
android:src="#drawable/walkthrough_safe" />
<TextView
style="#style/title_walkthrough"
android:layout_marginTop="#dimen/margin_walktrough_title"
android:text="#string/walkthrough2_title" />
<TextView
style="#style/text_walkthrough"
android:text="#string/walkthrough2_subtitle"/>
</LinearLayout>
Please correctly if I'm wrong but it seems to me that android is looking up for my drawable in the wrong folder (drawable-mdpi-v4), which obvioulsy does not exist. Not only that, after not finding it, it is not falling back to a more general folder, such us drawable-mdpi.
Have I missed something?
I'm working on an android application that uses facebook sdk 3.6.0, in android studio 0.5.7, after update to 0.8.1 ... facebook sdk does not work,
the following error appears :
07-14 11:39:59.808 544-544/com.example.testdrawer E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testdrawer/com.example.testdrawer.LoginActivity}: android.view.InflateException: Binary XML file line #36: Error inflating class com.facebook.widget.LoginButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
at android.app.ActivityThread.access$600(ActivityThread.java:122)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4340)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at comm.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #36: Error inflating class com.facebook.widget.LoginButton
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
at android.app.Activity.setContentView(Activity.java:1835)
at com.example.testdrawer.LoginActivity.onCreate(LoginActivity.java:65)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
at android.app.ActivityThread.access$600(ActivityThread.java:122)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4340)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.facebook.widget.LoginButton
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.view.LayoutInflater.createView(LayoutInflater.java:552)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
at android.app.Activity.setContentView(Activity.java:1835)
at com.example.testdrawer.LoginActivity.onCreate(LoginActivity.java:65)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
at android.app.ActivityThread.access$600(ActivityThread.java:122)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4340)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
I also changed gradle from 9 to 12
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
How to solve this problem?
thank you!
I do not know exactly what I did, but it works !
I cleaned the project (build-clear project) and I changed something in build.grandle
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 10
targetSdkVersion 14
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:+'
compile project(':libraries:facebook')
compile 'com.google.android.gms:play-services:4.2.42'
compile 'com.android.support:appcompat-v7:+'
}
I'm currently facing to a glitch from an Galaxy Tab 10.1 2 (GT-P5110) which give me that error, but just on that device. I tried on divers emulators (I use genymotion: Nexus 5-7-10, Galaxy S3-4-5, Galaxy Note 2-3) and devices (Galaxy S -2-3-4, Nexus 5-7).
But just on that Galaxy tab 2 10.1 (GT-P5110) I have this error.
I found this link, but this didn't really help me out to solve that problem.
07-01 11:06:58.832 14227-14227/com.********.********.com E/AndroidRuntime﹕ FATAL EXCEPTION: main
android.view.InflateException: Binary XML file line #36: Error inflating class com.package.fr.views.SofiaLiTextView
at android.view.LayoutInflater.createView(LayoutInflater.java:613)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at com.package.fr.fragments.TestFragment.onCreateView(TestFragment.java:82)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at com.package.fr.fragments.TestFragment.onCreateView(TestFragment.java:82)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NumberFormatException: Invalid int: "8.0dip"
at java.lang.Integer.invalidInt(Integer.java:138)
at java.lang.Integer.parse(Integer.java:375)
at java.lang.Integer.parseInt(Integer.java:366)
at com.android.internal.util.XmlUtils.convertValueToInt(XmlUtils.java:123)
at android.content.res.TypedArray.getInt(TypedArray.java:254)
at android.widget.TextView.<init>(TextView.java:997)
at android.widget.TextView.<init>(TextView.java:562)
at com.package.fr.views.SofiaLiTextView.<init>(SofiaLiTextView.java:55)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at com.package.fr.fragments.TestFragment.onCreateView(TestFragment.java:82)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Apparently this would be a bug from the Samsung's Android like said here
Very frustrating >:)>:)
If you are using android:paddingstart attribute, make sure that your target api level is below 17, else try remove this attribute and run the app. It will work.
I'm trying to run the Spydroid app from . But run into a "Unfortunately Spydroid has stopped" as soon as it runs on my Nexus 4.
I used egit to grab a copy of the code into a new project in eclipse. At that point, it threw out a couple errors telling me to right click on the project and select Android Tools --> Fix Project Properties. I did as it said and then hit run, which uploads it to the Nexus 4, installs it and when it attempts to run is when I get the crash.
Am I doing something wrong in the checkout/setup process?
I posted a similar post to the project's google code page
Logcat:
03-28 02:59:20.028: D/AndroidRuntime(31294): Shutting down VM
03-28 02:59:20.028: W/dalvikvm(31294): threadid=1: thread exiting with uncaught exception (group=0x41920930)
03-28 02:59:20.028: E/AndroidRuntime(31294): FATAL EXCEPTION: main
03-28 02:59:20.028: E/AndroidRuntime(31294): java.lang.RuntimeException: Unable to instantiate application net.majorkernelpanic.spydroid.SpydroidApplication: java.lang.ClassNotFoundException: Didn't find class "net.majorkernelpanic.spydroid.SpydroidApplication" on path: /data/app/net.majorkernelpanic.spydroid-1.apk
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364)
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.app.ActivityThread.access$1300(ActivityThread.java:141)
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.os.Handler.dispatchMessage(Handler.java:99)
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.os.Looper.loop(Looper.java:137)
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.app.ActivityThread.main(ActivityThread.java:5041)
03-28 02:59:20.028: E/AndroidRuntime(31294): at java.lang.reflect.Method.invokeNative(Native Method)
03-28 02:59:20.028: E/AndroidRuntime(31294): at java.lang.reflect.Method.invoke(Method.java:511)
03-28 02:59:20.028: E/AndroidRuntime(31294): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-28 02:59:20.028: E/AndroidRuntime(31294): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-28 02:59:20.028: E/AndroidRuntime(31294): at dalvik.system.NativeStart.main(Native Method)
03-28 02:59:20.028: E/AndroidRuntime(31294): Caused by: java.lang.ClassNotFoundException: Didn't find class "net.majorkernelpanic.spydroid.SpydroidApplication" on path: /data/app/net.majorkernelpanic.spydroid-1.apk
03-28 02:59:20.028: E/AndroidRuntime(31294): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
03-28 02:59:20.028: E/AndroidRuntime(31294): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
03-28 02:59:20.028: E/AndroidRuntime(31294): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.app.Instrumentation.newApplication(Instrumentation.java:968)
03-28 02:59:20.028: E/AndroidRuntime(31294): at android.app.LoadedApk.makeApplication(LoadedApk.java:499)
03-28 02:59:20.028: E/AndroidRuntime(31294): ... 11 more
Possible error can be:
Check the package name carefully
Check order/export option in Build Path