2013-12-20 64 views
7

我有一個image converter谷歌播放應用程序運行良好,它包含NDK支持更多的文件格式使用Devil圖像處理庫。UnsatisfiedLinkError在Android 4.4 libDevil無法找到符號「png_set_longjmp_fn」

它wokrs上大多數設備,但由於Android 4.4奇巧出來了,我已經收到了在谷歌電子郵件和崩潰報告播放控制檯特別是從有4.4,現在其他舊設備接收更新的Nexus設備精細

這裏是崩潰報告

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "png_set_longjmp_fn" referenced by "libdevil.so"... 
at java.lang.Runtime.loadLibrary(Runtime.java:364) 
at java.lang.System.loadLibrary(System.java:526) 
at com.paul.icon.MainActivity.<clinit>(Unknown Source) 
at java.lang.Class.newInstanceImpl(Native Method) 
at java.lang.Class.newInstance(Class.java:1208) 
at android.app.Instrumentation.newActivity(Instrumentation.java:1061) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5017) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
at dalvik.system.NativeStart.main(Native Method) 

加載libdevil

static { 
     System.loadLibrary("physfs"); 
     System.loadLibrary("jpeg"); 
     System.loadLibrary("tiff"); 
     System.loadLibrary("mng"); 
     System.loadLibrary("png"); 
     System.loadLibrary("jasper"); 
     System.loadLibrary("lcms"); 
     System.loadLibrary("devil"); 
     System.loadLibrary("mylib"); 
    } 
時,應用程序無法啓動,並從我自己的調試從我MainActivity.java第一線的

說....

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "png_set_longjmp_fn" referenced by "libdevil.so"... 

這裏是我的android.mk文件

LOCAL_PATH := $(call my-dir) 

PHYSFS_SRC_PATH  := physfs-2.0.2/ 
TIFF_SRC_PATH  := tiff-3.9.5/ 
MNG_SRC_PATH  := libmng-1.0.10/ 
LCMS_SRC_PATH  := lcms2-2.2/ 
PNG_SRC_PATH  := libpng-1.5.6/ 
JPEG_SRC_PATH  := jpeg-8c/ 
JASPER_SRC_PATH  := jasper-1.900.1/ 
DEVIL_SRC_PATH  := devil-1.7.8/ 


#libjpeg 
include $(CLEAR_VARS) 

LOCAL_MODULE := libjpeg 
LOCAL_MODULE_FILENAME := libjpeg 

LOCAL_SRC_FILES := \ 
     ${JPEG_SRC_PATH}jcapimin.c ${JPEG_SRC_PATH}jcapistd.c ${JPEG_SRC_PATH}jccoefct.c ${JPEG_SRC_PATH}jccolor.c ${JPEG_SRC_PATH}jcdctmgr.c ${JPEG_SRC_PATH}jchuff.c \ 
     ${JPEG_SRC_PATH}jcinit.c ${JPEG_SRC_PATH}jcmainct.c ${JPEG_SRC_PATH}jcmarker.c ${JPEG_SRC_PATH}jcmaster.c ${JPEG_SRC_PATH}jcomapi.c ${JPEG_SRC_PATH}jcparam.c \ 
     ${JPEG_SRC_PATH}jcprepct.c ${JPEG_SRC_PATH}jcsample.c ${JPEG_SRC_PATH}jctrans.c ${JPEG_SRC_PATH}jdapimin.c ${JPEG_SRC_PATH}jdapistd.c \ 
     ${JPEG_SRC_PATH}jdatadst.c ${JPEG_SRC_PATH}jdatasrc.c ${JPEG_SRC_PATH}jdcoefct.c ${JPEG_SRC_PATH}jdcolor.c ${JPEG_SRC_PATH}jddctmgr.c ${JPEG_SRC_PATH}jdhuff.c \ 
     ${JPEG_SRC_PATH}jdinput.c ${JPEG_SRC_PATH}jdmainct.c ${JPEG_SRC_PATH}jdmarker.c ${JPEG_SRC_PATH}jdmaster.c ${JPEG_SRC_PATH}jdmerge.c \ 
     ${JPEG_SRC_PATH}jdpostct.c ${JPEG_SRC_PATH}jdsample.c ${JPEG_SRC_PATH}jdtrans.c ${JPEG_SRC_PATH}jerror.c ${JPEG_SRC_PATH}jfdctflt.c ${JPEG_SRC_PATH}jfdctfst.c \ 
     ${JPEG_SRC_PATH}jfdctint.c ${JPEG_SRC_PATH}jidctflt.c ${JPEG_SRC_PATH}jidctfst.c ${JPEG_SRC_PATH}jidctint.c ${JPEG_SRC_PATH}jquant1.c \ 
     ${JPEG_SRC_PATH}jquant2.c ${JPEG_SRC_PATH}jutils.c ${JPEG_SRC_PATH}jmemmgr.c ${JPEG_SRC_PATH}jcarith.c ${JPEG_SRC_PATH}jdarith.c ${JPEG_SRC_PATH}jaricom.c 

