The problem I'm currently facing is that as far as I understand, for example, the com.google.bitcoin.core package belongs to is the same as the com.google.bitcoinj.core package but this one is not being accessible or understanding that both are the same package and thus generating the error below (among several similar ones) when building the apk in phase 3/4 of the build. Let me zoom in on the details....
I'm wanting to remove the rust from java and decided to study something different I took the opportunity to look for something challenging and that would make me learn a little about bitcoin as well, I ended up at an "impasse" ...
PS: I imagine some will want to add recommendations like "for mobile development nowadays we use kotlin" or "there is another bitcoin/java project better for that" ... and I thank you in advance for such recommendation (I'll keep my track on this project still it is nice to know alternatives) and I'd be happy if you add it as a comment to the thread (and not as an answer to the question). So in addition to being able to talk, it is possible it will be something useful for other people studying such stack. Thanks again. So ...
I'm trying to compile one old version of schildbach wallet (if I'm not mistaken it was the first version of bitcoin wallet for android. It's an open-source project that seems to be very interesting and I decided to use it for my studies). AFAIK this 3.31 version is wide used to build a few other wallets to manage other coins. Don't ask me exactly why, but it seems to me this is one of the most used versions.
I already managed to build the necessary JAR files, but when the environment builds the APK file (so that I can use it in the android simulator) it ends up not being able to generate the file. my guess is there is something missing on my sistem or it does not exists animore and should be changed on pom file as an workaround. Could someone please help me and point me out what I'm doing wrong?
PS: For knowledge, I've been working with vanilla java for a long time, but I don't have much experience even in Android development. My experience in mobile is mobile qt, golang, webapps and recently what I most used java was with spring.
And in case you are wandering ... yes I set a self signed truststore ssl certificate with keytool by now.
To build the environment (considering that it is a 2014 version) I ended up installing several SDK Tools versions in Android Studio, including those related to version 4 of Android Studio (which was the version used at the time and settled in maven).
I'm also using Java version 8 (from sdkman, the oldest I was able to use was "8.0.265-open" because it had already been installed on another computer, so I managed to bring it to the current machine, that is, I didn't install it it through "sdk install java", I just rsynced from another machine and AFAIK it's basically the same that "sdk install" does). I made some attempts with java 6-zulu, 7-zulu, 16-open, 20-amzn and 22-open, but nothing encouraging, so I decided to go with 8.
As for maven version, I tried with "3.2.2 " and "3.9.1", but the results are the same as the version "3.8.1" I'm currently using.
Here we have a link to the project version I am using right on github https://github.com/schildbach/bitcoin-wallet/tree/112b477201699e8389625add27c6ab8ed1353d22
I made some changes in the wallet directory pom file because it seems to me since it is a very old code maven was not able to download some packages files ...
(in wallet pom file) For the com.google.bitcoinj.* dependencies and for de.schildbach.wallet.integration.android.* I added the scope and the systemPath (I didn't understand why de.schildbach.wallet.integration.android.* generates errors being that the domain is in the same project, only in another module and bitcoinj I downloaded it in the project, compiled it in the appropriate version and added the jar in this project that I'm trying to compile now). I set the , getting like this ....
<dependency>
<groupId>com.google</groupId>
<artifactId>bitcoinj</artifactId>
<version>0.11</version>
<scope>system</scope>
<systemPath>${project.basedir}/../dependencies/bitcoinj-0.11-SNAPSHOT-sources.jar</systemPath>
</dependency>
<dependency>
<groupId>de.schildbach.wallet</groupId>
<artifactId>integration-android</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../integration-android/target/integration-android-1.0.jar</systemPath>
</dependency>
(in wallet pom file) I force maven to use 3.8.1 at plugins and profiles as well ...
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>true</release>
<proguard>
<skip>false</skip>
</proguard>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
/* some other stuff */
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<excludeJarResources>
<excludeJarResource>.*\.jar$</excludeJarResource>
</excludeJarResources>
<sdk>
<platform>14</platform>
</sdk>
<sign>
<debug>both</debug>
</sign>
</configuration>
</plugin>
</plugins>
</build>
And finally (in the wallet project's pom file) I added the maven repository url....
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
As the error dump is very large, I ended up creating a gist to receive the files involved in the issue, it is at https://gist.github.com/rstriquer/7ccf9fe8bc83c1b507a5b6a49b664c07
In the gist I also added a make.sh
script used to build the project (as I have many languages and development environment versions I use it to make a script to remember, in case I come to review the study in a few years... .)
And as I mentioned, the output generated by my environment when using java "8.0.265-open" and maven "3.9.0":