android,static-libraries,android-ndkRelated issues-Collection of common programming errors


  • Ian Kemp
    java android serialization jackson bson
    My goal is to deserialise a BSON array of documents on Android. When the outer array is anonymous the deserialisation fails (trying to deserialise to CustomObject[].class). When the array is wrapped in an object with a key containing the array it works (deserialising to WrapperObject.class).In JSON the object would look like this:[{“id”:….},{“id”:….},{“id”:….}….]According to the BSON Specification the BSON array is a regular BSON document with integer values for keys. In other words the

  • Roman Mazur
    android ant
    I have a project that uses two independent Android libraries. Each of them contains Android support package, so that ant build fails on ‘dex’ step:[dx] UNEXPECTED TOP-LEVEL EXCEPTION:[dx] java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;[dx] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)[dx] at com.android.dx.dex.file.DexFile.add(DexFile.java:163)[dx] at com.android.dx.command.dexer.

  • user2696615
    android webview scrolling android-4.4
    I am seeing some unexpected behavior when using a WebView in Android 4.4 (build target 18). One one page in particular we have some edit text fields, and to get the soft keyboard to pop up appropriately, we had to use a code snippet similar to the ones described here: https://code.google.com/p/android/issues/detail?id=7189webview.setOnTouchListener(new View.OnTouchListener() {@Overridepublic boolean onTouch(View v, MotionEvent event) {switch (event.getAction()) {case MotionEvent.ACTION_DOWN:cas

  • Mighter
    android google-analytics proguard
    I use Google Analytics V2 library in my project.When I export signed application package from Eclipse I get following output in Console:Proguard returned with error code 1. See consoleWarning: com.google.analytics.tracking.android.FutureApis: can’t find referenced method ‘boolean setReadable(boolean,boolean)’ in class java.io.FileWarning: com.google.analytics.tracking.android.FutureApis: can’t find referenced method ‘boolean setWritable(boolean,boolean)’ in class java.io.FileYou should check if

  • rae1
    android webview
    I’m developing an Android application that uses a WebView to display the login page for Facebook. The page loads beautifully, and I’m able to select the username/password textboxes, but typing in them will not work. That is, they definitely have input focus (they have the orange focus highlight box and a flashing cursor), but typing in them does absolutely nothing. I’m not certain, but I think maybe the form buttons are also playing up – they appear to be simply refreshing the page, rather than

  • EmptyStack
    iphone android objective-c ios layout
    I want to add a subview in the top of my view, I have to recalculate the origin y value for all of other views and re-position them to leave space for the new added view.It is very boring, as I know android have relativelayout or linearlayout can help automatically do that.How to solve this problem easily in ios development?

  • Snoopy Stinson
    android web-services grails ksoap2 android-ksoap2
    As of subject.I run a grails web application, exposing a service as a web-service via the Axis2 plugin (it then makes use of Apache Axis2).Everything’s fine, except that Android running ksoap2 fails when processing http response.The execption message I get is:org.xmlpull.v1.XmlPullParserException: Unexpected token (position:TEXT –MIMEBoundaryur…@4:13 in java.io.InputStreamReader@40fdd958)Now, I investigated a bit and found that my web-app, when answering to a soap-encoded web-service call, re

  • Poovizhirajan.N
    android android-emulator garbage-collection stack-trace android-logcat
    Yesterday it worked perfectly, but today shows a message “unfortunately the app has stopped”, and the logcat shows “shutting down the VM”. Stack Trace of this app..11-27 13:24:17.035: W/Trace(806): Unexpected value from nativeGetEnabledTags: 0 11-27 13:24:17.455: W/Trace(806): Unexpected value from nativeGetEnabledTags: 0 11-27 13:24:17.485: W/Trace(806): Unexpected value from nativeGetEnabledTags: 0 11-27 13:24:17.485: D/AndroidRuntime(806): Shutting down VM 11-27 12:30:51.683: D/AndroidRunti

  • Dhaval Khant
    android in-app-purchase
    I have successfully test product id (i.e android.test.purchased etc.) in my app but I am getting exception with real product id..any help will be appreciate. I have also published inappproduct list with draft application.I am getting Below exception::::11-18 15:33:15.367: E/Volley(20873): [12] BasicNetwork.performRequest: Unexpected response code 500 for https://android.clients.google.com/fdfe/purchase 11-18 15:33:15.378: W/Finsky(20873): [1] CheckoutPurchase.onErrorResponse: DisplayErrorMessag

  • eyecatchUp
    android sed edify
    When you alter any Android system files (apps, libs, conf, recovery etc..) any Over-the-Air (OTA) update will fail, because the updater script checks sha1 hashes and the installer aborts if there’re any mismatches.Specifically it looks somewhat like:ui_print(“Verifying current system…”); apply_patch_check(“/system/app/BasicDreams.apk”, “3cd7485ba69bc6fb6a5bcb78ed2a331c68ffe3eb”, “9c43bf95b1eaed097ad74b15b2ba232d69992175”) || abort(“\”/system/app/BasicDreams.apk\” has unexpected contents.”); ap

  • StevieG
    c++ visual-c++ gcc static-libraries
    I’m compiling a static library that contains mainly templated classes. When this is compiled using gcc, the resulting .a file is around about the 40Mb mark. This is pretty big, but not entirely unexpected due to the amount of templating going on. However, when I compile the same code using VS2005, the resulting .lib file is coming in at (wait for it!) 575Mb..Now, before I get burned, I have seen: How can I get my very large program to link? and this is useful for understanding that templates are

  • Naatan
    php overloading static-libraries
    I’m trying to automate the process of accessing libraries in the framework I use (CodeIgniter) but am running in to some issues.Codeigniter currently loads libraries like this:$this->CI->load->library(‘name’); $this->CI->name->method();Needless to say that this is a whole bunch of code for something that could be achieved with far less.I would like to access my lib like this:_Lib::name->method();The _Lib class will then take care of loading the right lib (or directing the lo

  • Viktor
    c++ ios objective-c c static-libraries
    I have some C++ code (exposing a C-only interface through a header) which I will use for an iOS project.I can either create a static library and link to this from my app project, or add the source files directly to the app project – which option is best?All answers appreciated!

  • Mehrdad
    visual-c++ static-libraries
    I have a class that wraps a file handle:class FileHandle {HANDLE hFile;TCHAR name[256]; public:LPCTSTR getName() const { /*(query system for name)*/ return this->name; } };I have come up with a design choice: Since I will be querying the file name often, in order to minimize heap allocations which would happen if I returned std::wstring (I have repeatedly seen that this is a bottleneck in my programs), I have instead decided to keep a name field inside the object itself, and just return a po

  • Brett Hale
    c osx static-libraries autotools ld
    I am trying to make a static binary on Subsurface on MacOSX, so that we can provide a simple binary download. I’m clueless as to solve the problems I get, but that might just be because I suck at C.Here’s what I do. I have already installed gconf and gtk2 from MacPorts, and I’m building without libusb for simplicity:git clone git://libdivecomputer.git.sourceforge.net/gitroot/libdivecomputer/libdivecomputer cd libdivecomputer autoreconf –install ./configure make LDFLAGS=”-static” sudo make ins

  • Salepate
    c++ c cmake static-libraries
    I’m getting an undefined referenced error, not knowing the reason why.So I have 2 files which makes a static lib : keyboard_input.c, keyboard_input.hHere’s the content of the .h file:#ifndef __MOD_KBINPUT__ #define __MOD_KBINPUT__int kbInit(); int kbWait();int kbTest();#endifAnd the CMakeLists.txt file looks like this:FILE( GLOB_RECURSE sources *.c ) INCLUDE_DIRECTORIES(“${PROJECT_SOURCE_DIR}/include/utils/kbreader”) ADD_LIBRARY(keyboardReader ${sources})Compiling this lib gives some warnings:sr

  • Jeff Atwood
    dll static-libraries
    I know very little about DLL’s and LIB’s other than that they contain vital code required for a program to run properly – libraries. But why do compilers generate them at all? Wouldn’t it be easier to just include all the code in a single executable? And what’s the difference between DLL’s and LIB’s?

  • NumberFour
    c++ mingw visual-c++ compatibility static-libraries
    I have compiled several libraries with MingW/MSYS… the generated static libraries are always .a files. When I try to link the library with a MSVC project, Visual Studio throws ‘unresolved external symbols’ … It means that the .a static library is incompatible with MS C++ Linker. I presume it has to be converted to a MSVC compatible .lib file.Either .a and .lib are just AR archives of .o or .obj files, so is there any way how to use MingW compiled libs in a MSVC project? Or do I have to compi

  • pauldoo
    c++ c windows dll static-libraries
    We have an application written in C/C++ which is broken into a single EXE and multiple DLLs. Each of these DLLs makes use of the same static library (utilities.lib).Any global variable in the utility static library will actually have multiple instances at runtime within the application. There will be one copy of the global variable per module (ie DLL or EXE) that utilities.lib has been linked into.(This is all known and good, but it’s worth going over some background on how static libraries be

  • nall
    iphone objective-c static-libraries categories
    Can you guide me how to properly link static library to iphone project. I use staic library project added to app project as direct dependency (target -> general -> direct dependecies) and all works OK, but categories. A category defined in static library is not working in app. So my question is how to add static library with some categories into other project? And in general, what is best practice to use in app project code from other projects?

  • lost_bits1110
    android android-ndk
    I am following the steps on http://developer.android.com/sdk/ndk/overview.html to build the hello-jni sample, however when I get to Step 2 to runcd $NDK-ROOT/samples/hello-jni $NDK-ROOT/ndk-buildin the Cygwin command prompt, I receive the following error messages:/bin/sh: -c: line 0: unexpected EOF while looking for matching `” /bin/sh: -c: line 1: syntax error: unexpected end of file Android NDK: Host awk tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !I have Cygwin 1.7.9, G

  • oberthelot
    android android-layout android-widget android-ndk android-manifest
    I have this app (Only one activity) that use some android UI and some native C++ lib to do OpenGl drawing and calculation.It seems like the activity creates some “binder thread” on it’s own, and I’m pretty sure it causes some corruption amongs my native calls.What are the binder threads ? Can they be removed or merge into one ?

  • user1608145
    android xml eclipse android-ndk
    The Code:<?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”xmlns:tools=”http://schemas.android.com/tools”android:weightSum=”1″android:layout_width=”match_parent”android:layout_height=”match_parent”android:orientation=”horizontal” ><EditText android:id=”@+id/edit_message”android:layout_weight = “1”android:layout_width=”0dp”android:layout_height=”wrap_content”android:hint=”@string/edit_message” /><Buttonandroid:id=”

  • user2621677
    android-ndk protocol-buffers
    I try to compile ProtoBuf 2.5 with NDK.But when I build ProtoBuf 2.5 in eclipse, I get error info as below in consolebash “E:\\Android\\android-ndk-r8e\\ndk-build.cmd” all E:\Android\android-ndk-r8e\ndk-build.cmd: line 1: @echo: command not found E:\Android\android-ndk-r8e\ndk-build.cmd: line 2: rem: command not found E:\Android\android-ndk-r8e\ndk-build.cmd: line 6: rem: command not found E:\Android\android-ndk-r8e\ndk-build.cmd: line 7: goto: command not found E:\Android\android-ndk-r8e\ndk-b

  • ligi
    android android-ndk
    I am having problems with the latest Android NDK:ligi@ligid:~$ ndk-build /home/ligi/bin/android-ndk/prebuilt/linux-x86/bin/awk: 1: ELF: not found /home/ligi/bin/android-ndk/prebuilt/linux-x86/bin/awk: 4: Syntax error: word unexpected (expecting “)”) Android NDK: Host ‘awk’ tool is outdated. Please define HOST_AWK to point to Gawk or Nawk ! /home/ligi/bin/android-ndk/build/core/init.mk:258: *** Android NDK: Aborting. . Stop.ligi@ligid:~$ `echo $HOST_AWK –v` GNU Awk 3.1.7I am on stock ub

  • ramdroid
    android linux fclose android-ndk freopen
    Following program:#include <stdlib.h> #include <stdio.h> #include <sys/stat.h> #include <sys/types.h>int main() {fclose( stderr );printf( “%d\n”, fileno( stderr ) );return 0; }shows -1 on ubuntu 11.04 and 2 on ICS 4.0.3 emulator. Can’t find any info about this issue – can i make this code work similar on both platforms? freopen on stderr has same problem.Update:Previous small program demonstrates the cause of actual problem i faced with: if i try to freopen stderr to file

  • Mukesh Kumar
    android android-ndk devil
    I have an android app that I want to use DeviL Library for Image processing. I have copied the Devil Library as well as it’s dependant libraries into the JNI folder. I complied successfully and all .so files stored into “libs” folder. However when I try to run the app I get this error07-25 10:37:41.481: D/dalvikvm(1762): Not late-enabling CheckJNI (already on) 07-25 10:37:41.511: E/Trace(1762): error opening trace file: No such file or directory (2) 07-25 10:37:41.511: W/Trace(1762): Unexpected

  • user1145533
    android multithreading android-ndk jni
    I have created a thread in java that does some processing passes the data to legacy C++ using JNI. The C++ code performs some tasks on a separate thread and then returns, at this point I want to callback from JNI into the Java thread rather then the main interface thread. The code seems to build and run without errors, but when CallVoidMethod is called to call back into Java nothing happens, no exceptions or errors, it does seem to invoke the Java code.I am calling AttachCurrentThread which seem

  • zvdh
    android android-ndk ffmpeg cygwin
    I want to compile ffmpeg on windows with cygwin and android ndk. I found this link very useful because there is step to step guide to compile ffmpeg.Does anyone find this useful? – Compiling FFMPEG on Windows with Cywin and NDK r5But at last point when i am going to create .so file i got this error in cygwin bash.CONSOLE OUTPUT:vikram mahal@vikrammahal-PC ~ $ cd /cygdrive/c/ffmpeg-0.10.3 vikram mahal@vikrammahal-PC /cygdrive/c/ffmpeg-0.10.3 $ dos2unix build_android.sh dos2unix: converting file b

  • Rick Smith
    android windows android-ndk ffmpeg cygwin
    I want to compile ffmpeg for using in android. When i use “make” command,one error show as below:arm-linux-androideabi/bin/ld.exe: error: libavdevice/libavdevice.so:1:1: syntax error, unexpected ‘!’, expecting $endHow can i fix it.

Web site is in building