# Use the no backing store memory manager provided by 
# libjpeg. See install.txt 
LOCAL_SRC_FILES += \ 
     ${JPEG_SRC_PATH}jmemnobs.c 

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 

include $(BUILD_STATIC_LIBRARY) 

#libtiff 
include $(CLEAR_VARS) 

LOCAL_MODULE := libtiff 
LOCAL_CFLAGS := -g -Dlinux -DFT2_BUILD_LIBRARY=1 -DPHYSFS_NO_CDROM_SUPPORT=1 -DAL_ALEXT_PROTOTYPES=1 -DHAVE_GCC_DESTRUCTOR=1 -DOPT_GENERIC -DREAL_IS_FLOAT 
LOCAL_CPPFLAGS := ${LOCAL_CFLAGS} 

LOCAL_C_INCLUDES := \ 
    ${TIFF_SRC_PATH}libtiff/ \ 
    ${JPEG_SRC_PATH} \ 

LOCAL_SRC_FILES := \ 
    ${TIFF_SRC_PATH}libtiff/tif_dir.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_codec.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_predict.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_tile.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_version.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_unix.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_swab.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_thunder.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_next.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_strip.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_extension.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_error.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_dirwrite.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_fax3sm.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_ojpeg.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_flush.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_warning.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_fax3.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_jbig.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_open.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_write.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_packbits.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_compress.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_color.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_print.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_zip.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_aux.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_dumpmode.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_dirread.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_getimage.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_jpeg.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_close.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_read.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_luv.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_dirinfo.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_lzw.c \ 
    ${TIFF_SRC_PATH}libtiff/tif_pixarlog.c \ 
    ${TIFF_SRC_PATH}port/lfind.c 

LOCAL_LDLIBS := -llog -L../lib -lGLESv1_CM 

LOCAL_STATIC_LIBRARIES := libjpeg libphysfs 

include $(BUILD_SHARED_LIBRARY) 


#libphysfs 
include $(CLEAR_VARS) 

LOCAL_MODULE := libphysfs 
LOCAL_CFLAGS := -g -Dlinux -Dunix -DFT2_BUILD_LIBRARY=1 -DPHYSFS_NO_CDROM_SUPPORT=1 -DAL_ALEXT_PROTOTYPES=1 -DHAVE_GCC_DESTRUCTOR=1 -DOPT_GENERIC -DREAL_IS_FLOAT \ 
        -DPHYSFS_SUPPORTS_APK=1 -DPHYSFS_SUPPORTS_ZIP=1 -DPHYSFS_SUPPORTS_ZIP=1 -DPHYSFS_SUPPORTS_7Z=1 -DPHYSFS_SUPPORTS_GRP=1 -DPHYSFS_SUPPORTS_QPAK=1 -DPHYSFS_SUPPORTS_HOG=1 -DPHYSFS_SUPPORTS_MVL=1 -DPHYSFS_SUPPORTS_WAD=1 

LOCAL_CPPFLAGS := ${LOCAL_CFLAGS} 

LOCAL_C_INCLUDES := \ 
    ${PHYSFS_SRC_PATH} 

