Populating Android manifest for using parse.com SDK - android

I am new to Android and trying to incorporate the parse.com sdk. I suspect my android manifest is not correct below around the parse activity. It was working fine in the starter app and I tried to transfer that to my own app. Rest of files should be fine.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jorc.fleetmanagement">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
<activity
android:name=".MapsActivity"
android:label="#string/legal_info"/>
<activity
android:name=".ImageList"
android:label="#string/image_info"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".StarterApplication"
android:label="#string/app_name" >
<meta-data
android:name="com.parse.APPLICATION_ID"
android:value="#string/parse_app_id" />
<meta-data
android:name="com.parse.CLIENT_KEY"
android:value="#string/parse_client_key" />
</activity>
</application>
</manifest>
The StarterApplication.java is also below.
package com.jorc.fleetmanagement;
import android.app.Application;
import com.parse.Parse;
import com.parse.ParseACL;
import com.parse.ParseUser;
public class StarterApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
// Enable Local Datastore.
Parse.enableLocalDatastore(this);
// Add your initialization code here
Parse.initialize(this,"my id", "my key");
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
// Optionally enable public read access.
// defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
}
}
My app build.gradle is also below. Not sure what this mavern and jcenter means as I changed from jcenter to mavern (is this a right thing to do)
apply plugin: 'com.android.application'
apply plugin: 'com.parse'
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.parse.com/repo' }
}
dependencies {
classpath 'com.parse.tools:gradle:1.+'
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.jorc.fleetmanagement"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.parse.bolts:bolts-tasks:1.3.0'
compile 'com.parse:parse-android:1.11.0'
}
The error message is below being fairly sure it is because parse is not connecting and getting any results.
12-05 12:07:33.106 1858-1858/com.jorc.fleetmanagement D/score: Error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File com.parse.ParsePlugins.getParseDir()' on a null object reference
12-05 12:07:33.159 1858-1876/com.jorc.fleetmanagement W/EGL_emulation: eglSurfaceAttrib not implemented
12-05 12:07:33.159 1858-1876/com.jorc.fleetmanagement W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xb4319c20, error=EGL_SUCCESS

Are you referencing the StarterApplication in your manifest file.
If you are not referencing it then just make application tag like this
Instead of referencing application class as an activity
<activity
android:name=".StarterApplication"
android:label="#string/app_name" >
Edit your apllication tag like this
<application
android:name=".StarterApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
Just add android:name=".StarterApplication" to you application tag
Then i think everything should work fine..

Related

label app_name changes to library label in Android

In my app, I use a library from an aar file. lets say library.aar
My app is called, "Awsome app", so I have a string value:
<string name="app_name" translatable="false">Awsome app</string>
But when I compile the app, the name in the mobilephone is "SDK", where this label is from the library.aar
strings.xml:
<string name="app_name" translatable="false">Awsome App</string>
Is there any way to avoid the library change my app name?
== EDIT ==
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xxx.xxx.AwsomeApp">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name="xxx.xxx.AwsomeApp"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<meta-data
android:name="DATABASE"
android:value="app.db" />
<meta-data
android:name="VERSION"
android:value="1" />
<meta-data
android:name="QUERY_LOG"
android:value="false" />
<meta-data
android:name="DOMAIN_PACKAGE_NAME"
android:value="xxx.xxx.AwsomeApp" />
<activity
android:name="xxx.xxx.AwsomeApp.MainActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:screenOrientation="portrait" />
<activity
android:name="xxx.xxx.AwsomeApp.SplashActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="xxx.xxx.AwsomeApp.LegalActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:screenOrientation="portrait" />
<activity
android:name="xxx.xxx.AwsomeApp.LoginActivity"
android:configChanges="orientation"
android:label="#string/app_name"
android:screenOrientation="portrait" />
<activity
android:name="xxx.xxx.AwsomeApp.QuizActivity"
android:label="#string/title_activity_quiz" />
<meta-data
android:name="io.fabric.ApiKey"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
</application>
</manifest>
I add the gradle file to:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.20.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 25
buildToolsVersion '23.0.3'
productFlavors{
vanilla {
applicationId "xxx.xxx.AwsomeApp"
buildConfigField 'String','HOST_API', '"awsomeURL"'
}
bsa {
applicationId "xxx.xxx.AwsomeApp.bsa"
buildConfigField 'String','HOST_API', '"awsomeURL"'
}
}
defaultConfig {
applicationId "xxx.xxx.AwsomeApp"
minSdkVersion 15
targetSdkVersion 25
versionCode 8
versionName "1.4"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
flatDir {
dirs 'libs'
}
}
dependencies {
androidTestCompile 'com.android.support:support-annotations:25.0.1'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.github.satyan:sugar:1.4'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.3'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile 'com.squareup.okhttp3:okhttp:3.5.0'
compile 'com.problematiclibrary.sdk:sdk-release#aar' <<--- here is the libray (I dont put the real name, cause if from work)
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
}
Try to put App name direct as String in application tag. and show the output.
<application
android:name="xxx.xxx.AwsomeApp"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="Awsome App"
android:supportsRtl="true"
android:theme="#style/AppTheme">
Let me know after try this...

