TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The Perils of Loading Native Libraries on Android

74 点作者 philippb超过 9 年前

8 条评论

rsp1984超过 9 年前
There is absolutely a ton of stuff broken with Android, no doubt about it, and I don&#x27;t want to sound schoolmasterly but in this case it looks like a RTFM. From the Android NDK docs [1]:<p><i>You must specify an ABI for each CPU architecture you want your app to work with ... To build machine code for two or more distinct ABIs, using spaces as delimiters. For example:</i><p><pre><code> APP_ABI := armeabi armeabi-v7a </code></pre> <i>This setting tells the NDK to build two versions of your machine code: one for each ABI listed on this line.</i><p>Whereas the post says:<p><i>To reduce our APK size and ensure that our App would run on all possible devices, we have flavors of our App for the x86, Armv7 and Arm architectures. Each flavor only contains the native libraries corresponding to its respective architecture</i><p>There we have it.<p>[1] <a href="http:&#x2F;&#x2F;developer.android.com&#x2F;ndk&#x2F;guides&#x2F;abis.html" rel="nofollow">http:&#x2F;&#x2F;developer.android.com&#x2F;ndk&#x2F;guides&#x2F;abis.html</a>
评论 #10529199 未加载
评论 #10531359 未加载
评论 #10529119 未加载
ianlevesque超过 9 年前
There are two Androids: the quirky but generally usable Android described in Google&#x27;s documentation and occasionally found on Nexus devices, and then the Android actually found in the wild after manufacturers, carriers, 3rd party app stores, users and general neglect have their way with it.
评论 #10527280 未加载
js2超过 9 年前
We&#x27;ve seem the same problem at Yahoo:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;yahoo&#x2F;ygloo-ymagine&#x2F;blob&#x2F;master&#x2F;src&#x2F;com&#x2F;yahoo&#x2F;mobile&#x2F;client&#x2F;android&#x2F;ymagine&#x2F;LibraryLoader.java" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;yahoo&#x2F;ygloo-ymagine&#x2F;blob&#x2F;master&#x2F;src&#x2F;com&#x2F;y...</a><p>Here&#x27;s another fun Android &#x2F; PackageManager behavior - Android doesn&#x27;t kill an app before upgrading it (unlike on iOS). You may think this is a feature, except that after the upgrade the PackageManager is now out-of-sync with the running code. So for example, say v1 of the code is still running after an upgrade to v2, and the code calls getPackageInfo() in order to find out say, its versionCode. The running code will erroneously think it&#x27;s v2.
评论 #10528903 未加载
breatheoften超过 9 年前
Is the problem discussed in this article something that has to be worried about still? This is hideous ... By my understanding the only way the solution discussed in the article can work is by including the native libraries for every architecture inside the apk which seems like it will make the app larger than it needs to be ...<p>I think I&#x27;d rather just detect the issue and throw up an error telling the user that they&#x27;ve managed to install an apk built for the wrong architecture and need to install a different apk ...
评论 #10526795 未加载
评论 #10526856 未加载
评论 #10526772 未加载
ignoramous超过 9 年前
Fire OS fixed this bug in the Package Manager. Amazon treats both, the buyers and the developers, as its customers. Has a nice process in place to test top 10k+ apps on each upgrade and identify and try and fix issues arising due to AOSP.<p>Google needs to start doing the same thing or something similar. I have seen a fair share of broken stuff. Something even as basic as a ListView was horrendously let loose in a middle of a refactor between JB and L.
jheriko超过 9 年前
surely the perils of users using shoddy app stores and installers rather than developers using native libraries.<p>kudos to the devs for making the effort to workaround the issues though, its quite a heroic effort imo.
评论 #10527387 未加载
评论 #10531372 未加载
voltagex_超过 9 年前
I wonder if there&#x27;s an Android bug report for the first part. And I wonder if Google cares.
modeless超过 9 年前
&gt; users may have installed our app from other sources than the Play Store<p>Is this a euphemism for piracy? Where are these users getting the app?
评论 #10526880 未加载
评论 #10527441 未加载
评论 #10527311 未加载
评论 #10527312 未加载