LOCAL_SRC_FILES := \ 
    ${PHYSFS_SRC_PATH}/physfs.c \ 
    ${PHYSFS_SRC_PATH}/physfs_byteorder.c \ 
    ${PHYSFS_SRC_PATH}/physfs_unicode.c \ 
    ${PHYSFS_SRC_PATH}/platform/os2.c \ 
    ${PHYSFS_SRC_PATH}/platform/pocketpc.c \ 
    ${PHYSFS_SRC_PATH}/platform/posix.c \ 
    ${PHYSFS_SRC_PATH}/platform/unix.c \ 
    ${PHYSFS_SRC_PATH}/platform/macosx.c \ 
    ${PHYSFS_SRC_PATH}/platform/windows.c \ 
    ${PHYSFS_SRC_PATH}/archivers/dir.c \ 
    ${PHYSFS_SRC_PATH}/archivers/grp.c \ 
    ${PHYSFS_SRC_PATH}/archivers/hog.c \ 
    ${PHYSFS_SRC_PATH}/archivers/lzma.c \ 
    ${PHYSFS_SRC_PATH}/archivers/mvl.c \ 
    ${PHYSFS_SRC_PATH}/archivers/qpak.c \ 
    ${PHYSFS_SRC_PATH}/archivers/wad.c \ 
    ${PHYSFS_SRC_PATH}/archivers/zip.c \ 
    ${PHYSFS_SRC_PATH}/archivers/apk.c \ 
    ${PHYSFS_SRC_PATH}/lzma/C/7zCrc.c \ 
    ${PHYSFS_SRC_PATH}/lzma/C/Archive/7z/7zBuffer.c \ 
    ${PHYSFS_SRC_PATH}/lzma/C/Archive/7z/7zDecode.c \ 
    ${PHYSFS_SRC_PATH}/lzma/C/Archive/7z/7zExtract.c \ 
    ${PHYSFS_SRC_PATH}/lzma/C/Archive/7z/7zHeader.c \ 
    ${PHYSFS_SRC_PATH}/lzma/C/Archive/7z/7zIn.c \ 
    ${PHYSFS_SRC_PATH}/lzma/C/Archive/7z/7zItem.c \ 
    ${PHYSFS_SRC_PATH}/lzma/C/Archive/7z/7zMethodID.c \ 
    ${PHYSFS_SRC_PATH}/lzma/C/Compress/Branch/BranchX86.c \ 
    ${PHYSFS_SRC_PATH}/lzma/C/Compress/Branch/BranchX86_2.c \ 
    ${PHYSFS_SRC_PATH}/lzma/C/Compress/Lzma/LzmaDecode.c \ 
    ${PHYSFS_SRC_PATH}/zlib123/adler32.c \ 
    ${PHYSFS_SRC_PATH}/zlib123/compress.c \ 
    ${PHYSFS_SRC_PATH}/zlib123/crc32.c \ 
    ${PHYSFS_SRC_PATH}/zlib123/deflate.c \ 
    ${PHYSFS_SRC_PATH}/zlib123/gzio.c \ 
    ${PHYSFS_SRC_PATH}/zlib123/infback.c \ 
    ${PHYSFS_SRC_PATH}/zlib123/inffast.c \ 
    ${PHYSFS_SRC_PATH}/zlib123/inflate.c \ 
    ${PHYSFS_SRC_PATH}/zlib123/inftrees.c \ 
    ${PHYSFS_SRC_PATH}/zlib123/trees.c \ 
    ${PHYSFS_SRC_PATH}/zlib123/uncompr.c \ 
    ${PHYSFS_SRC_PATH}/zlib123/zutil.c \ 



LOCAL_LDLIBS := -llog -L../lib -lGLESv1_CM 

LOCAL_STATIC_LIBRARIES := 

include $(BUILD_SHARED_LIBRARY) 

#libmng 
include $(CLEAR_VARS) 

LOCAL_MODULE := libmng 
LOCAL_CFLAGS := -g -Dlinux -DFT2_BUILD_LIBRARY=1 -DPHYSFS_NO_CDROM_SUPPORT=1 -DAL_ALEXT_PROTOTYPES=1 -DHAVE_GCC_DESTRUCTOR=1 -DOPT_GENERIC -DREAL_IS_FLOAT 
LOCAL_CPPFLAGS := ${LOCAL_CFLAGS} 

LOCAL_C_INCLUDES := \ 
    ${JPEG_SRC_PATH} \ 
    ${MNG_SRC_PATH} 

