Exception in Facebook Like button for android apps - android

I have setup correctly the facebook SDK for facebook like button. It works fine on one phone (Android 4.3) but gives an exception on the other (Android 4.4.4)
The exception is as:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.compzets.popopics/com.compzets.popopics.ui.MainPagerActivity}: android.view.InflateException: Binary XML file line #80: Error inflating class com.facebook.widget.LikeView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2212)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2271)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5146)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #80: Error inflating class com.facebook.widget.LikeView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228)
at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102)
at com.compzets.popopics.ui.MainPagerActivity.onCreate(MainPagerActivity.java:58)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169)
... 11 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.widget.LikeView" on path: DexPathList[[zip file "/data/app/com.compzets.popopics-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.compzets.popopics-1, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.view.LayoutInflater.createView(LayoutInflater.java:559)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
... 22 more
It gives a ClassNotFoundException, I have no clue as to why it happens? And if there is an issue then why it isn't reflected on both phones.

I faced a similar issue some days back and the following solved it:
Removed compile 'com.facebook.android:facebook-android-sdk:3.21.1' from the dependencies in gradle
Synced it
Added the same dependency again
Again Synced it
Hope this works for you as well!

Related

FATAL EXCEPTION : unable to instantiate activity componentInfo in android studio

I have tried every answer for this on Google, but none worked for me.
I have just created an app I Android studio and add .jar file and simply running it.
But the app crashes leaving with below error message.
FATAL EXCEPTION: main Process: com.vtek.cam_pwr_flsh_cntrl, PID: 4850
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.vtek.cam_pwr_flsh_cntrl/com.vtek.cam_pwr_flsh_cntrl.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.vtek.cam_pwr_flsh_cntrl.MainActivity" on path: DexPathList[[zip file "/data/app/com.vtek.cam_pwr_flsh_cntrl-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.vtek.cam_pwr_flsh_cntrl-2, /vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.vtek.cam_pwr_flsh_cntrl.MainActivity" on path: DexPathList[[zip file "/data/app/com.vtek.cam_pwr_flsh_cntrl-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.vtek.cam_pwr_flsh_cntrl-2, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5017) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
at dalvik.system.NativeStart.main(Native Method) 
Check in your manifest file if you have declared the class as an activity.
If missing, do it.
Clean and REBUILD the code.
Hope this helps.

InflateException when using chrisjenx CalligraphyLayoutInflater , android.view.InflateException

Hi So in our project we are using calligraphy library , it works with no issues but now in one of the activity i added it keeps crashing with the following stacktrace:
01-23 02:25:32.178 3654-3654/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example, PID: 3654
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example/com.example.activities.MultipleActivity}: android.view.InflateException: Binary XML file line #98: Error inflating class com.example.components.WLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #98: Error inflating class com.example.components.WLayout
at android.view.LayoutInflater.createView(LayoutInflater.java:621)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.createCustomViewInternal(CalligraphyLayoutInflater.java:211)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.access$000(CalligraphyLayoutInflater.java:20)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$PrivateWrapperFactory2.onCreateView(CalligraphyLayoutInflater.java:302)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:690)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:756)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate(CalligraphyLayoutInflater.java:60)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.activities.MultipleActivity.onCreate(MultipleActivity.java:62)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
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:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:595)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.createCustomViewInternal(CalligraphyLayoutInflater.java:211)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.access$000(CalligraphyLayoutInflater.java:20)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$PrivateWrapperFactory2.onCreateView(CalligraphyLayoutInflater.java:302)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:690)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:756)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate(CalligraphyLayoutInflater.java:60)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.example.activities.MultipleActivity.onCreate(MultipleActivity.java:62)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #13: Error inflating class TextView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:714)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:756)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
at android.view.LayoutInflater.parseInclude(LayoutInflater.java:840)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate(CalligraphyLayoutInflater.java:60)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
I checked a few answers but cant see anyone facing issue with textview.
I am attaching to calligraphy as follows in my activity
#Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
}
The theme of the activity is as follows
<style name="AppTheme.Compat.ActionBar.Dark.NoBackground" parent="AppTheme.Compat.ActionBar.Dark">
<item name="android:windowBackground">#null</item>
<item name="android:textColor">#color/alert_title</item>
<item name="android:textColorPrimary">#color/gray400</item>
<item name="android:colorAccent">#color/alert_button</item>
</style>
I noticed studio giving warning for android:colorAccent and replace with "colorAccent" that removed the warning but the crash remained . Any clues what am I doing wrong here ??
Finally figured out the problem , Since the issue was happening in Textview as per the crash logs
Caused by: android.view.InflateException: Binary XML file line #13: Error inflating class TextView
TLDR : dont use setbackground for TextView its bug prone (samsung), espcially if its Vector drawable.
I verified by removing the textview the crash stopped happening.The issue was i used to set background image for my textview and it was a SVG image and i have been appCompact library(v23). Setting vector drawable is only supported via "app:srcCompat" or "setImageResource()" as the foolproof way to use vector drawable.
I read the this blog post to see https://android-developers.googleblog.com/2016/02/android-support-library-232.html I see previous supported Textview has now been striked out , which means its not stable and bug prone.
I removed the Vector drawable from textview and added a another Imageview just below textview with the vector drawable using "src:compact", so that visually they still look same i.e a Text view with background.
If app size isnt a issue you can also use a png /jpg resource and avoid the creation of extra imageview in your layout.
For Android Studio 3.0.1
I have got the same issue and I have resolved finally Opening the gradle.properties and added following line:
android.enableAapt2=false

ClassNotFoundException after adding Ion library in Android 4.4 (19)

