Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Android Not Compiling From master #5521

Closed
bleege opened this issue Jun 30, 2016 · 3 comments
Closed

Android Not Compiling From master #5521

bleege opened this issue Jun 30, 2016 · 3 comments
Labels
Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl

Comments

@bleege
Copy link
Contributor

bleege commented Jun 30, 2016

The Android SDK build process (make apackage) no longer compiles in master. This is preventing nightly SNAPSHOTS from being produced. I'm not sure if this is related to the merging of the Android 4.1.0 release branch back into master from #5512 or not yet. The error produced is:

MASON_PLATFORM="android" MASON_ANDROID_ABI="arm-v5" CXX="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-clang++" CC="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-clang" LD="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-ld" LINK="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-clang++" AR="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-ar" RANLIB="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-ranlib" STRIP="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-strip" LDFLAGS="--sysroot=/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/sysroot -target armv5te-none-linux-androideabi -march=armv5te -fuse-ld=gold -no-canonical-prefixes -Wl,--warn-shared-textrel -Wl,--fatal-warnings ${LDFLAGS:-}" CFLAGS="--sysroot=/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/sysroot -target armv5te-none-linux-androideabi -march=armv5te -mtune=xscale -msoft-float -D_LITTLE_ENDIAN -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-integrated-as -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument ${CFLAGS:-}" CXXFLAGS="--sysroot=/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/sysroot --sysroot=/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/sysroot -target armv5te-none-linux-androideabi -march=armv5te -mtune=xscale -msoft-float -D_LITTLE_ENDIAN -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-integrated-as -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument ${CXXFLAGS:-}" CPPFLAGS="-D__ANDROID__ ${CPPFLAGS:-}" JNIDIR="armeabi" deps/run_gyp --depth=. -Goutput_dir=. -f make-android -I build/android-arm-v5/config.gypi --generator-output=build/android-arm-v5 platform/android/platform.gyp
MASON_PLATFORM="android" MASON_ANDROID_ABI="arm-v5" CXX="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-clang++" CC="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-clang" LD="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-ld" LINK="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-clang++" AR="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-ar" RANLIB="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-ranlib" STRIP="/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/bin/arm-linux-androideabi-strip" LDFLAGS="--sysroot=/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/sysroot -target armv5te-none-linux-androideabi -march=armv5te -fuse-ld=gold -no-canonical-prefixes -Wl,--warn-shared-textrel -Wl,--fatal-warnings ${LDFLAGS:-}" CFLAGS="--sysroot=/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/sysroot -target armv5te-none-linux-androideabi -march=armv5te -mtune=xscale -msoft-float -D_LITTLE_ENDIAN -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-integrated-as -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument ${CFLAGS:-}" CXXFLAGS="--sysroot=/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/sysroot --sysroot=/bitrise/src/mason_packages/linux-x86_64/android-ndk/arm-9-r10e/sysroot -target armv5te-none-linux-androideabi -march=armv5te -mtune=xscale -msoft-float -D_LITTLE_ENDIAN -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-integrated-as -fomit-frame-pointer -fstrict-aliasing -Wno-invalid-command-line-argument -Wno-unused-command-line-argument ${CXXFLAGS:-}" CPPFLAGS="-D__ANDROID__ ${CPPFLAGS:-}" JNIDIR="armeabi" make -j2 -C build/android-arm-v5 all
make[1]: Entering directory '/bitrise/src/build/android-arm-v5'
  ACTION Bulding version header Release/obj/gen/include/mbgl/util/version.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_0 Release/obj/gen/include/mbgl/shader/util.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_1 Release/obj/gen/include/mbgl/shader/icon.fragment.hpp
