更新2016年3月19日: Superpowered发布了与NDK r11一起正常运行的新二进制文件
我正在尝试在Android Studio中构建Superpowered库CrossExample示例项目.直到最近的NDK更新,它像魅力一样工作,但现在执行ndk-build会出错:
Error:error: undefined reference to '__page_size'
Run Code Online (Sandbox Code Playgroud)
我尝试用不同的工具链构建,删除/添加几个构建标志,到目前为止没有运气.
在使用Superpowered SDK和几乎相同配置的不同项目中,我得到了一些其他错误详细信息.输出消息日志的一部分:
/android/ndk/platforms/android-9/arch-x86/usr/include/unistd.h:173: error: undefined reference to '__page_size'
/android/ndk/platforms/android-9/arch-x86/usr/include/unistd.h:173: error: undefined reference to '__page_size'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/user_name/StudioProjects/project_name/app/src/main/jniSuperpowered/obj/local/x86/libNativeLibName.so] Error 1
make: *** Waiting for unfinished jobs....
/Volumes/iMect/iphone/SuperpoweredSource/decoder/SuperpoweredDecoder.cpp:120: error: undefined reference to '__page_size'
/Volumes/iMect/iphone/SuperpoweredSource/decoder/hlsreader.cpp:582: error: undefined reference to '__page_size'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/user_name/StudioProjects/project_name/app/src/main/jniSuperpowered/obj/local/armeabi-v7a/libNightcorizerSuperpowered.so] Error …Run Code Online (Sandbox Code Playgroud) 最近,我让所有三星Galaxy S7用户抱怨应用程序启动后立即崩溃。我没有从Crashlytics获得任何有关此问题的崩溃日志,至少这很奇怪。但幸运的是,一些用户向Play商店报告了这些问题,而我至少能够获得一些信息。
因此,这是Play商店开发者控制台中的日志:
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/hero2ltexx/hero2lte:6.0.1/MMB29K/G935FXXU1APF2:user/release-keys'
Revision: '9'
ABI: 'arm64'
pid: 18857, tid: 18900, name: GLThread 12749 >>> com.some.package <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x6b260
x0 0000007fb17836c0 x1 0000007fb1783788 x2 0000000000000001 x3 0000000000000001
x4 0000000000000000 x5 0000007f981afe50 x6 0000000000000000 x7 0000000000000000
x8 0000000000000001 x9 0000007f9993a570 x10 0000000000000001 x11 0000000000000036
x12 0000000000000001 x13 0000000000000000 x14 0000007f9a8ed000 x15 0000000000000000
x16 0000007fa50afa40 x17 …Run Code Online (Sandbox Code Playgroud) 我想glReadPixels()使用 PBO(对于 GLES 3 设备)提高性能,但我在这段代码中遇到了问题:
final ByteBuffer pboByteBuffer = ByteBuffer.allocateDirect(4 * mWidth * mHeight);
pboByteBuffer.order(ByteOrder.nativeOrder());
//set framebuffer to read from
GLES30.glReadBuffer(GLES30.GL_BACK);
// bind pbo
GLES30.glBindBuffer(GLES30.GL_PIXEL_PACK_BUFFER, mPboHandleContainer[0]);
// read pixels(should be instant)
GLES30.glReadPixels(0, 0, mWidth, mHeight, GLES30.GL_RGBA, GLES30.GL_UNSIGNED_BYTE, pboByteBuffer);
// map pbo to bb
ByteBuffer byteBuffer =
((ByteBuffer) GLES30.glMapBufferRange(GLES30.GL_PIXEL_PACK_BUFFER, 0, 4 * mWidth * mHeight,
GLES30.GL_MAP_READ_BIT)).order(ByteOrder.nativeOrder());
// unmap pbo
GLES30.glUnmapBuffer(GLES30.GL_PIXEL_PACK_BUFFER);
// unbind pbo
GLES30.glBindBuffer(GLES30.GL_PIXEL_PACK_BUFFER, 0);
Run Code Online (Sandbox Code Playgroud)
目前它失败了glReadPixels()。我找到了this & this,但我无法发送零,因为它需要 IntBuffer 参数。我非常感谢有关此问题的任何建议
更新:仅使用 Java API 来完成该任务似乎是不可能的。因此,我使用 …