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
Related
I have an android gradle project which I compile from the command line. I am using eclipse + eclim to have autocompletion and source code validation. I was an unable to get code completion to work by importing the project as an gradle project into eclipse. I therefore imported /path/to/gradle/project/app/src/main as an android project into eclipse and after some .classpath tweaking I was able to get autocompletion to work.
Now I wanted to import the following android support libraries:
import android.support.annotation.NonNull;
import android.support.v13.app.FragmentCompat;
import android.support.v4.app.ActivityCompat;
but got The import ... cannot be resolved error for all three lines. I then tried Android Tools -> Add Android Support Library which failed miserably. I then tracked down the libraries in question in the Android-SDK and added them manually to the Java Build Path in Eclipse. For some I needed to extract the JAR files from the AAR files as described in this answer. I added the following libraries:
appcompat-v7-26.0.0-alpha1.jar
support-annotations-26.0.0-alpha1.jar
support-v4-26.0.0-alpha1.jar
support-v13-26.0.0-alpha1.jar
This solved the problem for the the first two imports but I still get the error for import android.support.v4.app.ActivityCompat;. I have code completion up to v4 but app is not found.
How can I resolve this issue? Am I still missing some dependency? Is there a better way to get android code completion with eclim?
So i figured it out myself. There was still a dependency missing. In my case I also needed
support-compat-26.0.0-alpha1.jar
I wrote this script to extract all the jar class files that are somewhere hidden in the android-sdk/folder. It recursivly looks at all subdirectories of the specified Android SDK folder until it either finds a JAR file which is not Javadoc or Source and copies it to a destination directory. If an AAR file is found the content is extracted to a folder of the same name as described in the link of the question and the JAR file in that folder copied with an appropriate name to the given destination directory.
Downloaded Box2d from here but after going
Project Structure > New Module > Import existing library
When asking for path i put the box2d path and still get the warning that doesnt let me continue
Select modules to import
What is the problem?
Don't add PhysicsBox2D as Module, Download the JAR From this link :-http://www.java2s.com/Code/Jar/o/Downloadorgandengineextensionphysicsbox2djar.htm
and copy jar and paste in project library folder.
And then go to File->Project Structure-> app->dependencies-> + ->File Dependency -> lib ->add that jar file.
And if want to check that box2D is added or not try to import that:-
import org.andengine.extension.physics.box2d
in MainActivity.java. If importing Box2D is set in Project.
I am trying to use GoogleMap V2 .But i am getting error on import these :
import android.support.v7.app.MediaRouteActionProvider;
import android.support.v7.media.MediaRouteSelector;
import android.support.v7.media.MediaRouter;
import android.support.v7.media.MediaRouter.RouteInfo;
And the error is
The import android.support.v7.app.MediaRouteActionProvider cannot be resolved
Here is the screen shot of the library that i have added
What i have to do .I have tried to import android\support\v7 By Build path .But it is not resolving my issue in there any way so that i can resolve these errors.
It looks like you have added gridlayout.jar to the projects lib folder.
Its a library project with resources. You need to reference the library project in your android projet
This library is located in the <sdk>/extras/android/support/v7/gridlayout/ directory after you download the Android Support Libraries.
Follow Adding libraries with resources
http://developer.android.com/tools/support-library/setup.html#libs-with-res
had the same problem and found that the link in my project to the appcomcat_v7 project is broken (right-click project and choose properties, then head to the Android tab)...
i removed and then added the correct project and i was good to go...
These type of Errors generally occurs when we accidentally close these libraries(by close unrelated projects,etc) which are automatically generated In Project Explorer of Eclipse like:
appcompat_v7
appcompat_v7_2
appcompat_v7_3
appcompat_v7_4
appcompat_v7_5
appcompat_v7_6
appcompat_v7_7
appcompat_v7_8
appcompat_v7_9
appcompat_v7_10
appcompat_v7_11
appcompat_v7_12
appcompat_v7_13
appcompat_v7_14
As soon as I open these files,all the errors in my app were vanished !
If It till then didn't work then do Project -> Properties -> Android -> Is Library -> Add.. -> And add appcompat_v7_*
I had a very similar problem to this after I had used force to close Eclipse.
When I then restarted Eclipse, I noticed a number of "appcompat_v7..." folders in my workspace directory. I deleted these - and maybe that was the cause of this problem.
But I resolved it by creating a new Test project in Eclipse, then restarting Eclipse to find all my projects compiled again! :)
I didn't need to change any project properties.
this solution worked for me:
The support library android-support-v4.jar cause this conflictand you see the error: The import android.support.v7.app.MediaRouteActionProvider cannot be resolved, just delete the library under /libs folder of your project, because the library is already contained in the library appcompat_v7, clean and build your project, and your project will work like a charm!
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
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.....