mapsme / omim

πŸ—ΊοΈ MAPS.ME β€” Offline OpenStreetMap maps for iOS and Android
Apache License 2.0
4.58k stars 1.15k forks source link

Android ndk build fails on Ubuntu 16.04 #6265

Open ovy9086 opened 7 years ago

ovy9086 commented 7 years ago

My setup : Ubuntu 16.04 64bit Java openjdk "1.8.0_131" QMake version 3.0 Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu

I followed all the steps in the Wiki, I have Android SDK, NDK, everything installed.

Executing ./gradlew clean assembleWebRelease results in the ndkBuild task failling and producing the following output :

root@ovidiu-GL552VX:/home/ovidiu/StudioProjects/omim-git/omim/android# ./gradlew clean assembleWebRelease The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead. at build_6uiwdc9pi1ic83idxyhd4nvhr.run(/home/ovidiu/StudioProjects/omim-git/omim/android/build.gradle:397) Incremental java compilation is an incubating feature. :ndkBuildClean Android NDK: WARNING: APP_PLATFORM android-15 is higher than android:minSdkVersion 1 in ./AndroidManifest.xml. NDK binaries will not be comptible with devices older than android-15. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information.
[armeabi-v7a] Clean : android_support [armeabi-v7a] [armeabi-v7a] Clean : c++_shared [armeabi-v7a] [armeabi-v7a] Clean : c++_static [armeabi-v7a] [armeabi-v7a] Clean : c++abi [armeabi-v7a] [armeabi-v7a] Clean : mapswithme [armeabi-v7a] [armeabi-v7a] Clean : unwind [armeabi-v7a] [x86] Clean : android_support [x86] [x86] Clean : c++_shared [x86] [x86] Clean : c++_static [x86] [x86] Clean : c++abi [x86] [x86] Clean : mapswithme [x86] :clean :3rd_party:BottomSheet:clean :preBuild UP-TO-DATE :extractProguardFiles :preWebReleaseBuild :checkWebReleaseManifest :preAmazonBetaBuild UP-TO-DATE :preAmazonDebugBuild UP-TO-DATE :preAmazonReleaseBuild :preAppChinaBetaBuild UP-TO-DATE :preAppChinaDebugBuild UP-TO-DATE :preAppChinaReleaseBuild :preBaiduBetaBuild UP-TO-DATE :preBaiduDebugBuild UP-TO-DATE :preBaiduReleaseBuild :preBlackberryBetaBuild UP-TO-DATE :preBlackberryDebugBuild UP-TO-DATE :preBlackberryReleaseBuild :preCipherlabBetaBuild UP-TO-DATE :preCipherlabDebugBuild UP-TO-DATE :preCipherlabReleaseBuild :preGoogleBetaBuild UP-TO-DATE :preGoogleDebugBuild UP-TO-DATE :preGoogleReleaseBuild :preLenovoBetaBuild UP-TO-DATE :preLenovoDebugBuild UP-TO-DATE :preLenovoReleaseBuild :preMoboMarketBetaBuild UP-TO-DATE :preMoboMarketDebugBuild UP-TO-DATE :preMoboMarketReleaseBuild :preMobogenieBetaBuild UP-TO-DATE :preMobogenieDebugBuild UP-TO-DATE :preMobogenieReleaseBuild :preNineAppBetaBuild UP-TO-DATE :preNineAppDebugBuild UP-TO-DATE :preNineAppReleaseBuild :prePreinstallBetaBuild UP-TO-DATE :prePreinstallDebugBuild UP-TO-DATE :prePreinstallReleaseBuild :preSamsungBetaBuild UP-TO-DATE :preSamsungDebugBuild UP-TO-DATE :preSamsungReleaseBuild :preTencentBetaBuild UP-TO-DATE :preTencentDebugBuild UP-TO-DATE :preTencentReleaseBuild :preWebBetaBuild UP-TO-DATE :preWebDebugBuild UP-TO-DATE :preXiaomiBetaBuild UP-TO-DATE :preXiaomiDebugBuild UP-TO-DATE :preXiaomiReleaseBuild :preYandexBetaBuild UP-TO-DATE :preYandexDebugBuild UP-TO-DATE :preYandexReleaseBuild :prepareComAndroidSupportAnimatedVectorDrawable2340Library :prepareComAndroidSupportAppcompatV72340Library :prepareComAndroidSupportCardviewV72340Library :prepareComAndroidSupportDesign2340Library :preAmazonDebugAndroidTestBuild UP-TO-DATE :preAppChinaDebugAndroidTestBuild UP-TO-DATE :preBaiduDebugAndroidTestBuild UP-TO-DATE :preBlackberryDebugAndroidTestBuild UP-TO-DATE :preCipherlabDebugAndroidTestBuild UP-TO-DATE :preGoogleDebugAndroidTestBuild UP-TO-DATE :preLenovoDebugAndroidTestBuild UP-TO-DATE :preMoboMarketDebugAndroidTestBuild UP-TO-DATE :preMobogenieDebugAndroidTestBuild UP-TO-DATE :preNineAppDebugAndroidTestBuild UP-TO-DATE :prePreinstallDebugAndroidTestBuild UP-TO-DATE :preSamsungDebugAndroidTestBuild UP-TO-DATE :preTencentDebugAndroidTestBuild UP-TO-DATE :preWebDebugAndroidTestBuild UP-TO-DATE :preXiaomiDebugAndroidTestBuild UP-TO-DATE :preYandexDebugAndroidTestBuild UP-TO-DATE :prepareComAndroidSupportMultidex101Library :prepareComAndroidSupportPreferenceV142340Library :prepareComAndroidSupportPreferenceV72340Library :prepareComAndroidSupportRecyclerviewV72340Library :prepareComAndroidSupportSupportV42340Library :prepareComAndroidSupportSupportVectorDrawable2340Library :prepareComCrashlyticsSdkAndroidAnswers136Library :prepareComCrashlyticsSdkAndroidBeta114Library :prepareComCrashlyticsSdkAndroidCrashlytics255Library :prepareComCrashlyticsSdkAndroidCrashlyticsCore238Library :prepareComCrashlyticsSdkAndroidCrashlyticsNdk112Library :prepareComFacebookAndroidAudienceNetworkSdk4200Library :prepareComFacebookAndroidFacebookAndroidSdk480Library :prepareComGoogleAndroidExoplayerExoplayerR203Library :prepareComGoogleAndroidGmsPlayServicesAnalytics1001Library :prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl1001Library :prepareComGoogleAndroidGmsPlayServicesBase1001Library :prepareComGoogleAndroidGmsPlayServicesBasement1001Library :prepareComGoogleAndroidGmsPlayServicesGcm1001Library :prepareComGoogleAndroidGmsPlayServicesIid1001Library :prepareComGoogleAndroidGmsPlayServicesLocation1001Library :prepareComGoogleAndroidGmsPlayServicesPlus1001Library :prepareComGoogleAndroidGmsPlayServicesTagmanagerV4Impl1001Library :prepareComGoogleAndroidGmsPlayServicesTasks1001Library :prepareComMopubMopubSdkBase4110Library :prepareComMopubMopubSdkNativeStatic4110Library :prepareComMyTargetMytargetSdk4614Library :prepareComMyTrackerMytrackerSdk135Library :prepareComPushwooshPushwoosh4122Library :prepareComTimehopStickyheadersrecyclerviewLibrary043Library :prepareIoFabricSdkAndroidFabric1310Library :prepareOrgSolovyevAndroidViewsLinearLayoutManager05Library :3rd_party:BottomSheet:preBuild UP-TO-DATE :3rd_party:BottomSheet:preReleaseBuild UP-TO-DATE :3rd_party:BottomSheet:checkReleaseManifest :3rd_party:BottomSheet:preDebugAndroidTestBuild UP-TO-DATE :3rd_party:BottomSheet:preDebugBuild UP-TO-DATE :3rd_party:BottomSheet:preDebugUnitTestBuild UP-TO-DATE :3rd_party:BottomSheet:preReleaseUnitTestBuild UP-TO-DATE :3rd_party:BottomSheet:prepareComAndroidSupportSupportV42220Library :3rd_party:BottomSheet:prepareReleaseDependencies :3rd_party:BottomSheet:compileReleaseAidl :3rd_party:BottomSheet:compileReleaseNdk UP-TO-DATE :3rd_party:BottomSheet:compileLint :3rd_party:BottomSheet:copyReleaseLint UP-TO-DATE :3rd_party:BottomSheet:compileReleaseRenderscript :3rd_party:BottomSheet:generateReleaseBuildConfig :3rd_party:BottomSheet:generateReleaseResValues :3rd_party:BottomSheet:generateReleaseResources :3rd_party:BottomSheet:mergeReleaseResources :3rd_party:BottomSheet:processReleaseManifest :3rd_party:BottomSheet:processReleaseResources :3rd_party:BottomSheet:generateReleaseSources :3rd_party:BottomSheet:incrementalReleaseJavaCompilationSafeguard :3rd_party:BottomSheet:javaPreCompileRelease :3rd_party:BottomSheet:compileReleaseJavaWithJavac :3rd_party:BottomSheet:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). Note: /home/ovidiu/StudioProjects/omim-git/omim/android/3rd_party/BottomSheet/src/main/java/com/cocosw/bottomsheet/BottomSheet.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. :3rd_party:BottomSheet:extractReleaseAnnotations :3rd_party:BottomSheet:mergeReleaseShaders :3rd_party:BottomSheet:compileReleaseShaders :3rd_party:BottomSheet:generateReleaseAssets :3rd_party:BottomSheet:mergeReleaseAssets :3rd_party:BottomSheet:mergeReleaseProguardFiles UP-TO-DATE :3rd_party:BottomSheet:packageReleaseRenderscript UP-TO-DATE :3rd_party:BottomSheet:packageReleaseResources :3rd_party:BottomSheet:processReleaseJavaRes UP-TO-DATE :3rd_party:BottomSheet:transformResourcesWithMergeJavaResForRelease :3rd_party:BottomSheet:transformClassesAndResourcesWithSyncLibJarsForRelease :3rd_party:BottomSheet:mergeReleaseJniLibFolders :3rd_party:BottomSheet:transformNativeLibsWithMergeJniLibsForRelease :3rd_party:BottomSheet:transformNativeLibsWithStripDebugSymbolForRelease :3rd_party:BottomSheet:transformNativeLibsWithSyncJniLibsForRelease :3rd_party:BottomSheet:bundleRelease :prepareWebReleaseDependencies :compileWebReleaseAidl :compileWebReleaseRenderscript :generateWebReleaseBuildConfig :mergeWebReleaseShaders :compileWebReleaseShaders :generateWebReleaseAssets :mergeWebReleaseAssets :processWebArmeabi-v7aReleaseManifest :processWebUniversalReleaseManifest :processWebX86ReleaseManifest :fabricGenerateResourcesWebRelease :generateWebReleaseResValues :generateWebReleaseResources :mergeWebReleaseResources :processWebArmeabi-v7aReleaseResources :processWebUniversalReleaseResources :processWebX86ReleaseResources :generateWebReleaseSources :incrementalWebReleaseJavaCompilationSafeguard :javaPreCompileWebRelease :cppBuildRelease ++ dirname ../tools/autobuild/android.sh

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 45.56 secs

