Giter Site home page Giter Site logo

可不可以重新build一个release的2.0.0的aar,现在的三十多MB,太大了,之前的也才三点几兆 about smartcamera HOT 4 OPEN

pqpo avatar pqpo commented on July 19, 2024
可不可以重新build一个release的2.0.0的aar,现在的三十多MB,太大了,之前的也才三点几兆

from smartcamera.

Comments (4)

qq724418408 avatar qq724418408 commented on July 19, 2024

Execution failed for task ':smartcameralib:externalNativeBuildRelease'.

Build command failed.
Error while executing process /xxx/xxx/xxx/android/sdk/cmake/3.6.4111459/bin/cmake with arguments {--build /xxx/xxx/xxx/xxx/SmartCamera/smartcameralib/.externalNativeBuild/cmake/release/arm64-v8a --target smart_camera}
[1/4] Building CXX object CMakeFiles/smart_camera.dir/src/main/cpp/android_utils.cpp.o
[2/4] Building CXX object CMakeFiles/smart_camera.dir/src/main/cpp/opencv_utils.cpp.o
[3/4] Building CXX object CMakeFiles/smart_camera.dir/src/main/cpp/smart_camera.cpp.o
[4/4] Linking CXX shared library ../../../../build/intermediates/cmake/release/obj/arm64-v8a/libsmart_camera.so
FAILED: : && /xxx/xxx/xxx/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --gcc-toolchain=/xxx/xxx/xxx/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64 --sysroot=/xxx/xxx/xxx/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -std=c++11 -frtti -O2 -DNDEBUG -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_real.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libsmart_camera.so -o ../../../../build/intermediates/cmake/release/obj/arm64-v8a/libsmart_camera.so CMakeFiles/smart_camera.dir/src/main/cpp/android_utils.cpp.o CMakeFiles/smart_camera.dir/src/main/cpp/opencv_utils.cpp.o CMakeFiles/smart_camera.dir/src/main/cpp/smart_camera.cpp.o -L/xxx/xxx/xxx/xxx/SmartCamera/smartcameralib/opencv/lib/arm64-v8a -L/xxx/xxx/xxx/xxx/SmartCamera/smartcameralib/opencv/3rdparty/arm64-v8a -lopencv_imgproc -lopencv_core /xxx/xxx/xxx/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android/libz.a -ltegra_hal -ltbb -lcpufeatures -llog -ljnigraphics -latomic -lm && :
/xxx/xxx/xxx/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/lib/aarch64-linux-android/libz.a(gzwrite.o): In function write(int, void const*, unsigned long pass_object_size0)': bionic/libc/include/bits/fortify/unistd.h:174: undefined reference to __write_chk'
bionic/libc/include/bits/fortify/unistd.h:174: undefined reference to `__write_chk'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

from smartcamera.

qq724418408 avatar qq724418408 commented on July 19, 2024

我自己build的报错信息如上

from smartcamera.

levianye avatar levianye commented on July 19, 2024

我也遇到这个编译问题,这个是咋回事呢

from smartcamera.

gitgeek4dx avatar gitgeek4dx commented on July 19, 2024

ndk版本大于19会出现这个问题,可以改为ndk19以前编译正常
或者使用高版本ndk的话,改下cmake文件也可以,主要是libz的引用,由findLibrary改为target_link_libraries:

find_library( # Sets the name of the path variable.
log-lib
# Specifies the name of the NDK library that
# you want CMake to locate.
log )

target_link_libraries( # Specifies the target library.
${TARGET}
android
# Links the target library to the log library
# included in the NDK.
${log-lib}
jnigraphics
z)

if(${ANDROID_ABI} STREQUAL x86 OR ${ANDROID_ABI} STREQUAL x86_64)
target_link_libraries(${TARGET} opencv_imgproc opencv_core ippiw ippicv ittnotify tbb cpufeatures)
else()
target_link_libraries(${TARGET} opencv_imgproc opencv_core tegra_hal tbb cpufeatures)
endif()

from smartcamera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.