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

problem when building from source android on mac os #13048

Closed
Xgamefactory opened this issue Oct 8, 2018 · 15 comments
Closed

problem when building from source android on mac os #13048

Xgamefactory opened this issue Oct 8, 2018 · 15 comments
Labels
Android Mapbox Maps SDK for Android build support

Comments

@Xgamefactory
Copy link

Xgamefactory commented Oct 8, 2018

after running make aproje
project opened in android studio with this error

Unsupported Modules Detected: Compilation is not supported for following modules: android. 
Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.

Error:Could not get unknown property 'compileDebugUnitTestSources' for project 
':MapboxGLAndroidSDK' of type org.gradle.api.Project.

screenshot

@tobrun
Copy link
Member

tobrun commented Oct 9, 2018

Thank you for reaching out @Xgamefactory, haven't heard about this issue before.

Here is some information on my local working configuration on mac:
screen shot 2018-10-09 at 12 38 36

Project structure of the android tab should look like:
screen shot 2018-10-09 at 12 44 21

configuration.gradle file contents:
screen shot 2018-10-09 at 12 44 31

SDK tools:

screen shot 2018-10-09 at 12 47 09

Considering that we do not provide support for building from source and we aren't hitting this issue locally. Going to close.

@tobrun tobrun closed this as completed Oct 9, 2018
@Xgamefactory
Copy link
Author

thanks @tobrun we are using ndk 17c we will try with ndk15.

@tobrun
Copy link
Member

tobrun commented Oct 9, 2018

17c should work as well, 18 isn't yet supported see #12972

@Xgamefactory
Copy link
Author

unfortunately we have 17c and stucked

46664898-4fabd780-cbd3-11e8-997d-67964cf3e9c2

@tobrun
Copy link
Member

tobrun commented Oct 9, 2018

could you press toggle view and see if you see more output in the text mode?

screen shot 2018-10-09 at 13 23 51

Does the process get stuck when you perform make android from the root folder of this project (the root, not /platform/android)

@Xgamefactory
Copy link
Author

is it normal that output aar MapboxGLAndroidSDK-debug.aar is 22mb ?
official mapbox-android-sdk-6.5.0.aar is less than 10mb

@Xgamefactory
Copy link
Author

we tried make android-lib-arm-v8 also gives 22mb aar output

@tobrun
Copy link
Member

tobrun commented Oct 9, 2018

this is normal as this is a debug variant, you can build a release with BUILDTYPE=Release make android for arm-v7. The normal release aar is build with make apackage.

@Xgamefactory
Copy link
Author

thanks for tips where we should define BUILDTYPE ?

@Xgamefactory
Copy link
Author

we did make apackage we get build success on terminal but no aar output

@tobrun
Copy link
Member

tobrun commented Oct 9, 2018

BUILDTYPE is a command line argument, when building with Android Studio, it will automatically pick up if you are building debug or a release variant.

What is the path you are looking for the aar output?

@Xgamefactory
Copy link
Author

there is a line in build.gradle
defaultPublishConfig project.hasProperty("mapbox.buildtype") ? project.getProperty("mapbox.buildtype") : "debug"

but we did not found where is mapbox.buildtype defined.
just changed debug to release

can you provide a screenshot where did you provide BUILDTYPE=Release make android ?

this is the path where aar is generated
/Users/user/Downloads/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/build/outputs

@Xgamefactory
Copy link
Author

thanks for support @tobrun for know i will use debug arr
or just replace files under jni folder with orignial aar ones )

@tobrun
Copy link
Member

tobrun commented Oct 9, 2018

either command-line:

screen shot 2018-10-09 at 14 44 11

or in android studio build variants:

screen shot 2018-10-09 at 14 45 08

@Xgamefactory
Copy link
Author

Xgamefactory commented Oct 9, 2018

i have changed to release through build variants.
but release build gives error

by the way running test app crashes


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':MapboxGLAndroidSDK:externalNativeBuildRelease'.
> Build command failed.
  Error while executing process /Users/user/Library/Android/sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /Users/user/Downloads/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/release/x86_64 --target mapbox-gl}
  [1/402] Linking CXX static library libicu.a
  [2/402] Building C object CMakeFiles/sqlite.dir/vendor/sqlite/src/sqlite3.c.o
  [3/402] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/actor/mailbox.cpp.o
  [4/402] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/actor/scheduler.cpp.o
  [5/402] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/algorithm/generate_clip_ids.cpp.o
  [6/402] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/annotation/annotation_manager.cpp.o
  [7/402] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/annotation/annotation_source.cpp.o
  FAILED: /Users/user/Downloads/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/.externalNativeBuild/cmake/release/x86_64/launch-c /Users/user/Downloads/android-ndk-r17c/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang  --target=x86_64-none-linux-android --gcc-toolchain=/Users/user/Downloads/android-ndk-r17c/toolchains/x86_64-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/user/Downloads/android-ndk-r17c/sysroot -DHAVE_DECL_STRERROR_R=1 -DHAVE_DLFCN_H=1 -DHAVE_FDATASYNC=1 -DHAVE_GMTIME_R=1 -DHAVE_INTTYPES_H=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MEMORY_H=1 -DHAVE_STDINT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRERROR_R=1 -DHAVE_STRINGS_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_USLEEP=1 -DHAVE_ZLIB_H=1 -DMBGL_USE_GLES2=1 -DRAPIDJSON_HAS_STDSTRING=1 -DSQLITE_HAVE_ZLIB -DSQLITE_THREADSAFE=1 -DSTDC_HEADERS=int -DVERSION=\"3.24.0\" -D_GLIBCXX_USE_CXX11_ABI=0 -D_REENTRANT=1 -I../../../../../../../vendor/sqlite/include -isystem /Users/user/Downloads/android-ndk-r17c/sysroot/usr/include/x86_64-linux-android -D__ANDROID_API__=21 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security  -Wall -Wextra -Wshadow -Wno-variadic-macros -Wno-unknown-pragmas -Werror -ffunction-sections -fdata-sections -O2 -DNDEBUG  -Os -DNDEBUG -flto -fPIC -fvisibility=hidden   -Wno-int-conversion -Wno-implicit-fallthrough -std=c99 -MD -MT CMakeFiles/sqlite.dir/vendor/sqlite/src/sqlite3.c.o -MF CMakeFiles/sqlite.dir/vendor/sqlite/src/sqlite3.c.o.d -o CMakeFiles/sqlite.dir/vendor/sqlite/src/sqlite3.c.o   -c /Users/user/Downloads/mapbox-gl-native/vendor/sqlite/src/sqlite3.c
  clang: error: argument unused during compilation: '-Wa,--noexecstack' [-Werror,-Wunused-command-line-argument]
  ninja: build stopped: subcommand failed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android build support
Projects
None yet
Development

No branches or pull requests

3 participants