LOCAL_SRC_FILES := \ 
    ${MNG_SRC_PATH}libmng_write.c \ 
    ${MNG_SRC_PATH}libmng_object_prc.c \ 
    ${MNG_SRC_PATH}libmng_display.c \ 
    ${MNG_SRC_PATH}libmng_chunk_xs.c \ 
    ${MNG_SRC_PATH}libmng_chunk_io.c \ 
    ${MNG_SRC_PATH}libmng_read.c \ 
    ${MNG_SRC_PATH}libmng_prop_xs.c \ 
    ${MNG_SRC_PATH}libmng_filter.c \ 
    ${MNG_SRC_PATH}libmng_chunk_descr.c \ 
    ${MNG_SRC_PATH}libmng_cms.c \ 
    ${MNG_SRC_PATH}libmng_zlib.c \ 
    ${MNG_SRC_PATH}libmng_pixels.c \ 
    ${MNG_SRC_PATH}libmng_error.c \ 
    ${MNG_SRC_PATH}libmng_trace.c \ 
    ${MNG_SRC_PATH}libmng_jpeg.c \ 
    ${MNG_SRC_PATH}libmng_callback_xs.c \ 
    ${MNG_SRC_PATH}libmng_dither.c \ 
    ${MNG_SRC_PATH}libmng_hlapi.c \ 
    ${MNG_SRC_PATH}libmng_chunk_prc.c \ 

LOCAL_LDLIBS := -llog -L../lib -lGLESv1_CM 

LOCAL_STATIC_LIBRARIES := libjpeg libphysfs 

include $(BUILD_SHARED_LIBRARY) 


#liblcms 
include $(CLEAR_VARS) 

LOCAL_MODULE := liblcms 
LOCAL_CFLAGS := -g -Dlinux -DFT2_BUILD_LIBRARY=1 -DPHYSFS_NO_CDROM_SUPPORT=1 -DAL_ALEXT_PROTOTYPES=1 -DHAVE_GCC_DESTRUCTOR=1 -DOPT_GENERIC -DREAL_IS_FLOAT 
LOCAL_CPPFLAGS := ${LOCAL_CFLAGS} 

LOCAL_C_INCLUDES := \ 
    ${LCMS_SRC_PATH}include/ \ 

LOCAL_SRC_FILES := \ 
    ${LCMS_SRC_PATH}src/cmscam02.c \ 
    ${LCMS_SRC_PATH}src/cmserr.c \ 
    ${LCMS_SRC_PATH}src/cmstypes.c \ 
    ${LCMS_SRC_PATH}src/cmsmd5.c \ 
    ${LCMS_SRC_PATH}src/cmswtpnt.c \ 
    ${LCMS_SRC_PATH}src/cmsgmt.c \ 
    ${LCMS_SRC_PATH}src/cmspcs.c \ 
    ${LCMS_SRC_PATH}src/cmsopt.c \ 
    ${LCMS_SRC_PATH}src/cmscnvrt.c \ 
    ${LCMS_SRC_PATH}src/cmsps2.c \ 
    ${LCMS_SRC_PATH}src/cmssamp.c \ 
    ${LCMS_SRC_PATH}src/cmsplugin.c \ 
    ${LCMS_SRC_PATH}src/cmsmtrx.c \ 
    ${LCMS_SRC_PATH}src/cmspack.c \ 
    ${LCMS_SRC_PATH}src/cmsio0.c \ 
    ${LCMS_SRC_PATH}src/cmsgamma.c \ 
    ${LCMS_SRC_PATH}src/cmscgats.c \ 
    ${LCMS_SRC_PATH}src/cmsxform.c \ 
    ${LCMS_SRC_PATH}src/cmsnamed.c \ 
    ${LCMS_SRC_PATH}src/cmssm.c \ 
    ${LCMS_SRC_PATH}src/cmsio1.c \ 
    ${LCMS_SRC_PATH}src/cmsintrp.c \ 
    ${LCMS_SRC_PATH}src/cmslut.c \ 
    ${LCMS_SRC_PATH}src/cmsvirt.c \ 

LOCAL_LDLIBS := -llog -L../lib -lGLESv1_CM 

LOCAL_STATIC_LIBRARIES := 

include $(BUILD_SHARED_LIBRARY) 

#libpng 
include $(CLEAR_VARS) 

