{"id":1370,"date":"2023-03-19T10:28:35","date_gmt":"2023-03-19T02:28:35","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1370"},"modified":"2023-04-28T21:16:08","modified_gmt":"2023-04-28T13:16:08","slug":"compiling-android-on-linux-platform-with-error-aapt2-lib64-libc-so-6-version-glibc-2-14-not-found","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/19\/compiling-android-on-linux-platform-with-error-aapt2-lib64-libc-so-6-version-glibc-2-14-not-found\/","title":{"rendered":"Linux\u5e73\u53f0\u7f16\u8bd1Android\u62a5\u9519aapt2 \/lib64\/libc.so.6 version &#8216;GLIBC_2.14&#8217; not found"},"content":{"rendered":"<h2>\u95ee\u9898\u63cf\u8ff0<\/h2>\n<p>\u6700\u8fd1\u5728\u642d\u5efa\u57fa\u4e8eJenkins\u7684Android apk\u6301\u7eed\u96c6\u6210\u7f16\u8bd1\u73af\u5883\uff0c\u90e8\u7f72\u81f3Centos 6.9\u670d\u52a1\u5668\u4e0a\u65f6\uff0c\u4f7f\u7528Gradle\u6307\u4ee4\u6267\u884c\u6253\u5305APK\u62a5\u9519\uff1a<\/p>\n<pre><code>aapt2: \/lib64\/libc.so.6: version &#039;GLIBC_2.14&#039; not found (required by aapt2)<\/code><\/pre>\n<p><!-- more --><\/p>\n<p>\u4ece\u9519\u8bef\u4fe1\u606f\u53ef\u4ee5\u770b\u51fa\uff0c\u7a0b\u5e8f\u6ca1\u6709\u627e\u5230<code>GLIBC_2.14<\/code>\u8fd9\u4e2a\u7248\u672c\u5e93\uff0c\u800cCentos 6.9\u9ed8\u8ba4\u7684glibc\u7248\u672c\u6700\u9ad8\u4e3a2.12\uff0c\u6240\u4ee5\u9700\u8981\u66f4\u65b0\u7cfb\u7edfglibc\u5e93\u3002<\/p>\n<p>glibc\u662fgnu\u53d1\u5e03\u7684libc\u5e93\uff0c\u5373c\u8fd0\u884c\u5e93\uff0cglibc\u662flinux\u7cfb\u7edf\u4e2d\u6700\u5e95\u5c42\u7684api\uff0c\u51e0\u4e4e\u5176\u5b83\u4efb\u4f55\u8fd0\u884c\u5e93\u90fd\u4f1a\u4f9d\u8d56\u4e8eglibc\u3002glibc\u9664\u4e86\u5c01\u88c5Linux\u64cd\u4f5c\u7cfb\u7edf\u6240\u63d0\u4f9b\u7684\u7cfb\u7edf\u670d\u52a1\u5916\uff0c\u5b83\u672c\u8eab\u4e5f\u63d0\u4f9b\u4e86\u8bb8\u591a\u5176\u5b83\u4e00\u4e9b\u5fc5\u8981\u529f\u80fd\u670d\u52a1\u7684\u5b9e\u73b0\u3002<\/p>\n<p>\u5f88\u591aLinux\u7684\u57fa\u672c\u547d\u4ee4\uff0c\u6bd4\u5982cp\u3001rm\u3001ll\u3001ln\u7b49\uff0c\u90fd\u5f97\u4f9d\u8d56\u4e8eglibc\uff0c\u5982\u679c\u64cd\u4f5c\u9519\u8bef\u6216\u8005\u5347\u7ea7\u5931\u8d25\u4f1a\u5bfc\u81f4\u7cfb\u7edf\u547d\u4ee4\u4e0d\u80fd\u4f7f\u7528\uff0c\u4e25\u91cd\u7684\u9020\u6210\u7cfb\u7edf\u9000\u51fa\u540e\u65e0\u6cd5\u91cd\u65b0\u8fdb\u5165\uff0c\u6240\u4ee5\u64cd\u4f5c\u65f6\u5019\u9700\u8981\u614e\u91cd\u3002<\/p>\n<h2>\u89e3\u51b3\u65b9\u6cd5<\/h2>\n<h3>\u67e5\u770b\u7cfb\u7edf\u7248\u672c\u548cglibc\u5e93\u7248\u672c<\/h3>\n<pre><code># cat \/etc\/redhat-release \nCentOS release 6.9 (Final)\n\n# strings \/lib64\/libc.so.6 |grep GLIBC_ \nGLIBC_2.2.5\nGLIBC_2.2.6\nGLIBC_2.3\nGLIBC_2.3.2\nGLIBC_2.3.3\nGLIBC_2.3.4\nGLIBC_2.4\nGLIBC_2.5\nGLIBC_2.6\nGLIBC_2.7\nGLIBC_2.8\nGLIBC_2.9\nGLIBC_2.10\nGLIBC_2.11\nGLIBC_2.12\nGLIBC_PRIVATE<\/code><\/pre>\n<p>\u7531\u4e0a\u9762\u7684\u4fe1\u606f\u53ef\u4ee5\u770b\u51fa\u7cfb\u7edf\u662fCentOS 6.9\uff0c\u6700\u9ad8\u652f\u6301glibc\u7684\u7248\u672c\u4e3a2.12\uff0c\u800cAndroid\u8d44\u6e90\u6587\u4ef6\u7f16\u8bd1\u5de5\u5177aapt2\u9700\u89812.14\u7248\u672c\uff0c\u6240\u4ee5\u9700\u8981\u5347\u7ea7\u3002<\/p>\n<h3>\u4e0b\u8f7dglibc\u5e76\u7f16\u8bd1\u5347\u7ea7<\/h3>\n<p>\u5b98\u65b9\u4e0b\u8f7d\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/ftp.gnu.org\/gnu\/glibc\/\">https:\/\/ftp.gnu.org\/gnu\/glibc\/<\/a><\/p>\n<p>\u4e3a\u8c28\u614e\u8d77\u89c1\uff0c\u672c\u6587\u4e0b\u8f7d\u7f16\u8bd1glibc-2.14\uff0c\u800c\u975e\u6700\u65b0\u7248glibc-2.28<\/p>\n<pre><code>wget http:\/\/ftp.gnu.org\/gnu\/glibc\/glibc-2.14.tar.gz \nwget http:\/\/ftp.gnu.org\/gnu\/glibc\/glibc-ports-2.14.tar.gz \ntar -xvf  glibc-2.14.tar.gz \ntar -xvf  glibc-ports-2.14.tar.gz\nmv glibc-ports-2.14 glibc-2.14\/ports\nmkdir glibc-2.14\/build\ncd glibc-2.14\/build \n..\/configure  --prefix=\/usr --disable-profile --enable-add-ons --with-headers=\/usr\/include --with-binutils=\/usr\/bin\nmake\nmake install<\/code><\/pre>\n<p>\u4ee5\u4e0a\u5b8c\u6210\u4e0d\u62a5\u9519\u7684\u8bdd\uff0c\u67e5\u770b\u5e93\u6587\u4ef6\uff0c\u53d1\u73b0<code>\/lib64\/libc.so.6<\/code>\u8f6f\u94fe\u63a5\u5df2\u7ecf\u6307\u54112.14\u7248\u672c<\/p>\n<pre><code># ll \/lib64\/libc.so.6 \n\/lib64\/libc.so.6 -&gt; \/lib64\/libc-2.14.so<\/code><\/pre>\n<h3>\u518d\u6b21\u67e5\u770bglibc\u652f\u6301\u7684\u7248\u672c<\/h3>\n<pre><code># strings \/lib64\/libc.so.6 |grep GLIBC_\nGLIBC_2.2.5\nGLIBC_2.2.6\nGLIBC_2.3\nGLIBC_2.3.2\nGLIBC_2.3.3\nGLIBC_2.3.4\nGLIBC_2.4\nGLIBC_2.5\nGLIBC_2.6\nGLIBC_2.7\nGLIBC_2.8\nGLIBC_2.9\nGLIBC_2.10\nGLIBC_2.11\nGLIBC_2.12\nGLIBC_2.13\nGLIBC_2.14\nGLIBC_PRIVATE<\/code><\/pre>\n<p>\u53ef\u4ee5\u770b\u5230glibc\u652f\u6301\u7684\u7248\u672c\u5df2\u7ecf\u52302.14\uff0c\u518d\u6b21\u6267\u884cGradle\u7f16\u8bd1\u6307\u4ee4\u5373\u4e0d\u4f1a\u62a5\u9519\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\u63cf\u8ff0 \u6700\u8fd1\u5728\u642d\u5efa\u57fa\u4e8eJenkins\u7684Android apk\u6301\u7eed\u96c6\u6210\u7f16\u8bd1\u73af\u5883\uff0c\u90e8\u7f72\u81f3Centos 6.9\u670d\u52a1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[202],"tags":[339],"class_list":["post-1370","post","type-post","status-publish","format-standard","hentry","category-android-build","tag-aapt"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1370"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1370\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}