I'm followed some tuts for including the FB SDK
but when I want to import
import com.facebook.FacebookSdk;
I need this for FB analytics, so I'm created the class fbanalytic :
image here
and we see it's hidden i dont know fix it
and also someone his tell that class it's not important specialy in the latest version in fb sdk ,is that correct?
currently im using latest verion :facebook-android-sdk-4.22.1
Using the Facebook SDK:
Import the sdk by adding compile dependency to build.gradle file
dependencies {
compile 'com.facebook.android:facebook-android-sdk:4.+'
}
Now when you are trying to use something from Facebook's SDK it should be AUTOMATICALLY imported to your files.
In your example you are making a new Class that does uses AppEventsLogger that is part of Facebook SDK. The import statement that you presumably wrote (import com.facebook.FacebookSDK) is grey and second import statement clearly shows that it is importing form com.facebook.* SDK.
tldr: Android Studio imports from Facebook SDK as expected.
Add in build.gladle within dependencies bracket:
compile 'com.facebook.android:facebook-android-sdk:4.+'
Might be duplicate.
Related
I'm want to implement Twitter login in my app, but I can't import any of the related classes.
In my gradle I added:
implementation 'com.twitter.sdk.android:twitter:3.3.0'
gradle sync works fine, app compiles and run, but I'm not able to import any of the com.twitter classes like TwitterConfig. If I write "Twitter" and let Android Studio suggest me the only option I get are TwitterAuthCredential and TwitterAuthProvider both from com.google.firebase.auth.
What is going on? Am I missing some gradle line?
I managed to solve it importing only the dependecies I needed:
implementation 'com.twitter.sdk.android:twitter-core:3.3.0'
implementation 'com.twitter.sdk.android:tweet-ui:3.3.0'
implementation 'com.twitter.sdk.android:tweet-composer:3.3.0'
implementation 'com.twitter.sdk.android:twitter-mopub:3.3.0'
It migth be related to the large size of the library.
I specify the Facebook SDK as a remote dependency in my build.gradle file, however I've also had to import the actual SDK files into my Android project. Isn't that redundant? Or does the specification of the remote dependency and the import of the Facebook SDK files fulfill two different requirements.
If I want to update the SDK version my app uses, is it necessary to update the actual SDK files I previously imported into my project? Or can I just update my dependency in the build.gradle file?
Open your your_app | build.gradle, and add the compile dependency
dependencies {
compile 'com.facebook.android:facebook-android-sdk:4.+'
}
Build your project. Now you can import com.facebook.FacebookSdk into your app.
It's all what you need to use de Facebook Sdk. If you want to update facebook sdk version just change de compile dependency and sync gradle.
For more information visit Facebook Docs
I am creating android application 'GoogleCloudMessaging'. I Have found many that 'GcmListenerService' is being used and the old method 'GCMIntentService' is now deprecated.
I have already install the Google Play service and add it into the dependency.
But when i try to import
import com.google.android.gms.gcm.GcmListenerService;
it gives error "cannot resolve symbol."
How can I import the Class?
I refer https://developers.google.com/android/reference/com/google/android/gms/gcm/GoogleCloudMessaging and
https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmListenerService.html#GcmListenerService()
and follow the things but still unable to solve the problem.
If you have already added Google Play Services to your dependencies, the issue might be its version.
Try to update the line(in your build.gradle) to:
compile 'com.google.android.gms:play-services:7.5.0'
Then sync your project.
You must include
compile 'com.google.android.gms:play-services-gcm:11.0.4'
in your build.gradle file.
I am trying to use clustering in my application. However on the import statements I get 'the import com.google.maps cannot be resolved (clustering.Cluster).
Also, when using ClusterManager I get 'cannot be resolved to a type'.
The rest of the google play services are working fine.
Are you using Android Studio, or Eclipse? Might need to check your gradle file (Android Studio for example) to see if you have the library/module dependencies lined up. If you are using this library (https://github.com/googlemaps/android-maps-utils) for example, your gradle file should have something like :
dependencies {
compile 'com.google.maps.android:android-maps-utils:0.3+'
}
I am using Android Studio and have followed this article from google as well as some other articles discussing how to use the new ActionBarCompat.
I have downloaded the support library (Rev. 18) in Android SDK Manager and added the following in my build.gradle
dependencies {
compile 'com.android.support:support-v4:18.0.0'
compile 'com.android.support:appcompat-v7:18.0.0'
}
Now I'm trying to import the Support Library API and extend ActionBarActivity in my code,
however, this is what showed up
which is not what it is supposed to be
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
Any Help?
I have the same problem. I followed this step to solved it, in Android Studio - Tools -> Android -> Sync Project with Gradle Files.
Edit:
Sorry, I forgot add this:
After Sync Project with Gradle Files follow this steps:
Right mouse click for your project and select Open Module Settings
After that, select dependencies tab
In the end - selec your library:
This should work.