LOCAL_MODULE := libpng 
LOCAL_CFLAGS := -g -Dlinux -DFT2_BUILD_LIBRARY=1 -DPHYSFS_NO_CDROM_SUPPORT=1 -DAL_ALEXT_PROTOTYPES=1 -DHAVE_GCC_DESTRUCTOR=1 -DOPT_GENERIC -DREAL_IS_FLOAT 
LOCAL_CPPFLAGS := ${LOCAL_CFLAGS} 

LOCAL_C_INCLUDES := \ 
    ${PNG_SRC_PATH} \ 

LOCAL_SRC_FILES := \ 
    ${PNG_SRC_PATH}pngerror.c \ 
    ${PNG_SRC_PATH}pngwio.c \ 
    ${PNG_SRC_PATH}pngwrite.c \ 
    ${PNG_SRC_PATH}pngwutil.c \ 
    ${PNG_SRC_PATH}pngwtran.c \ 
    ${PNG_SRC_PATH}pngset.c \ 
    ${PNG_SRC_PATH}pngtrans.c \ 
    ${PNG_SRC_PATH}example.c \ 
    ${PNG_SRC_PATH}png.c \ 
    ${PNG_SRC_PATH}pngrtran.c \ 
    ${PNG_SRC_PATH}pngmem.c \ 
    ${PNG_SRC_PATH}pngpread.c \ 
    ${PNG_SRC_PATH}pngrutil.c \ 
    ${PNG_SRC_PATH}pngrio.c \ 
    ${PNG_SRC_PATH}pngget.c \ 
    ${PNG_SRC_PATH}pngread.c \ 

LOCAL_LDLIBS := -llog -L../lib -lGLESv1_CM 

LOCAL_STATIC_LIBRARIES := libphysfs 

include $(BUILD_SHARED_LIBRARY) 

#libjasper 
include $(CLEAR_VARS) 

LOCAL_MODULE := libjasper 
LOCAL_CFLAGS := -g -Dlinux -DFT2_BUILD_LIBRARY=1 -DPHYSFS_NO_CDROM_SUPPORT=1 -DAL_ALEXT_PROTOTYPES=1 -DHAVE_GCC_DESTRUCTOR=1 -DOPT_GENERIC -DREAL_IS_FLOAT 
LOCAL_CPPFLAGS := ${LOCAL_CFLAGS} 

LOCAL_C_INCLUDES := \ 
    ${JASPER_SRC_PATH}src/libjasper/include \ 
    ${JPEG_SRC_PATH} \ 

LOCAL_SRC_FILES := \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_cm.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_getopt.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_seq.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_malloc.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_init.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_debug.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_stream.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_string.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_version.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_tmr.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_image.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_tvp.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_iccdata.c \ 
    ${JASPER_SRC_PATH}src/libjasper/base/jas_icc.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_mqcod.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_t1enc.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_dec.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_math.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_util.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_bs.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_tagtree.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_t1cod.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_t2enc.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_mqenc.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_enc.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_qmfb.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_t1dec.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_cs.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_t2cod.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_tsfb.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_mqdec.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_t2dec.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpc/jpc_mct.c \ 
    ${JASPER_SRC_PATH}src/libjasper/dummy.c \ 
    ${JASPER_SRC_PATH}src/libjasper/pnm/pnm_dec.c \ 
    ${JASPER_SRC_PATH}src/libjasper/pnm/pnm_enc.c \ 
    ${JASPER_SRC_PATH}src/libjasper/pnm/pnm_cod.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jp2/jp2_enc.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jp2/jp2_cod.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jp2/jp2_dec.c \ 
    ${JASPER_SRC_PATH}src/libjasper/pgx/pgx_dec.c \ 
    ${JASPER_SRC_PATH}src/libjasper/pgx/pgx_enc.c \ 
    ${JASPER_SRC_PATH}src/libjasper/pgx/pgx_cod.c \ 
    ${JASPER_SRC_PATH}src/libjasper/bmp/bmp_enc.c \ 
    ${JASPER_SRC_PATH}src/libjasper/bmp/bmp_dec.c \ 
    ${JASPER_SRC_PATH}src/libjasper/bmp/bmp_cod.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpg/jpg_val.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpg/jpg_enc.c \ 
    ${JASPER_SRC_PATH}src/libjasper/jpg/jpg_dec.c \ 
    ${JASPER_SRC_PATH}src/libjasper/ras/ras_cod.c \ 
    ${JASPER_SRC_PATH}src/libjasper/ras/ras_dec.c \ 
    ${JASPER_SRC_PATH}src/libjasper/ras/ras_enc.c \ 
    ${JASPER_SRC_PATH}src/libjasper/mif/mif_cod.c \ 