MapBox SDK not working android

I just started to use the MapBox SDK but its not working I was following the steps on the documentation but Im not getting any classes from their SDK here is my code:
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.mapp.hello"
minSdkVersion 15
targetSdkVersion 24
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'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:4.2.0-beta.2#aar'){
transitive=true
}
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.mapp.hello"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<service android:name="com.mapbox.mapboxsdk.telemetry.TelemetryService"/>
</application>
</manifest>
The com.mapbox.mapboxsdk.telemetry.TelemetryService is shown in red and I cannot import the MapboxAccountManager
I know it's an old question, but I just had the same error while trying to update from Mapbox 4.x to 5.x and it turns out you have to change:
<service android:name="com.mapbox.mapboxsdk.telemetry.TelemetryService"/>
to
<service android:name="com.mapbox.services.android.telemetry.service.TelemetryService" />
Update:
Turns out in the latest version (5.x) you don't have to declare it in the Manifest at all, as Mapbox now makes use of Manifest merge feature.
I dont know how but the app was getting run even though gradle build was stopped because of lint, I just stopped lint from stopping the build process now everything is working :)

Migrating to Heroku from Parse, but Parse.Configuration.Builder won't resolve

I am stuck on the last step trying to migrate my android app to heroku. In my android app I need to initialize my parse server by using a Parse.Configuration.Builder, but 'Configuration' is in red and I cannot figure out how to resolve the issue.
I have been referencing the parse server on github here:
https://github.com/ParsePlatform/parse-server-example
it gives this boilerplate code for initializing your android app to use heroku:
Parse.initialize(new Parse.Configuration.Builder(getApplicationContext()).applicationId("myAppId").clientKey("myClientKey").server("http://myServerUrl/parse/").build());
When I create a new project I do not get the error, but I have checked the build files and manifest against the old project and cannot figure out what the hold up could be.
Here is my application class:
package oneonanyone.com.fantasybasketball_1onany1;
import com.parse.Parse;
public class StatSelectApplication extends android.app.Application {
#Override
public void onCreate() {
super.onCreate();
//Parse.enableLocalDatastore(this);
//Parse.initialize(this, "xxxxx", "xxxxx");
Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
.applicationId("xxxxx")
.clientKey("xxxxx")
.server("http://xxxxx.herokuapp.com/parse/")
.build());
}
}
build.grade
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "oneonanyone.com.fantasybasketball_1onany1"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable true
}
repositories {
jcenter()
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.parse.bolts:bolts-tasks:1.3.0'
compile 'com.parse:parse-android:1.13.0'
compile fileTree('libs')
compile fileTree(dir: 'libs', include: ['*.jar'])
//compile 'com.commonsware.cwac:wakeful:1.0.+'
}
Manifest:
<?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="oneonanyone.com.fantasybasketball_1onany1">
<uses-sdk/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.SET_DEBUG_APP"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<!--
To retrieve OAuth 2.0 tokens or invalidate tokens to disconnect a user. This disconnect
option is required to comply with the Google+ Sign-In developer policies
-->
<uses-permission android:name="android.permission.USE_CREDENTIALS"/>
<!-- To retrieve the account name (email) as part of sign-in: -->
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.READ_PROFILE"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<application
android:name=".StatSelectApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launch"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".DraftListActivity"
android:label="PlayerListActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"/>
<activity
android:name=".MainActivity"
android:label="Darkhorse"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".MatchUpActivity"
android:label="#string/title_activity_matchup"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<activity
android:name=".MatchUpResultsActivity"
android:label="#string/title_activity_game_results"
android:screenOrientation="portrait"/>
<activity
android:name=".Login.LoginActivity"
android:label="#string/title_activity_login"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden"/>
<activity
android:name=".Login.SignUpAtivity"
android:label="#string/title_activity_sign_up_ativity"
android:screenOrientation="portrait"/>
<activity
android:name=".ResultsActivityNew"
android:label="#string/title_activity_new_results"
android:screenOrientation="portrait"/>
<activity
android:name=".LeaderBoardActivity"
android:label="#string/title_activity_leader_board"
android:screenOrientation="portrait"/>
<activity
android:name=".AlternateDraftActivity"
android:label="#string/title_activity_alternate_draft"/>
<receiver android:name=".UpdateBackend">
<intent-filter>
<action android:name="android.net.ConnectivityManager.CONNECTIVITY_ACTION"/>
</intent-filter>
</receiver>
</application>
And my project gradle just in case:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-beta5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
task clean(type: Delete) {
delete rootProject.buildDir
}
}
I could not find anyone else having this error. Any solution would be most appreciated.
Check answer here: connecting android to local parse server cannot resolve symbol Configuration
I had the Parse library as a jar in the libs folder. Solved the issue by deleting it and compiling from Gradle instead.