Tag: [0, 2, 0]
Rev: ad081e69
  RULE platform_android_platform_gyp_headers_target_shaders_2 Release/obj/gen/include/mbgl/shader/fill.fragment.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_3 Release/obj/gen/include/mbgl/shader/icon.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_4 Release/obj/gen/include/mbgl/shader/circle.fragment.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_5 Release/obj/gen/include/mbgl/shader/debug.fragment.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_6 Release/obj/gen/include/mbgl/shader/line.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_7 Release/obj/gen/include/mbgl/shader/sdf.fragment.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_8 Release/obj/gen/include/mbgl/shader/sdf.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_9 Release/obj/gen/include/mbgl/shader/pattern.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_10 Release/obj/gen/include/mbgl/shader/collisionbox.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_11 Release/obj/gen/include/mbgl/shader/circle.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_12 Release/obj/gen/include/mbgl/shader/pattern.fragment.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_13 Release/obj/gen/include/mbgl/shader/line.fragment.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_14 Release/obj/gen/include/mbgl/shader/collisionbox.fragment.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_15 Release/obj/gen/include/mbgl/shader/outlinepattern.fragment.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_16 Release/obj/gen/include/mbgl/shader/raster.fragment.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_17 Release/obj/gen/include/mbgl/shader/outline.fragment.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_18 Release/obj/gen/include/mbgl/shader/linepattern.fragment.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_19 Release/obj/gen/include/mbgl/shader/linesdfpattern.fragment.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_20 Release/obj/gen/include/mbgl/shader/outlinepattern.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_21 Release/obj/gen/include/mbgl/shader/linesdfpattern.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_22 Release/obj/gen/include/mbgl/shader/linepattern.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_23 Release/obj/gen/include/mbgl/shader/debug.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_24 Release/obj/gen/include/mbgl/shader/fill.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_25 Release/obj/gen/include/mbgl/shader/outline.vertex.hpp
  RULE platform_android_platform_gyp_headers_target_shaders_26 Release/obj/gen/include/mbgl/shader/raster.vertex.hpp
make[1]: Circular all <- all dependency dropped.
  CXX(target) Release/obj.target/example-custom-layer-lib/platform/android/src/example_custom_layer.o
  COPY Release/ca-bundle.crt
  TOUCH Release/obj.target/platform/android/headers.stamp
  TOUCH Release/obj.target/platform/android/copy_certificate_bundle.stamp
  CXX(target) Release/obj.target/core/src/csscolorparser/csscolorparser.o
  CXX(target) Release/obj.target/core/src/mbgl/sprite/sprite_image.o
  CXX(target) Release/obj.target/core/src/mbgl/sprite/sprite_parser.o
  CXX(target) Release/obj.target/core/src/mbgl/sprite/sprite_atlas.o
  CXX(target) Release/obj.target/core/src/mbgl/sprite/sprite_store.o
  CXX(target) Release/obj.target/core/src/mbgl/map/transform.o
  CXX(target) Release/obj.target/core/src/mbgl/map/view.o
  CXX(target) Release/obj.target/core/src/mbgl/map/transform_state.o
  CXX(target) Release/obj.target/core/src/mbgl/map/map.o
  CXX(target) Release/obj.target/core/src/mbgl/annotation/style_sourced_annotation_impl.o
In file included from ../../src/mbgl/map/map.cpp:14:
In file included from ../../src/mbgl/renderer/painter.hpp:9:
../../src/mbgl/renderer/bucket.hpp:52:35: error: chosen constructor is explicit in copy-initialization
    util::Atomic<bool> uploaded = { false };
                                  ^~~~~~~~~
../../src/mbgl/util/atomic.hpp:19:14: note: constructor declared here
    explicit Atomic(const T& data_) : data(data_) {}
             ^
1 error generated.
platform/android/core.target.mk:284: recipe for target 'Release/obj.target/core/src/mbgl/map/map.o' failed
make[1]: *** [Release/obj.target/core/src/mbgl/map/map.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/bitrise/src/build/android-arm-v5'
Makefile:187: recipe for target 'android-lib-arm-v5' failed
make: *** [android-lib-arm-v5] Error 2

/cc @mapbox/gl

@bleege bleege added Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl labels Jun 30, 2016
@jfirebaugh
Copy link
Contributor

Also reported in #5482.

cc @tmpsantos

This might be as simple as changing it to util::Atomic<bool> uploaded { false }.

@bleege
Copy link
Contributor Author

bleege commented Jun 30, 2016

Per suggestion from @kkaefer @jfirebaugh I've removed the = from the line in bucket.hpp and ran make apackage locally. The compilation worked up until the known issue with MIPS not compiling when the BuildType is in Debug mode. I'm running it again now with BuildType set to Release (usual workaround) to confirm that this does indeed get things working again.

Bigger picture, after this lands we should look at doing the NDK update as without it and the BuildType being set to Debug in the Makefile the Android SDK nightly SNAPSHOTS will never build.

@bleege
Copy link
Contributor Author

bleege commented Jun 30, 2016

Confirmed that switching to Release build type fixed the compilation issue. I've committed the change and as soon as CI approves I'll merge it in to master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

2 participants