Project is showing errors in Facebook sdk after importing it to Android Studio from eclipse

I am recently switching into android studio from eclipse and trying to import my old eclipse project from Eclipse to Android Studio. I have exported gradle files from eclipse then importing my project into studio. My project consists of sub-projects like google play services, facebook SDK etc, project was running completely fine in eclipse but after importing into Studio it is giving errors into facebook SDK (unable to find the jars but all are present in my project).

I am also attaching my gradle files of facebook as well as of main project.

Facebook build.gradle

apply plugin: 'com.android.library'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
}

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}

sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }

    // Move the tests to tests/java, tests/res, etc...
    instrumentTest.setRoot('tests')

    // Move the build types to build-types/<type>
    // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
    // This moves them out of them default location under src/<type>/... which would
    // conflict with src/ being used by the main source set.
    // Adding new build types or product flavors should be accompanied
    // by a similar customization.
    debug.setRoot('build-types/debug')
    release.setRoot('build-types/release')
}
}

Project build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
    }
}

There are two manifest files generated I am attaching the new one…

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.blah.app"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="22" />

    <!--
    Permissions needed for accessing Location API provided by Google,
    Login provided by Facebook and Google+ Login by Google Again
    -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/cric_logon"
        android:label="@string/app_name" >

        <service
            android:name=".location.GetLocationIntentService"
            android:exported="false" />

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/app_id" />

        <!-- Defining the service for fetching the location of device -->

        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="AIzaSyAETzpsrN4qmMe7ok92MHSz-yWcuH1-F04" />

        <activity
            android:name=".SplashActivity"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/title_activity_splash"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".LoginActivity"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
        <activity
            android:name="com.blah.app.HomeActivity"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@style/blahActionBarTheme" >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.blah.app.LoginActivity" />
        </activity>
    </application>

</manifest>

I am attaching the event log screenshots !

PS- I am getting 100’s of such errors, I am new to android please help me out from this situation… thanks in advance and sorry for such a long post.

Event log with errorsEvent Log contains errors


Source: facebook

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.