rhirhi90 / bitcoin-wallet

Automatically exported from code.google.com/p/bitcoin-wallet
0 stars 0 forks source link

properly document building process #132

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,
What steps will reproduce the problem?
1. Check out the source code (master branch)
2. Import wallet android project into Android Eclipse dev environmental
3. Add ActiveSherlockBar lib
4. Add qrcode lib
3. Try to build the app

The problem:

import de.schildbach.wallet_test.R

fails.

Regards,
Piotr

Original issue reported on code.google.com by pi...@piotrpolak.com on 4 Feb 2013 at 11:35

GoogleCodeExporter commented 9 years ago
Please be aware that I don't use Eclipse any more for building the APK. It just 
makes too much trouble.

Instead, use Maven.

mvn clean package

If you want to get it compile in Eclipse, did you try

mvn eclipse:eclipse

already?

Anyway, you need to clone and compile bitcoinj first.

Original comment by andreas....@gmail.com on 4 Feb 2013 at 1:43

GoogleCodeExporter commented 9 years ago
Thanks for your comment. Switched to maven.
Getting the following build error:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] [jar:jar {execution: default-jar}]
[INFO] Building jar: 
/home/piotr/Bitcoin/bitcoin-wallet/integration-android/target/integration-androi
d-1.0.jar
[INFO] Preparing source:jar
[WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation.
[INFO] No goals needed for project - skipping
[INFO] [source:jar {execution: default}]
[INFO] Building jar: 
/home/piotr/Bitcoin/bitcoin-wallet/integration-android/target/integration-androi
d-1.0-sources.jar
[INFO] ------------------------------------------------------------------------
[INFO] Building Bitcoin Wallet
[INFO]    task-segment: [clean, package]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal 
'com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.4.1:generat
e-sources': Unable to find the mojo 'generate-sources' (or one of its required 
components) in the plugin 
'com.jayway.maven.plugins.android.generation2:android-maven-plugin'
Component descriptor cannot be found in the component repository: 
org.sonatype.aether.RepositorySystem.

Original comment by pi...@piotrpolak.com on 5 Feb 2013 at 3:07

GoogleCodeExporter commented 9 years ago
What version of Maven are you using? For the android-maven-plugin, you need at 
least version 3.0.3 I think.

Original comment by andreas....@gmail.com on 5 Feb 2013 at 3:40

GoogleCodeExporter commented 9 years ago
Switched to version 3, getting following error:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] base .............................................. SUCCESS [0.331s]
[INFO] Bitcoin Integration for Android ................... SUCCESS [7.738s]
[INFO] Bitcoin Wallet .................................... FAILURE [2.249s]
[INFO] Sample for Bitcoin Integration for Android ........ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.419s
[INFO] Finished at: Tue Feb 05 17:38:23 CET 2013
[INFO] Final Memory: 14M/34M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.4.1:generate
-sources (default-generate-sources) on project wallet_test: No Android SDK path 
could be found. You may configure it in the plugin configuration section in the 
pom file using <sdk><path>...</path></sdk> or 
<properties><android.sdk.path>...</android.sdk.path></properties> or on 
command-line using -Dandroid.sdk.path=... or by setting environment variable 
ANDROID_HOME -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :wallet_test

Original comment by pi...@piotrpolak.com on 5 Feb 2013 at 4:50

GoogleCodeExporter commented 9 years ago
Almost there but still:

[INFO] 29 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] base .............................................. SUCCESS [0.367s]
[INFO] Bitcoin Integration for Android ................... SUCCESS [7.678s]
[INFO] Bitcoin Wallet .................................... FAILURE [13.421s]
[INFO] Sample for Bitcoin Integration for Android ........ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.905s
[INFO] Finished at: Tue Feb 05 18:08:25 CET 2013
[INFO] Final Memory: 16M/69M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on 
project wallet_test: Compilation failure: Compilation failure:
[ERROR] 
/home/piotr/Bitcoin/bitcoin-wallet/wallet/src/de/schildbach/wallet/util/Encrypti
onUtils.java:[28,31] package org.spongycastle.crypto does not exist
[ERROR] 
/home/piotr/Bitcoin/bitcoin-wallet/wallet/src/de/schildbach/wallet/util/Encrypti
onUtils.java:[29,31] package org.spongycastle.crypto does not exist
[ERROR] 
/home/piotr/Bitcoin/bitcoin-wallet/wallet/src/de/schildbach/wallet/util/Encrypti
onUtils.java:[30,31] package org.spongycastle.crypto does not exist
[ERROR] 
/home/piotr/Bitcoin/bitcoin-wallet/wallet/src/de/schildbach/wallet/util/Encrypti
onUtils.java:[31,31] package org.spongycastle.crypto does not exist
[ERROR] 
/home/piotr/Bitcoin/bitcoin-wallet/wallet/src/de/schildbach/wallet/util/Encrypti
onUtils.java:[32,39] package org.spongycastle.crypto.engines does not exist
[ERROR] 
/home/piotr/Bitcoin/bitcoin-wallet/wallet/src/de/schildbach/wallet/util/Encrypti
onUtils.java:[33,42] package org.spongycastle.crypto.generators does not exist
[ERROR] 
/home/piotr/Bitcoin/bitcoin-wallet/wallet/src/de/schildbach/wallet/util/Encrypti
onUtils.java:[34,37] package org.spongycastle.crypto.modes does not exist
[ERROR] 
/home/piotr/Bitcoin/bitcoin-wallet/wallet/src/de/schildbach/wallet/util/Encrypti
onUtils.java:[35,40] package org.spongycastle.crypto.paddings does not exist
[ERROR] 
/home/piotr/Bitcoin/bitcoin-wallet/wallet/src/de/schildbach/wallet/util/Encrypti
onUtils.java:[36,38] package org.spongycastle.crypto.params does not exist