After adding the Ion library to my project, I can't start my app in Android 4.4, everything higher works fine.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.swe.gruppe4.mockup2, PID: 3281
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.swe.gruppe4.mockup2/com.swe.gruppe4.mockup2.LoginActivity}: java.lang.ClassNotFoundException: Didn't find class "com.swe.gruppe4.mockup2.LoginActivity" on path: DexPathList[[zip file "/data/app/com.swe.gruppe4.mockup2-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.swe.gruppe4.mockup2-2, /vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.swe.gruppe4.mockup2.LoginActivity" on path: DexPathList[[zip file "/data/app/com.swe.gruppe4.mockup2-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.swe.gruppe4.mockup2-2, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5017) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
at dalvik.system.NativeStart.main(Native Method) 
Application terminated.
I added Ion through the app's build.gradle as it is stated on the github, compile 'com.koushikdutta.ion:ion:2.+'.
As stated earlier, on higher Android versions it works fine.
It also works fine on a completely clean project with just adding Ion
I now fixed it myself.
I created a new project with the same package name and copied the app folder completely to the new project, it works fine there. Weird!

Android Facebook LoginButton class not found

I imported the Facebook SDK (v3.21.1) module into Android Studio (v1.0.2), and am trying to create a LoginActivity with com.facebook.widget.LoginButton as suggested in the documentation with the following code:
<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"
android:orientation="vertical">
<com.facebook.widget.LoginButton
android:id="#+id/authButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
/>
</LinearLayout>
However, the renderer in Android Studio says that it can't find the LoginButton class:
The following classes could not be found: - com.facebook.widget.LoginButton
I know for a fact that the class exists because I can open the file, and it is in the correct location:
I know it exists, but to prove to Android Studio that it does, I tried creating a class, as suggested in the renderer, and receive the following error:
I've tried the following as well:
Re-importing the Facebook SDK (deleting/re-importing the Facebook module: deleting the physical files, etc)
Re-opening my project
Re-opening Android Studio
Building the project
Nothing works. What's ridiculous is that even the auto-complete can see the class:
Edit: I tried just running the app in the emulator, ignoring the rendering error, and the app crashes with the following error:
12-31 03:47:15.593 2824-2824/com.test.playground E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.test.playground, PID: 2824
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.playground/com.test.playground.LoginActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class com.facebook.widget.LoginButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class com.facebook.widget.LoginButton
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
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:290)
at android.app.Activity.setContentView(Activity.java:1929)
at com.test.playground.LoginActivity.onCreate(LoginActivity.java:15)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5001)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.widget.LoginButton" on path: DexPathList[[zip file "/data/app/com.test.playground-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.test.playground-2, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.view.LayoutInflater.createView(LayoutInflater.java:559)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
            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:290)
            at android.app.Activity.setContentView(Activity.java:1929)
            at com.test.playground.LoginActivity.onCreate(LoginActivity.java:15)
            at android.app.Activity.performCreate(Activity.java:5231)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5001)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)
Again, the class does exist, it just seems that Android Studio can't find it. The class is viewable in the project directory under com.faceook.widget.LoginButton... I don't know what I'm missing. I've been trying to figure this out for hours and nothing is working.
For those who still have problem,
change com.facebook.widget.LoginButton to com.facebook.login.widget.LoginButton might help.
Have you integrated the Facebook SDK into your project? Check the build.gradle of your module and make sure that Facebook SDK is in dependencies. If not, add it and sync with Gradle and then try again.
The Facebook module should be added to the dependencies in build.gradle of the project that uses it:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':facebook')
}
As well, the Facebook module should be imported in settings.gradle:
include ':app', ':facebook'

Android Time Square Calendar erro at XML

ok guy's.. hellow.. that's my problam:
i'm trying build one Custom CalendarView to Android with Eclipse.. so i'm trying do it with Android Times square.
I import JAR from HERE
so.. whem a put XLM exemple:
<com.squareup.timessquare.CalendarPickerView
android:id="#+id/calendar_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
so whem i try change to Graphical Layout I get the following error, this is at Graphical Layout:
Exception raised during rendering: Color value '16dp' must start with #
Exception details are logged in Window > Show View > Error Log
The following classes could not be instantiated:
- com.squareup.timessquare.CalendarPickerView (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
...
java.lang.NumberFormatException: Color value '16dp' must start with #
at com.android.layoutlib.bridge.impl.ResourceHelper.getColor(ResourceHelper.java:72)
at android.content.res.BridgeResources.getColor(BridgeResources.java:182)
at com.squareup.timessquare.CalendarPickerView.<init>(CalendarPickerView.java:101)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(at sun.reflect.NativeConstructorAccessorImpl.newInstance( at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( at java.lang.reflect.Constructor.newInstance( at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:438)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:190)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:132)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
So.. and this is the LogCat
FATAL EXCEPTION: main
Process: com.example.exemplocalendario2, PID: 815
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.exemplocalendario2/com.example.exemplocalendario2.MainActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class com.squareup.timessquare.CalendarPickerView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
by: android.view.InflateException: Binary XML file line #12: Error inflating class com.squareup.timessquare.CalendarPickerView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
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:290)
at android.app.Activity.setContentView(Activity.java:1929)
at com.example.exemplocalendario2.MainActivity.onCreate(MainActivity.java:14)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
... 11 more
by: java.lang.ClassNotFoundException: Didn't find class "com.squareup.timessquare.CalendarPickerView" on path: DexPathList[[zip file "/data/app/com.example.exemplocalendario2-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.exemplocalendario2-1, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.view.LayoutInflater.createView(LayoutInflater.java:559)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
... 21 more
So guy's.. that's my problam.. :/ if some1 can help-me.. ty so much :)

Categories

Resources