1

I have two projects, A and B. Both projects rely on org.bitcoinj:bitcoinj-core:0.14.7.

A is an older project from 2016, compiles fine and launches a debug-apk to my device or emulator.

B on the other hand, is a new project. B has a library module, LibB which actually contains the reference to bitcoinj. B runs just fine without including libB in the build.gradle. However, if I include libB in the build.gradle for B, Android Studio hangs on the Install APK step for 8-10 minutes before informing me Session 'app': Error Launching activity. Occasionally (inconsistently) I will get INSTALL_FAILED_NO_MATCHING_ABIS, which I know from this question is caused by not having the correct native libraries for the cpu architecture.

Looking at the tasks that gradle runs for each project, I can see that project A performs NDK tasks, :app:compileDebugNdk, :app:mergeDebugJniLibFolders, etc. B, however, does not run these steps. I attempted to include bitcoinj in the root project, rather than through the library, and while those steps now execute, I still get the same result with B. I've even gone so far as starting a new empty project, C, and included bitcoinj in the dependencies, and it also fails to deploy to my device.

I've stepped through my build.gradle files, gradle-wrapper.properties, gradle.properties, settings.gradle, the gradle wrapper and other files not source, in the hopes of finding an inconsistency that would lead to these failed builds, however I haven't discovered any.

I realize this is a rather vague and complicated problem, and will be more than happy to update the question with any clarifications that may be missing.

All that said, what can I do to get my projects to compile?

=====EDIT=====

I have found this issue on the bitcoinj github, but there are several issues with this approach it seems.

  1. The packagingOptions block must be included in B's build.gradle, not libB, which makes for complications when trying to distribute.
  2. I have not included this block in A, and it still works. Very stumped.
Elli White
  • 1,440
  • 1
  • 12
  • 21

0 Answers0