How to fix "Activity class does not exist" error in android? [duplicate]

This question already has answers here:
Package rename and error "Activity class does not exist"
(11 answers)
Closed 7 years ago.
I was trying to rename my first android project to something else following the suggestion by Ben in this post. However, even after following the suggestions here to clean up, I get an error when the app is started on my phone (build went fine):
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.impyiablue.stoxx/com.example.alexander.myapplication.MainActivity }
Error type 3
Error: Activity class
The content of my gradle.build file is as follows:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.impyiablue.stoxx"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
preDexLibraries = false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.+'
compile 'com.android.support:design:23.1.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
My Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.impyiablue.stoxx" >
<uses-permission android:name="android.permission.INTERNET" />
<application>
android:allowBackup="true"
android:icon="#mipmap/stoxx"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/Theme.AppCompat.Light" />
<activity
android:name="com.impyiablue.stoxx.MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.impyiablue.stoxx.NewEntryActivity"
android:label="#string/menu_add"
android:theme="#style/AppTheme.NoActionBar"
/>
</application>
</manifest>
What else do I have to modify so AndroidStudio 'sees' the new name? Or whatever is wrong?
edit application tag as show in below:
<application
android:allowBackup="true"
android:icon="#mipmap/stoxx"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/Theme.AppCompat.Light" >
The activity tags are outside the application tag because you closed the application tag.
<application> " The '>' over here should not be there"
android:allowBackup="true"
android:icon="#mipmap/stoxx"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/Theme.AppCompat.Light" /> " The '/' over here closes the application tag."
Your activity tags need to be enclosed within the application tag.
Your application tag should like this :
<application
android:allowBackup="true"
android:icon="#mipmap/stoxx"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/Theme.AppCompat.Light" >
<activity
android:name="com.impyiablue.stoxx.MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.impyiablue.stoxx.NewEntryActivity"
android:label="#string/menu_add"
android:theme="#style/AppTheme.NoActionBar"
/>
</application>

Android Studio doesn't recognize Facebook imports

I'm a begginer and I am trying to create an app with Facebook Integration.
I have done all the steps(Importing Facebook SDK in Module Structure,adding missing depedencies in gradle files,adding the dependencies module for my app project in Structure again).
Everything seemed to be fine,I added A simple LoginButton in main_activity.xml) and no error showed up.
Since I tried to do all the facebook imports needed in MainActivity.java, they all turned red. Those were 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 like "symbol session cannot be resolved". I googled it as much as I could,couldn't find a solution that worked for me.
At the opposite, this didn't seem to have a problem:
import com.facebook.login.widget.LoginButton;
Here is my 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 is my 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, I created the project from the beginning,imported the FB SDK again. But the real problem with the imports was that Facebook SDK 4 has changed some of the functions,one of them is UiLifecycleHelper for example, it doesn't exist anymore.
Full details about all the changes is here:
https://developers.facebook.com/docs/android/upgrading-4.x
yeah in the current update of the facebook sdk they have removed Session , now AccessToken, LoginManager and CallbackManager classes supercede and replace functionality in the Session class.
For more details go to -
https://developers.facebook.com/docs/android/upgrading-4.x
Update Facebook Dependency
compile 'com.facebook.android:facebook-android-sdk:4.8.0'
Need Permission in Manifest File
<uses-permission android:name="android.permission.INTERNET"/>
<meta-data
android:name="com.facebook.sdk.ApplicationName"
android:value="#string/app_name" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider1854328631556764"
android:exported="true" />
Its Working
More Details :-
https://developers.facebook.com/docs/android/upgrading-4.x

Categories

Resources