GCanvas 提供了一套类似于 H5 Canvas 标准的 JavaScript API。基于这套 API 可以方便的去做图形绘制、动画渲染等,开发的体验与 H5 Canvas 是完全一样的。主要解决移动设备H5移动应用开发2D 3D渲染效率低下的问题。核心部分使用C++实现,支持基于ReactNative和Weex等Hybrid架构的跨平台应用方便的集成。
GCanvas Android Weex集成步骤:
https://alibaba.github.io/GCanvas/docs/Integrate%20GCanvas%20on%20Weex.html
GCanvas项目源码路径:
https://github.com/alibaba/GCanvas#build-with
Android SDK Studio NDK 下载地址:
https://blog.csdn.net/sxbkelly/article/details/79469737
https://blog.csdn.net/gyh198/article/details/75036686
GCanvas技术Blog:
https://blog.csdn.net/M6i37JK/article/details/80154935
http://taobaofed.org/blog/2017/07/27/gcanvas/
编译步骤:
1. 打开Android Sutdio,选择File菜单-->Open...-->选择GCanvas根目录确定.
2. 选择需要编译的模块XXX, 选择Build菜单 -->Make module 'XXX'.
编译GCanvas碰到的问题:
1. gradle选择:3.0.1或者更高版本,低于3.0.0会提示错误google()函数找不到.
2. 编译core模块时候可能会碰到下边问题, NDK降级选择android-ndk-r12b.
Error while executing process C:\Users\Win7\AppData\Local\Android\sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\code\GCanvas-master\GCanvas\core\src\Android.mk NDK_APPLICATION_MK=C:\code\GCanvas-master\GCanvas\core\src\Application.mk APP_ABI=armeabi NDK_ALL_ABIS=armeabi NDK_DEBUG=1 APP_PLATFORM=android-14 NDK_OUT=C:/code/GCanvas-master/GCanvas/core/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\code\GCanvas-master\GCanvas\core\build\intermediates\ndkBuild\debug\lib C:/code/GCanvas-master/GCanvas/core/build/intermediates/ndkBuild/debug/obj/local/armeabi/libgcanvas.so}
C:/Users/Win7/AppData/Local/Android/sdk/ndk-bundle/build//../build/core/setup-app.mk:81: Android NDK: Application targets deprecated ABI(s): armeabi
C:/Users/Win7/AppData/Local/Android/sdk/ndk-bundle/build//../build/core/setup-app.mk:82: Android NDK: Support for these ABIs will be removed in a future NDK release.
Android NDK: WARNING: Unsupported source file extensions in C:\code\GCanvas-master\GCanvas\core\src\Android.mk for module gcanvas
Android NDK: GCanvas.hpp GCanvasString.hpp
[armeabi] SharedLibrary : libgcanvas.so
C:/Users/Win7/AppData/Local/Android/sdk/ndk-bundle/build//../toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe:
error:
C:/Users/Win7/AppData/Local/Android/sdk/ndk-bundle/build//../toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/liblto_plugin-0.dll: could not load plugin library: ????????
collect2.exe: error: ld returned 1 exit status
make: *** [C:/code/GCanvas-master/GCanvas/core/build/intermediates/ndkBuild/debug/obj/local/armeabi/libgcanvas.so] Error 1