Android Studio doesn't recognize Facebook imports -


i'm begginer , trying create app facebook integration.

i have done steps(importing facebook sdk in module structure,adding missing depedencies in gradle files,adding dependencies module app project in structure again). seemed fine,i added simple loginbutton in main_activity.xml) , no error showed up.

since tried facebook imports needed in mainactivity.java, turned red. imports like:

    import com.facebook.session;     import com.facebook.sessionstate;     import com.facebook.uilifecyclehelper;     import com.facebook.widget.loginbutton;     import com.facebook.widget.loginbutton.userinfochangedcallback; 

and messages "symbol session cannot resolved". googled as could,couldn't find solution worked me. @ opposite, didn't seem have problem:

    import com.facebook.login.widget.loginbutton; 

here android manifest file xml:

    <?xml version="1.0" encoding="utf-8"?>     <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.user.moviere" >      <uses-permission android:name="android.permission.internet"/>     <application         android:allowbackup="true"         android:icon="@mipmap/ic_launcher"         android:label="@string/app_name"         android:theme="@style/apptheme" >         <meta-data android:name="com.facebook.sdk.applicationid" android:value="@string/facebook_app_id"/>         <activity             android:name=".mainactivity"             android:label="@string/app_name" >             <intent-filter>                 <action android:name="android.intent.action.main" />                  <category android:name="android.intent.category.launcher" />             </intent-filter>         </activity>          <activity android:name="com.facebook.loginactivity"             android:theme="@android:style/theme.translucent.notitlebar"             android:label="@string/app_name" />         <meta-data android:name="com.facebook.sdk.applicationid" android:value="@string/facebook_app_id"/>          <activity android:name="com.facebook.facebookactivity"             android:configchanges=                 "keyboard|keyboardhidden|screenlayout|screensize|orientation"             android:theme="@android:style/theme.translucent.notitlebar"             android:label="@string/app_name" />     </application>  </manifest> 

and here build.gradle

    apply plugin: 'com.android.application'  android {     compilesdkversion 21     buildtoolsversion '21.1.2'      defaultconfig {         applicationid "com.user.moviere"         minsdkversion 9         targetsdkversion 22         versioncode 1         versionname "1.0"     }     buildtypes {         release {             minifyenabled false             proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro'         }     } } repositories {     mavencentral() } dependencies {     compile filetree(dir: 'libs', include: ['*.jar'])     // compile project(':facebook')     compile 'com.android.support:appcompat-v7:22.0.0'     compile 'com.facebook.android:facebook-android-sdk:4.0.0'     compile 'com.android.support:support-v4:22.0.0'    } 

ok, created project beginning,imported fb sdk again. real problem imports facebook sdk 4 has changed of functions,one of them uilifecyclehelper example, doesn't exist anymore.

full details changes here:

https://developers.facebook.com/docs/android/upgrading-4.x


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -