0

I'm trying to implement facebook login in my app. This is my gradle file:

apply plugin: 'com.android.application'

android {
compileSdkVersion 20
buildToolsVersion "20.0.0"

defaultConfig {
    applicationId "some"
    minSdkVersion 16
    targetSdkVersion 20
    versionCode 6
    versionName "2.4"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:20.0.0'
    compile 'com.google.android.gms:play-services:7.0.0'
    compile 'com.github.nkzawa:socket.io-client:0.2.0'
    compile 'com.android.support:support-v4:20.0.0'
    compile 'com.facebook.android:facebook-android-sdk:4.0.0'
}

And I placed the following layout where desired (I can see the button right before the crash):

<com.facebook.login.widget.LoginButton
    android:id="@+id/login_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_marginTop="30dp"
    android:layout_marginBottom="30dp" />

And I also start the sdk like this in onCreate in an active activity of type FragmentActivity:

    FacebookSdk.sdkInitialize(getApplicationContext());

The errors I obtain are as follows:

 FATAL EXCEPTION: AsyncTask #3
 java.lang.RuntimeException: An error occured while executing doInBackground()

and

04-18 12:35:21.400    6833-7070/ E/ActivityThread﹕ Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider
04-18 12:35:22.280    6833-7100/ E/SQLiteLog﹕ (14) cannot open file at line 30174 of [00bb9c9ce4]
04-18 12:35:22.280    6833-7100/ E/SQLiteLog﹕ (14) os_unix.c:30174: (2) open(/CachedGeoposition.db) -
04-18 12:35:22.280    6833-7100/ D/WebKit﹕ ERROR:
04-18 12:35:22.280    6833-7100/ D/WebKit﹕ SQLite database failed to load from /CachedGeoposition.db
    Cause - unable to open database file

even though I don't use sqlite, so I suppose it has something to do with facebook...

What is missing here?

Fane
  • 1,978
  • 8
  • 30
  • 58
  • @HareshChhelana Why would the facebook app be needed? ... And do I still need to put the sdk in the app folder if I have it on gradle? – Fane Apr 18 '15 at 12:32

1 Answers1

0
04-18 12:35:21.400    6833-7070/ E/ActivityThread﹕ Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider

this is tell you ,no provider with your phone.this provider is facebook app provide

you may be install facebook app.

I search this problem,you can see

Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider

Failed to find provider info for com.facebook.katana.provider.platformprovider and com.facebook.wakizashi.provider.platformprovider

Failed to find provider info for com.facebook.katana.provider.PlatformProvider

so,this not your carsh cause,this only one log,check your have facebook app。 you may be check sqlite error,this your carsh cause.

but,your crash because sqlite,you can see Android webview geoposition database failed to open

I guess you use Emulator?

try

mWebView.getSettings().setGeolocationDatabasePath(getFilesDir().getPath());

Community
  • 1
  • 1
SamPeng
  • 38
  • 5