I have imported and added the facebook sdk for my android project. But in my project under gen folder, then under com.facebook.android folder I get only R.java file. Please help me to get this solved.
You have to import it into your workspace and configure it as a library ( Properties/Android/Library Is Library checked)
then import it into your project under Properties/Android/Library Add the facebook project
Check that the facebook project is in your build path Properties/ Java Build Path/ Projects
And then you should see it under Android Dependencies
You can do it the other way round, instead of importing the facebook library just copy the entire package com.facebook.android into your project.... Thats it.... no need to import any thing.....
Related
I am working on a currency wallet app. I have downloaded code from here.
I have imported this code in my eclipse, also i have inserted some libs(.jar files). I have downloaded maven code for java from here.
Now in android project in eclipse there are some compile time errors found like.
The import com.google.bitcoin.params cannot be resolved
and so on.
So please can anybody help me to build bitcoin project without error ?
Where to found following packges and How to import following packages ?
**The import javax.annotation cannot be resolved
The import org.slf4j cannot be resolved
The import com.google cannot be resolved
The import de.schildbach.wallet_test.R cannot be resolved
The import org.bitcoinj cannot be resolved
The import ch cannot be resolved`enter code here`
The import org.spongycastle cannot be resolved**
Thank you in advance.
You need to get each of those libraries and add them to your project:
Put the JAR file in the /libs folder in the root of your project (create the libs folder if it doesn't exist)
If necessary, right-click the JAR file and select Build Path → Add to Build Path
If necessary, clean the project (Project → Clean)
For javax.annotation, for example, you would use this libarary:
http://mvnrepository.com/artifact/com.google.code.findbugs/jsr305
Just click the latest version number and then click Download.
If you have a dependency that you can't find a JAR file for, you can download the source and add that project as a library dependency for your project: https://stackoverflow.com/a/8281477/399105
More resources:
Adding libraries without resources
Adding a library/JAR to an Eclipse Android project
Android: The import javax.annotation cannot be resolved
I was trying to follow this post to import the mopub SDK into my app, however Android Studio is being difficult.
I unzipped the SDK, and went to Project Structure to select import a New Module. When I chose the unzipped folder, the Finish button is grayed out, and there is an error saying 'Select Modules to import'
I am using Android Studio version 0.8.6. Here is a screenshot of the error menu
I had the same issue so I had to install it manually.
First, unzip the downloaded file and then copy the unzipped mopub-sdk folder into your project directory.
Next, open your project's settings.gradle file and make sure the MoPub SDK is included as a module:
include ':app', ':mopub-sdk'
Open your app's build.gradle file (not your main project one) and add the MoPub SDK as a dependency:
dependencies {
compile project(':mopub-sdk')
}
These instructions are based of those found on the mopub github.
In eclipse, if we create a project which is having library projects inside our project, then
we cannot import this project as module in Android studio. This may be the issue
It's not fault of AndroidStudio, just try archived sdk, it works
https://github.com/mopub/mopub-android-sdk/archive/v3.9.0.zip
from https://github.com/mopub/mopub-android-sdk/releases
// sorry I don't enough reputation to post image
I have downloaded twitter4j-4.0.1.zip from the twitter4j page and from github in eclipse I unzip then file>import>Existing Android Code Into Workspace>next>browse file location, and eclipse does not find any projects. This says to copy the jar file into the lib folder, but am I supposed to import as a library first? Not sure what I am doing wrong.
This was correct. Right click your project>Properties>Java Build Path>Add External JARS>twitter4j-core
I used GCM already, I had libs folder and have the android-support-v4.jar in it and everything was just fine.
Now i'd like to use facebook sdk.
I'm doing the facebook's tutorial, but when it says that i have to right click on project -> Android tab -> Add... and select FacebookSDk then ok.
So after this step,
The
import android.support.v4.content.WakefulBroadcastReceiver;
import com.google.android.gms.gcm.GoogleCloudMessaging;
import android.support.v4.app.NotificationCompat;
cannot be resolved!
I Googled a lot, I cleaned the solution, I replaced the android-support-v4.jar with the facebook's android-support-v4.jar, I refreshed the libraries (right click on project->Android tools->Add support library...), I removed the library from the libs folder
And now i'm out of ideas.
Anyone solved this problem?
What am I doing wrong?
For com.google.android.gms.gcm.GoogleCloudMessaging you have to add google-play-services_lib as a library project (it has nothing to do with the support library).
For the support library imports, you have to copy the android-support-v4.jar to the libs folder of your project and add it to the java build path of your project.
Facebook SDK comes with certain version of android-support-v4.jar which may or may not be the same version as your project and/or other libraries you are using. make sure that they are all the same version (literally picking a version of this jar and copying it to your project's lib, Facebook SDK's libs, etc). In eclipse, if you look at the "Problems" tab, it should tell you what is wrong.
I have a root directory with a number of android eclipse projects inside. They all have .project files, but eclipse does not seem to see them as eclipse projects? Does anyone know the reason why?
Cause for not importing projects in eclipse :
Reason 1 : Project Structure Differs
Reason 2 : Project Configuration files missing or not available
Reason 3 : Project can be already exists in workspace
Reason 4 : Don't have Proper and Standard Naming Convention
Follow these steps.
Hope you have android sdk and ADT plugin for eclipse.
File-->Import-->Android-->Existing Android code into workspace.
Then import the projects from your root directory using Browse button. If you don't have ADT plugin definitely you never import your android projects.
You have to import them manually
First File > Import
Then General > Existing Project Into Workspace
Either select root directory or Select archive file, click Browse to locate the directory or file containing the project that you want to import
Under Projects select the project that you want to import
Finally click finish to import the project
Here is a link to the eclipse help section on this
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-importproject.htm