Join FlipAndroid.COM Telegram Group: https://t.me/joinchat/F_aqThGkhwcLzmI49vKAiw


Construyendo ICU con NDK

Durante los últimos días he estado tratando de averiguar cómo implementar la biblioteca de ICU para la compatibilidad con Android. Me puse muy al principio, tratando de compilar fuentes de ICU con NDK. Los conseguí de aquí: https://android.googlesource.com/platform/external/icu/

Lo puse en mi ubicación jni y agregó en mi archivo Android.mk esta línea:

  • Diferencia entre CMake y NDK en el proyecto de estudio android
  • Extraer código de archivo .aar Android
  • Android ICS: intento de error JNI para usar referencia local obsoleta 0x1
  • Carga de una biblioteca nativa para Android mediante Eclipse
  • Construyendo FFMPEG con librtmp para android
  • ¿Cómo asegurar la cadena en la aplicación Android?
  • include $(call all-subdir-makefiles) 

    Y añadido a banderas locales:

     -DSQLITE_ENABLE_ICU 

    Estoy recibiendo un montón de errores al intentar construirlo (en la máquina Windows). Aquí está mi salida:

     c:/ndk/build/core/build-binary.mk:457: warning: overriding commands for target ` "----my android project location----"//obj/local/armeabi/objs/icui1 8n/smpdtfst.o' c:/ndk/build/core/build-binary.mk:457: warning: ignoring old commands for target `"----my android project location----"//obj/local/armeabi/objs/icu i18n/smpdtfst.o' c:/ndk/build/core/build-binary.mk:457: warning: overriding commands for target ` "----my android project location----"//obj/local/armeabi/objs/icui1 8n_static/smpdtfst.o' c:/ndk/build/core/build-binary.mk:457: warning: ignoring old commands for target `"----my android project location----"//obj/local/armeabi/objs/icu i18n_static/smpdtfst.o' [armeabi] Compile thumb : icui18n <= decContext.c [armeabi] Compile thumb : icui18n <= ucln_in.c [armeabi] Compile thumb : icui18n <= ulocdata.c [armeabi] Compile++ thumb: icui18n <= indiancal.cpp [armeabi] Compile++ thumb: icui18n <= dtptngen.cpp [armeabi] Compile thumb : icui18n <= decNumber.c [armeabi] Compile thumb : icui18n <= utmscale.c [armeabi] Compile++ thumb: icui18n <= dtrule.cpp In file included from "----my android project location----"//jni/ic u/icu4c/source/i18n/../common/unicode/unistr.h:31:0, from "----my android project location----"//jni/ic u/icu4c/source/i18n/../common/unicode/locid.h:34, from "----my android project location----"//jni/ic u/icu4c/source/i18n/unicode/calendar.h:37, from "----my android project location----"//jni/ic u/icu4c/source/i18n/indiancal.h:18, from "----my android project location----"//jni/ic u/icu4c/source/i18n/indiancal.cpp:10: "----my android project location----"//jni/icu/icu4c/source/i18n/.. /common/unicode/std_string.h:33:18: fatal error: string: No such file or directo ry #include <string> ^ compilation terminated. make.exe: *** ["----my android project location----"//obj/local/arm eabi/objs/icui18n/indiancal.o] Error 1 make.exe: *** Waiting for unfinished jobs.... In file included from "----my android project location----"//jni/ic u/icu4c/source/i18n/../common/unicode/unistr.h:31:0, from "----my android project location----"//jni/ic u/icu4c/source/i18n/../common/unicode/strenum.h:14, from "----my android project location----"//jni/ic u/icu4c/source/i18n/../common/unicode/uenum.h:24, from "----my android project location----"//jni/ic u/icu4c/source/i18n/unicode/ucal.h:12, from "----my android project location----"//jni/ic u/icu4c/source/i18n/unicode/udat.h:16, from "----my android project location----"//jni/ic u/icu4c/source/i18n/unicode/datefmt.h:26, from "----my android project location----"//jni/ic u/icu4c/source/i18n/dtptngen.cpp:15: "----my android project location----"//jni/icu/icu4c/source/i18n/.. /common/unicode/std_string.h:33:18: fatal error: string: No such file or directo ry #include <string> ^ compilation terminated. make.exe: *** ["----my android project location----"//obj/local/arm eabi/objs/icui18n/dtptngen.o] Error 1 "----my android project location----"//jni/icu/icu4c/source/i18n/dt rule.cpp: In member function 'UBool icu_54::DateTimeRule::operator==(const icu_5 4::DateTimeRule&) const': "----my android project location----"//jni/icu/icu4c/source/i18n/dt rule.cpp:85:22: error: cannot use typeid with -fno-rtti (typeid(*this) == typeid(that) && ^ "----my android project location----"//jni/icu/icu4c/source/i18n/dt rule.cpp:85:38: error: cannot use typeid with -fno-rtti (typeid(*this) == typeid(that) && ^ make.exe: *** ["----my android project location----"//obj/local/arm eabi/objs/icui18n/dtrule.o] Error 1 

    Y aquí está mi archivo principal de Android.mk ubicado en el directorio jni:

     LOCAL_PATH:= $(call my-dir) include $(call all-subdir-makefiles) include $(CLEAR_VARS) LOCAL_MODULE:= sqlitenative LOCAL_SRC_FILES := sqlite3.c sqlite3_native.cpp # NOTE the following flags, # SQLITE_TEMP_STORE=3 causes all TEMP files to go into RAM. and thats the behavior we want # SQLITE_ENABLE_FTS3 enables usage of FTS3 - NOT FTS1 or 2. # SQLITE_DEFAULT_AUTOVACUUM=1 causes the databases to be subject to auto- vacuum # SQLITE_HAS_CODEC enables crypto support for database LOCAL_CFLAGS += -DHAVE_USLEEP=1 \ -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 \ -DSQLITE_THREADSAFE=1 \ -DNDEBUG=1 \ -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 \ -DSQLITE_DEFAULT_AUTOVACUUM=1 \ -DSQLITE_TEMP_STORE=3 \ -DSQLITE_ENABLE_FTS3 \ -DSQLITE_ENABLE_FTS3_PARENTHESIS \ -DSQLITE_ENABLE_COLUMN_METADATA \ -DSQLITE_ENABLE_ICU \ -DHAVE_STRCHRNUL=0 LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog -lc LOCAL_C_INCLUDES += $(call include-path-for, system-core)/cutils LOCAL_SHARED_LIBRARIES += libicuuc \ libicui18n \ libutils LOCAL_SHARED_LIBRARIES += libicuuc-host libicui18n-host LOCAL_STATIC_LIBRARIES := liblog libutils libcutils include $(BUILD_SHARED_LIBRARY) include $(BUILD_HOST_SHARED_LIBRARY) 

  • Android SensorManager extraño cómo remapCoordinateSystem
  • Cómo tomar la captura de la cámara sin una vista previa de un servicio o hilo?
  • ¿Eclipse ADT se Deprecated?
  • Cómo ocultar los recursos de android.R en Android Studio 1.3+ autocomplete
  • Lista de todos los nombres de calles y calles en Google en API
  • Android cómo ejecutarOnUiThread en otra clase?
  • FlipAndroid es un fan de Google para Android, Todo sobre Android Phones, Android Wear, Android Dev y Aplicaciones para Android Aplicaciones.