在实施Facebook时呈现问题

时间:2015-12-05 12:40:00

标签: android xml facebook-sdk-4.0

我正在尝试将facebook登录到我的app seen this链接

我在xml文件中看到了很多渲染问题和一些异常。

这是我的xml

fragment_main.xml

<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:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:orientation="vertical"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivityFragment">

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="New Text"
        android:id="@+id/textView"
        android:layout_centerHorizontal="true"/>

    <com.facebook.login.widget.LoginButton
        android:id="@+id/login_button"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />


</LinearLayout>

错误如下

Rendering Problems The following classes could not be found:

The following classes could not be instantiated : 
- android.support.v7.internal.app.WindowDecorActionBar (Fix Build Path, Create Class)

 Tip: Try to build the project.  The following classes could not be instantiated:

  The following classes could not be instantiated : 
- com.facebook.login.widget.LoginButton (Open Class, Show Exception, Clear Cache)

 Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE  

Exception Details java.lang.NoClassDefFoundError: Could not initialize class com.facebook.login.widget.LoginButton   at java.lang.reflect.Constructor.newInstance(Constructor.java:422)   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)   at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:835)   at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:811)   at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)   at android.view.LayoutInflater.inflate(LayoutInflater.java:515)   at android.view.LayoutInflater.inflate(LayoutInflater.java:394)

这是什么渲染问题???

每当我开始任何项目时,我都会遇到这个渲染问题

在这个应用程序中,当我运行项目时,应用程序崩溃了下面的日志文件

日志文件

12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: Process: app.first.sinduja.fbfrnd, PID: 7027
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at android.os.AsyncTask$3.done(AsyncTask.java:309)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at java.util.concurrent.FutureTask.run(FutureTask.java:242)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at java.lang.Thread.run(Thread.java:818)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Object.hashCode()' on a null object reference
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:772)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:800)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at com.facebook.internal.Utility.queryAppSettings(Utility.java:802)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at com.facebook.login.widget.LoginButton$1.doInBackground(LoginButton.java:502)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at com.facebook.login.widget.LoginButton$1.doInBackground(LoginButton.java:499)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at android.os.AsyncTask$2.call(AsyncTask.java:295)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234) 
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
12-05 18:41:34.207 7027-7075/app.first.sinduja.fbfrnd E/AndroidRuntime:     at java.lang.Thread.run(Thread.java:818) 

请提前帮助我帮助我完成这个项目。

0 个答案:

没有答案