我正在Antergos Linux环境中的android studio上开发应用程序。同步,构建和调试一切正常。一天前,经过一些更新,它不再构建。源代码是完全相同的,我已经尝试将我的代码重置为以前也工作的旧提交,所以我知道问题不是来自我的代码。 Gradle Sync消息是:
Build command failed.
Error while executing process /home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake with arguments {-H/home/andre/Development/Edru/edru-android/app
-B/home/andre/Development/Edru/edru-android/app/.externalNativeBuild/cmake/debug/armeabi
-GAndroid Gradle - Ninja -DANDROID_ABI=armeabi -DANDROID_NDK=/home/andre/Android/Sdk/ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/andre/Development/Edru/edru-android/app/build/intermediates/cmake/debug/obj/armeabi
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/home/andre/Android/Sdk/cmake/3.6.3155560/bin/ninja
-DCMAKE_TOOLCHAIN_FILE=/home/andre/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake
-DANDROID_PLATFORM=android-19 -DCMAKE_CXX_FLAGS=-std=c++11 -frtti -fexceptions}
/home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake: /usr/lib/libcrypto.so.1.0.0: version `OPENSSL_1.0.0' not found (required by /home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake)
/home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake: /usr/lib/libssl.so.1.0.0: version `OPENSSL_1.0.0' not found (required by /home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake)
/home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake: /usr/lib/libssl.so.1.0.0: version `OPENSSL_1.0.1' not found (required by /home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake)
Build command failed.
Error while executing process /home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake with arguments {-H/home/andre/Development/Edru/edru-android/app
-B/home/andre/Development/Edru/edru-android/app/.externalNativeBuild/cmake/release/armeabi
-GAndroid Gradle - Ninja -DANDROID_ABI=armeabi -DANDROID_NDK=/home/andre/Android/Sdk/ndk-bundle -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/andre/Development/Edru/edru-android/app/build/intermediates/cmake/release/obj/armeabi
-DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/home/andre/Android/Sdk/cmake/3.6.3155560/bin/ninja
-DCMAKE_TOOLCHAIN_FILE=/home/andre/Android/Sdk/ndk-bundle/build/cmake/android.toolchain.cmake
-DANDROID_PLATFORM=android-19 -DCMAKE_CXX_FLAGS=-std=c++11 -frtti -fexceptions}
/home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake: /usr/lib/libcrypto.so.1.0.0: version `OPENSSL_1.0.0' not found (required by /home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake)
/home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake: /usr/lib/libssl.so.1.0.0: version `OPENSSL_1.0.0' not found (required by /home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake)
/home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake: /usr/lib/libssl.so.1.0.0: version `OPENSSL_1.0.1' not found (required by /home/andre/Android/Sdk/cmake/3.6.3155560/bin/cmake)
我已经检查过,我有openssl 1.0和openssl 1.1。我已经用一个全新的android-studio重新安装了我的操作系统,问题仍然存在。
感谢您的关注。
答案 0 :(得分:5)
问题出在Android附带的cmake 3.6.3155560
和openssl-1.0.2.k-3之间。如果您是Arch Linux的最新版本,我相信您现在已经安装了extra/openssl-1.0 1.0.2.k-3
和core/openssl 1.1.0.e-1
。那是我的情况,至少。
在这种情况下,只需将openssl-1.0 1.0.2.k-3
降级为openssl-1.0 1.0.2.k-2
,如下所示:
注意:它对我有用,但我不是Arch专家,降级包可能会对您的系统产生影响。这样做需要您自担风险。
$ pacman -U openssl-1.0-1.0.2.k-2-x86_64.pkg.tar.xz
pacman -Ss openssl-1.0
,它应该告诉您:
extra / openssl-1.0 1.0.2.k-3 [已安装:1.0.2.k-2]
当然,pacman -Syu
会想再次更新openssl-1.0
。
更新:截至今日(30-05-2017),似乎已修复。
答案 1 :(得分:4)
为避免降级,您还可以下载如上所述的openssl-1.0-1.0.2.k-2-x86_64.pkg.tar.xz,解压缩归档并将lib / files复制到/ usr / local / lib例如 rsync -avz /tmp/openssl-1.0-1.0.2.k-2-x86_64.pkg.tar/usr/lib/ / usr / local / lib
然后编辑Android Studio启动脚本,例如/opt/android-studio/bin/studio.sh并更改: LD_LIBRARY_PATH =“$ IDE_BIN_HOME:$ LD_LIBRARY_PATH”“$ JAVA_BIN” 至 LD_LIBRARY_PATH =“/ usr / local / lib:$ IDE_BIN_HOME:$ LD_LIBRARY_PATH”“$ JAVA_BIN”