LOCAL_LDLIBS := -llog -L../lib -lGLESv1_CM 

LOCAL_STATIC_LIBRARIES := libjpeg 

include $(BUILD_SHARED_LIBRARY) 

#libdevil 
include $(CLEAR_VARS) 

LOCAL_MODULE := libdevil 
LOCAL_CFLAGS := -g -Dlinux -DFT2_BUILD_LIBRARY=1 -DPHYSFS_NO_CDROM_SUPPORT=1 -DAL_ALEXT_PROTOTYPES=1 -DHAVE_GCC_DESTRUCTOR=1 -DOPT_GENERIC -DREAL_IS_FLOAT -fexceptions 
LOCAL_CPPFLAGS := ${LOCAL_CFLAGS} 


LOCAL_C_INCLUDES := \ 
    ${DEVIL_SRC_PATH}include \ 
    ${DEVIL_SRC_PATH}src-IL/include \ 
    ${DEVIL_SRC_PATH}src-ILU/include \ 
    ${JASPER_SRC_PATH}src/libjasper/include \ 
    ${PHYSFS_SRC_PATH} \ 
    ${PHYSFS_SRC_PATH}zlib123 \ 
    ${PNG_SRC_PATH} \ 
    ${MNG_SRC_PATH} \ 
    ${JPEG_SRC_PATH} \ 
    ${LCMS_SRC_PATH}include/ \ 
    ${TIFF_SRC_PATH}libtiff/ \ 

LOCAL_SRC_FILES := \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_sun.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_wdp.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_doom.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_jp2.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_tpl.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_size.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_rle.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_gif.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_states.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_psp.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_devil.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_convbuff.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_ftx.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_vtf.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_iff.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_lif.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_pcx.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_io.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_files.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_fastconv.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_error.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_main.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_utx.cpp \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_pcd.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_neuquant.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_dds.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_dicom.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_wal.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_icon.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_blp.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_mp3.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_header.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_alloc.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_sgi.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_stack.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_texture.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/altivec_typeconversion.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_targa.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_bmp.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_mdl.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_pix.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_pnm.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_ilbm.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_icns.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_cut.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_profiles.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_hdr.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_register.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_exr.cpp \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_iwi.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_mng.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_rot.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_jpeg.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_png.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_pxr.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_nvidia.cpp \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_squish.cpp \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_utility.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_internal.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_psd.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_endian.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_quantizer.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_wbmp.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_manip.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_pic.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_tiff.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_pal.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_dds-save.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_raw.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_convert.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_dcx.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_fits.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_xpm.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_bits.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/altivec_common.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_dpx.c \ 
    ${DEVIL_SRC_PATH}src-IL/src/il_rawdata.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_alloc.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_error.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_filter_rcg.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_filter.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_internal.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_main.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_manip.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_mipmap.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_noise.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_region.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_rotate.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_scale.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_scale2d.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_scale3d.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_scaling.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_states.c \ 
    ${DEVIL_SRC_PATH}src-ILU/src/ilu_utilities.c \ 

LOCAL_LDLIBS := -llog -L../lib -lGLESv1_CM -DFT2_BUILD_LIBRARY=1 

LOCAL_STATIC_LIBRARIES := \ 
    libjasper \ 
    libpng \ 
    libmng \ 
    libjpeg \ 
    liblcms \ 
    libphysfs \ 
    libtiff 

include $(BUILD_SHARED_LIBRARY) 