Original comment by pi...@piotrpolak.com on 5 Feb 2013 at 5:10

GoogleCodeExporter commented 9 years ago
Can you try a "mvn dependency:tree" inside the wallet subproject and see if it 
contains a line

com.madgag:sc-light-jdk15on:jar:1.47.0.2:compile

Did you already compile and install bitcoinj? You need to use the patched-0.6 
branch of my bitcoinj repo.

Original comment by andreas....@gmail.com on 5 Feb 2013 at 5:53

GoogleCodeExporter commented 9 years ago
Does not contain the line, please see below.

I have installed regular bitcoinj lib. Where can I find your bitcoinj repo?

Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Bitcoin Wallet 2.39
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ wallet_test ---
[INFO] de.schildbach.wallet:wallet_test:apk:2.39
[INFO] +- com.google.android:android:jar:4.0.1.2:provided
[INFO] |  +- commons-logging:commons-logging:jar:1.1.1:provided
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.0.1:provided
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.0.1:provided
[INFO] |  |  \- commons-codec:commons-codec:jar:1.3:provided
[INFO] |  +- org.khronos:opengl-api:jar:gl1.1-android-2.1_r1:provided
[INFO] |  +- xerces:xmlParserAPIs:jar:2.6.2:provided
[INFO] |  +- xpp3:xpp3:jar:1.1.4c:provided
[INFO] |  \- org.json:json:jar:20080701:provided
[INFO] +- com.google.android:annotations:jar:4.1.1.4:provided
[INFO] +- com.google.android:support-v4:jar:r7:compile
[INFO] +- com.actionbarsherlock:library:apklib:4.1.0:compile
[INFO] +- de.schildbach.wallet:bitcoinj:jar:0.6.1:compile
[INFO] +- de.schildbach.wallet:integration-android:jar:1.0:compile
[INFO] +- com.google.zxing:core:jar:2.1:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.2:compile
[INFO] \- org.slf4j:slf4j-simple:jar:1.6.2:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.149s
[INFO] Finished at: Tue Feb 05 21:38:13 CET 2013
[INFO] Final Memory: 9M/22M
[INFO] ------------------------------------------------------------------------

Original comment by pi...@piotrpolak.com on 5 Feb 2013 at 8:44

GoogleCodeExporter commented 9 years ago
I'm sorry this is not better documented. You need to checkout my repo from

http://code.google.com/r/andreasschildbach-bitcoinj/source/checkout

switch to the patched-0.6 branch and "mvn clean install".

After that, bitcoin-wallet should contain the line in "mvn dependency:tree" and 
hopefully will compile. Let me know if it works.

Original comment by andreas....@gmail.com on 5 Feb 2013 at 9:04

GoogleCodeExporter commented 9 years ago
No worry, I'm making progress, thanks for your help and time.

bitcoinj patched-0.6 and bitcoin-wallet compiled

See this error now for sample integration for android:

Is this because I have only installed android sdk and not complete android 
eclipse environment?

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] base .............................................. SUCCESS [0.383s]
[INFO] Bitcoin Integration for Android ................... SUCCESS [7.648s]
[INFO] Bitcoin Wallet .................................... SUCCESS [1:42.733s]
[INFO] Sample for Bitcoin Integration for Android ........ FAILURE [0.188s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:54.974s
[INFO] Finished at: Tue Feb 05 22:39:21 CET 2013
[INFO] Final Memory: 21M/96M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal 
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.4.1:generate
-sources (default-generate-sources) on project sample-integration-android: 
Execution default-generate-sources of goal 
com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.4.1:generate
-sources failed: Invalid SDK: Platform/API level 10 not available. This command 
should give you all you need:
[ERROR] /home/piotr/android-sdk-linux/tools/android update sdk --no-ui 
--obsolete --force
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please 
read the following articles:
[ERROR] [Help 1] 
http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :sample-integration-android

Original comment by pi...@piotrpolak.com on 5 Feb 2013 at 9:45

GoogleCodeExporter commented 9 years ago
I took the opportunity and started writing a BUILDING section in the README. It 
will be for the upcoming version of Bitcoin Wallet though, so some steps will 
be different to what you had to do. However, in order to install the Android 
SDK, you should be able to use the following:

Get the Android SDK Tools from

  http://developer.android.com/sdk/

and unpack it to your workspace directory. Switch to that Android SDK 
directory, and use

  tools/android update sdk --no-ui --force --filter platform

to download the necessary API level.

Later, when you build Bitcoin Wallet, you need to append the path to your SDK 
as follows:

  mvn clean package -Dandroid.sdk.path=<path to your android sdk>

Does this work for you?

Original comment by andreas....@gmail.com on 5 Feb 2013 at 10:10

GoogleCodeExporter commented 9 years ago

Original comment by andreas....@gmail.com on 5 Feb 2013 at 10:10

GoogleCodeExporter commented 9 years ago
Correction, you need to use

tools/android update sdk --no-ui --force --filter platform,platform-tools

Original comment by andreas....@gmail.com on 5 Feb 2013 at 10:27

GoogleCodeExporter commented 9 years ago
Installed API level 10 and the project now builds without errors.
Yes, the BUILDING description describing the process would be very helpful.

Again, thanks for your help!

Any plans in supporting electrum server protocol? This would reduce the time 
necessary now to download complete block chain.

Original comment by pi...@piotrpolak.com on 6 Feb 2013 at 9:21

GoogleCodeExporter commented 9 years ago
We don't plan to use Electrum, because that would introduce a dependency to a 
central component.

Instead, we will be using Bloom Filters to significantly reduce setup time and 
network traffic. If you want, you can play around with this and help testing. 
You'd need:

- a bitcoin-qt/bitcoind compiled from master (should be tagged 0.8.0-rc1 any 
day now)
- bitcoinj from master (will be bitcoin 0.7 soon)
- bitcoin-wallet from branch 'bitcoinj-0.7' (will be merged to master soon)

Precompiled preview APKs are available at

http://code.google.com/p/bitcoin-wallet/downloads/list

Let me know if you're interested.

Original comment by andreas....@gmail.com on 6 Feb 2013 at 9:34

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Yes, I'm interested.

Was planning to add Electrum support but at the same time I'm aware about 
dependency problem. So if Bloom Filters implementation is in the works I'm 
interested to help.

Will set up the dev environment. Please keep me posted.

Original comment by pi...@piotrpolak.com on 6 Feb 2013 at 12:43

GoogleCodeExporter commented 9 years ago
I've added a building section to the bitcoinj-0.7 branch. You can read it here:

http://code.google.com/p/bitcoin-wallet/source/browse/wallet/README?name=bitcoin
j-0.7

Be aware that the section reflects how things will work after bitcoinj 0.7 and 
Bitcoin Wallet 2.40 are released, so for now stick to the branches I named in 
commit #14.

If you need a bitcoin-qt capable of bloom filters and don't want to compile 
your own, you can use Mike's plan99.net for now.

Can we take further discussion to the Bitcointalk forum?

https://bitcointalk.org/index.php?board=100.0

Original comment by andreas....@gmail.com on 6 Feb 2013 at 1:28

GoogleCodeExporter commented 9 years ago
The README containing the new build instructions is now located here:

http://code.google.com/p/bitcoin-wallet/source/browse/wallet/README

Let me know if you discover errors or problems.

Original comment by andreas....@gmail.com on 24 Feb 2013 at 11:45

GoogleCodeExporter commented 9 years ago

Original comment by andreas....@gmail.com on 3 Mar 2013 at 3:08

GoogleCodeExporter commented 9 years ago
The above conversation is very helpful! thanks!

Original comment by roylee0...@gmail.com on 29 Mar 2013 at 6:09

GoogleCodeExporter commented 9 years ago
I tried to build the project but I keep getting the error above. I tried 
everything mentioned in the thread and not sure how to proceed.

Original comment by trimp...@gmail.com on 17 Apr 2013 at 12:19