carlos-mg89 commented 7 years ago

I've got the exact same issue, here the details of my environment (which are pretty similar to the ones from @ovy9086 ):

Linux Mint 18.1 Cinnamon 64-bit java version "1.8.0_131" QMake version 3.0 Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu

I've been trying lots of different things, and I'm sure the NDK is up to date. Perhaps the info to build the project is a bit out of date?

In the documentation page https://github.com/mapsme/omim/blob/master/docs/INSTALL.md there's a section that says "If you encounter errors, try updating your Android SDK:". I tried to follow the info there, just in case the NDK was out of date (which would be weird, since I have downloaded it today in here "Android Studio: Tools β†’ Android β†’ SDK Manager"

The whole Android Studio, Java, QT, everything, has been installed between yesterday and today.

I can provide with more info if needed.

Just in case, here is my log, including the --stacktrace option:

https://pastebin.com/nrc21Gvd

Thanks in advance!

ovy9086 commented 7 years ago

So I solved this by using an older version of the NDK tools ( v13 ), you can find it here https://developer.android.com/ndk/downloads/older_releases.html .

Not sure if this is an known issue or not with NDK tools v15.

carlos-mg89 commented 7 years ago

Thank you @ovy9086 , that indeed made it work and I can now run the app on my phone. It crashed though, but that would be a different story.