-1

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.

himanshu
  • 21
  • 4
  • which one has errors? the maven project or the android not maven project? – eduyayo Nov 01 '14 at 16:14
  • this erros : 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 The import org.spongycastle cannot be resolved – himanshu Nov 03 '14 at 05:35
  • add the dependencies of the external project to your android project. Also, maybe, the compiled artifact of the external project. – eduyayo Nov 03 '14 at 08:20
  • thanx for your valuable comment, but i still have so much confusion to do. Can you please tell me the quick steps ? – himanshu Nov 03 '14 at 09:27

1 Answers1

0

You need to get each of those libraries and add them to your project:

  1. Put the JAR file in the /libs folder in the root of your project (create the libs folder if it doesn't exist)

  2. If necessary, right-click the JAR file and select Build PathAdd to Build Path

  3. If necessary, clean the project (ProjectClean)

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:

Community
  • 1
  • 1
bmaupin
  • 14,427
  • 5
  • 89
  • 94
  • Thank you very much for your comment, i have downloaded some jars and put it to libs folder but still some of imports still missing like : The import org.bitcoinj cannot be resolved, The import com.google.zxing.PlanarYUVLuminanceSource cannot be resolved, The import com.google.common cannot be resolved, – himanshu Nov 11 '14 at 10:48
  • Have you found JAR files for the missing imports? For example, when I google org.bitcoinj, one of the top results is https://github.com/bitcoinj/bitcoinj. Clicking on [releases](https://github.com/bitcoinj/bitcoinj/releases) brings me to a page where you can download a JAR file. I've updated my instructions for projects that don't provide JAR files in case that's necessary as well. – bmaupin Nov 11 '14 at 15:37
  • Yes, I have founded so many jars and i have add it to my build path too, but still some of the imports been missing. I am trying to find new jars according to imports and trying to build the apk. For example when i have download jar of bitcoinj from this link https://github.com/bitcoinj/bitcoinj/releases, i download the latest jar and i add to build path but still bitcoinj import errors arises like : import org.bitcoinj.core, import org.bitcoinj.utils – himanshu Nov 12 '14 at 05:51
  • Odd. If you look at the contents of the JAR file (`jar tf bitcoinj-0.11-bundled.jar | less`) it looks like it contains com.google.bitcoin.core and com.google.bitcoin.utils instead. [org.bitcoinj.core is definitely there in the source](https://github.com/bitcoinj/bitcoinj/tree/master/core/src/test/java/org/bitcoinj/core). Since the JAR file is over 9 months old, it might be better to check out the source, add it as a new project, and add it as a library to your project. The instructions for doing that are linked in my answer. – bmaupin Nov 12 '14 at 13:34