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?