Announcement

Collapse
No announcement yet.

[Android SDK] Unable to create shared library for any sample project

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Android SDK] Unable to create shared library for any sample project

    Hi,

    I am using Android SDK 2.1. and NDK r9b (64-bit)
    I have done the setup properly for ndk and foxit.

    For any sample project when i run ndk-build -B, i always get following error. Not sure how to resolve this. Can you please assist.

    Thanks and Best Regards,
    Ashwani Kr Sharma

    C:\AndroidKit\FoxIt\SDKforAndroid2_1\examples\demo s\demo_view_scrolling>ndk-build -B
    Android NDK: WARNING:jni/Android.mk:fpdfembedsdk: non-system libraries in linker flags: ../bin/libfpdfemb_android.a
    Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
    Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
    Android NDK: current module
    [armeabi] Compile++ thumb: fpdfembedsdk <= FoxitEMBSDK_EMBJavaSupport.cpp
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp: In function 'FS_RESULT FileFlush(FS_LPVOID)':
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:157:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'FS_LPVOID {aka void*}' [-Wformat]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp: In function 'FS_RESULT FileWriterBlock(FS_LPVOID, void const*, FS_DWORD, FS_DWORD)':
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:179:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'FS_LPVOID {aka void*}' [-Wformat]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:179:2: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'void const*' [-Wformat]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp: In static member function 'static void CPDF_PSI::SetEnv(JNIEnv*)':
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:439:3: warning: format '%i' expects argument of type 'int', but argument 4 has type 'JNIEnv* {aka _JNIEnv*}' [-Wformat]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp: In static member function 'static void CPDF_PSI::SetObject(jobject)':
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:445:3: warning: format '%i' expects argument of type 'int', but argument 4 has type 'jobject {aka _jobject*}' [-Wformat]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp: In static member function 'static void CPDF_PSI::FPSI_Invalidate(void*, FS_INT32, FS_INT32, FS_INT32, FS_INT32)':
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:450:3: warning: format '%i' expects argument of type 'int', but argument 4 has type 'jobject {aka _jobject*}' [-Wformat]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:450:3: warning: format '%i' expects argument of type 'int', but argument 5 has type 'JNIEnv* {aka _JNIEnv*}' [-Wformat]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp: In static member function 'static FS_FLOAT CPDF_PSI::FPSI_GetOpacity(void*)':
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:468:3: warning: format '%i' expects argument of type 'int', but argument 4 has type 'jobject {aka _jobject*}' [-Wformat]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:468:3: warning: format '%i' expects argument of type 'int', but argument 5 has type 'void*' [-Wformat]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp: In function '_jbyteArray* Java_FoxitEMBSDK_EMBJavaSupport_FSBitmapGetBuffer( JNIEnv*, jclass, jint)':
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:1107:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'void*' [-Wformat]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp: In function 'jint Java_FoxitEMBSDK_EMBJavaSupport_FSFileReadAlloc(JN IEnv*, jclass, jstring)':
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:1182:38: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp: In function 'jint Java_FoxitEMBSDK_EMBJavaSupport_FSPauseHandlerAllo c(JNIEnv*, jclass)':
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:1216:38: warning: converting to non-pointer type 'int' from NULL [-Wconversion-null]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp: In function 'FS_BOOL MyMapFont(FS_LPVOID, FS_LPCSTR, FS_INT32, FS_DWORD, FS_INT32, FS_CHAR*, FS_INT32*)':
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:2228:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'FS_LPVOID {aka void*}' [-Wformat]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp: In function 'jint Java_FoxitEMBSDK_EMBJavaSupport_FSFileWriteAlloc(J NIEnv*, jclass, jstring)':
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:2657:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'void*' [-Wformat]
    jni/../../jni/FoxitEMBSDK_EMBJavaSupport.cpp:2660:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'void*' [-Wformat]
    [armeabi] SharedLibrary : libfpdfembedsdk.so
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'std::exception::exception()'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'vtable for std::exception'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'std::exception::exception()'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'std::exception::~exception()'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'std::exception::~exception()'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'std::bad_exception::bad_exception()'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'vtable for std::bad_exception'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'std::bad_exception::bad_exception()'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'std::bad_exception::~bad_exception()'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'std::bad_exception::~bad_exception()'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'std::exception::what() const'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'std::bad_exception::what() const'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'std::exception::~exception()'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'std::bad_exception::~bad_exception()'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'typeinfo name for std::bad_exception'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'typeinfo for std::bad_exception'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'typeinfo name for std::exception'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: error: ../bin/libfpdfemb_android.a(dll_main.o): mu
    ltiple definition of 'typeinfo for std::exception'
    C:/AndroidKit/adt-bundle/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: C:/AndroidKit/adt-bundle/ndk/sources/cxx-stl/stlpo
    rt/libs/armeabi/libstlport_static.a(exception.o): previous definition here
    collect2: ld returned 1 exit status
    Last edited by ashw.kumar; 11-19-2013, 07:39 AM.

  • #2
    Hi,

    I was able to fix above issue.
    I commented outed "#APP_STL := stlport_static" in Application.mk. and run the ndk-build -B.

    But now the PDF is not getting loaded and it always return 0 pages.
    Not sure what i am missing now. I am attaching the log files to the comment.

    Waiting for your expert comments\solution.

    Regards,
    Ashwani Kr Sharma
    Attached Files

    Comment


    • #3
      Hi,

      Second obstacle also removed now.
      I missed to specify the serial key in code.

      Regards,
      Ashwani Kr Sharma

      Comment


      • #4
        _________________________________________________
        http://nutribulletrecipebook.com
        Last edited by Bryon865; 12-27-2014, 11:47 AM.

        Comment


        • #5
          Thanks indeed for this information. Really appreciate that.

          Comment


          • #6
            This information is very constructive for correct planning. I like your work for providing information to the other.

            Comment


            • #7
              Dear All,

              If the support in the forums is not enough, please submit a support case to http://tickets.foxitsoftware.com/ticket.php

              Sincerely,
              Huy

              Comment

              Working...
              X