#mylib 
include $(CLEAR_VARS) 
LOCAL_MODULE := libmylib 
LOCAL_CFLAGS := -g -Dlinux -DFT2_BUILD_LIBRARY=1 -DPHYSFS_NO_CDROM_SUPPORT=1 -DAL_ALEXT_PROTOTYPES=1 -DHAVE_GCC_DESTRUCTOR=1 -DOPT_GENERIC -DREAL_IS_FLOAT -fexceptions 
LOCAL_CPPFLAGS := ${LOCAL_CFLAGS} 
LOCAL_C_INCLUDES := \ 
    ${DEVIL_SRC_PATH}include \ 
    ${DEVIL_SRC_PATH}src-IL/include \ 
    ${DEVIL_SRC_PATH}src-ILU/include \ 
    ${JASPER_SRC_PATH}src/libjasper/include \ 
    ${PHYSFS_SRC_PATH} \ 
    ${PHYSFS_SRC_PATH}zlib123 \ 
    ${PNG_SRC_PATH} \ 
    ${MNG_SRC_PATH} \ 
    ${JPEG_SRC_PATH} \ 
    ${LCMS_SRC_PATH}include/ \ 
    ${TIFF_SRC_PATH}libtiff/ \ 


LOCAL_SRC_FILES := native.cpp 

LOCAL_LDLIBS := -llog -lGLESv2 

LOCAL_STATIC_LIBRARIES := \ 
    libjasper \ 
    libpng \ 
    libmng \ 
    libjpeg \ 
    liblcms \ 
    libphysfs \ 
    libtiff \ 
    libdevil \ 


include $(BUILD_SHARED_LIBRARY) 

和我application.mk

APP_STL := gnustl_static 
APP_ABI := armeabi-v7a 

搜索我的整個文件夾JNI爲png_set_longjmp_fn串後,我在libpng文件夾中的以下文件中找到它。以下是片段。

pngerror.c

#ifdef PNG_SETJMP_SUPPORTED 
/* This API only exists if ANSI-C style error handling is used, 
* otherwise it is necessary for png_default_error to be overridden. 
*/ 
jmp_buf* PNGAPI 
png_set_longjmp_fn(png_structrp png_ptr, png_longjmp_ptr longjmp_fn, 
    size_t jmp_buf_size) 
{ 
    /* From libpng 1.6.0 the app gets one chance to set a 'jmpbuf_size' value 
    * and it must not change after that. Libpng doesn't care how big the 
    * buffer is, just that it doesn't change. 
    * 
    * If the buffer size is no *larger* than the size of jmp_buf when libpng is 

symbols.def

;Version 1.6.2 
;-------------------------------------------------------------- 
; LIBPNG symbol list as a Win32 DEF file 
; Contains all the symbols that can be exported from libpng 
;-------------------------------------------------------------- 
LIBRARY 

    EXPORTS 

     png_access_version_number @1 
     png_set_sig_bytes @2 
     png_sig_cmp @3 
     png_create_read_struct @4 
     png_create_write_struct @5 
     png_get_compression_buffer_size @6 
     png_set_compression_buffer_size @7 
     png_set_longjmp_fn @8 
     png_longjmp @9 

png.h

#ifdef PNG_SETJMP_SUPPORTED 
/* This function returns the jmp_buf built in to *png_ptr. It must be 
* supplied with an appropriate 'longjmp' function to use on that jmp_buf 
* unless the default error function is overridden in which case NULL is 
* acceptable. The size of the jmp_buf is checked against the actual size 
* allocated by the library - the call will return NULL on a mismatch 
* indicating an ABI mismatch. 
*/ 
PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr, 
    png_longjmp_ptr longjmp_fn, size_t jmp_buf_size)); 
# define png_jmpbuf(png_ptr) \ 
     (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf)))) 
#else 

任何幫助,使奇巧找到它是非常讚賞。

回答

11

那麼從我所有的google搜索,我想的是Android 4.4的嘗試鏈接什麼的libpng叫其自己的libpng 46年2月1日,我的libpng 1.5.6有png_set_longjmp_fn符號和一個4.4用途不

所以我去了我的android.mk文件,並將libpng重命名爲libpngo以及我的mainactivity中的system.load thingy。

現在可以工作了。

+0

哇,這是一個偉大的發現! –

+0

「system.load thingy」似乎意味着將System.loadLibrary(「png」);改爲System.loadLibrary(「pngo」);'。 – rmtheis

+0

這裏只是重命名不起作用。最後,我用libpng靜態鏈接編譯我的代碼,所以我不必添加共享庫。但很好的發現。感謝分享。 – tmanthey

相關問題