我只是尝试从本地bitcoinj jar切换到从maven central提取的版本,并面临一个奇怪的问题。由此产生的apk设备兼容性标记被破坏。

本节显示了我尝试过的更改:
// compile "com.google:bitcoinj:0.11.1"
// the above looks like a really good idea, but unfortunately the apk resulting from this
// is broken in the way that it is marked as available only for x86_64 - which are 0 devices
// in google play at the moment - something strange gets pulled in there
compile files('libs/bitcoinj-0.8.jar')在调查什么不想要的东西被拉进来之前,我只想问一下,如果有人面对同样的事情。奇怪的是,这似乎是一个jar依赖,我不期望这样的事情会被拉出来-应该没有本机代码。
发布于 2014-04-02 16:09:05
我挖得更深了一点。Bitcoinj拉进了锂氪星。来自bitcoinj pom:
<dependency>
<groupId>com.lambdaworks</groupId>
<artifactId>scrypt</artifactId>
<version>1.3.3</version>
</dependency>而且libscrypt只包含用于x86_64的本机代码:
$> unzip -l scrypt-1.4.0.jar | grep libsc
21708 2013-05-26 12:20 lib/x86_64/darwin/libscrypt.dylib
22140 2013-05-26 12:20 lib/x86_64/freebsd/libscrypt.so
21306 2013-05-26 12:20 lib/x86_64/linux/libscrypt.so这似乎导致了这个问题。
发布于 2014-06-03 14:56:25
请参阅氪github回购中的README:
“运行在ARM上的Android2.3预编译本机库位于src/ Android /resources/lib/arm5/libscrest.so中。如果放在.apk文件的lib/armeabi目录中,它将自动加载。”
在您的项目目录中(在其中找到res ),创建一个libs/armeabi subdir并将libscrypt.so复制到它。重建您的项目和结果的apk将有arm作为一个本机平台。
亚历克斯
https://stackoverflow.com/questions/22730620
复制相似问题