RenderScript code not working without rsDebug - android

I'm completely new to RenderScript. I was trying to get a simple example shown by Romain Guy in http://www.youtube.com/watch?v=5jz0kSuR2j4 working.
First off, here's the code.
MainActivity.java
package com.example.rsgray;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.renderscript.Allocation;
import android.renderscript.RenderScript;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
public class MainActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
ImageView iv = new ImageView(this);
iv.setScaleType(ScaleType.CENTER_CROP);
setContentView(iv);
drawGrayScale(iv, R.drawable.tulips);
}
private void drawGrayScale(ImageView iv, int image) {
Bitmap in = BitmapFactory.decodeResource(getResources(), image);
Bitmap out = Bitmap.createBitmap(in.getWidth(), in.getHeight(), in.getConfig());
RenderScript rs = RenderScript.create(MainActivity.this);
Allocation inAlloc = Allocation.createFromBitmap(rs, in);
Allocation outAlloc = Allocation.createTyped(rs, inAlloc.getType());
ScriptC_gray script = new ScriptC_gray(rs, getResources(), R.raw.gray);
script.set_in(inAlloc);
script.set_out(outAlloc);
script.set_script(script);
script.invoke_filter();
outAlloc.copyTo(out);
iv.setImageBitmap(out);
}
}
gray.rs
#pragma version(1)
#pragma rs java_package_name(com.example.rsgray)
#pragma rs_fp_relaxed
rs_allocation in;
rs_allocation out;
rs_script script;
const static float3 gray = { 0.3f, 0.6f, 0.1f };
void root(const uchar4* v_in, uchar4* v_out, const void* usrData, uint32_t x, uint32_t y) {
rsDebug("gray.rs", rsUptimeMillis());
float4 inPixel = rsUnpackColor8888(*v_in);
float3 result = dot(inPixel.rgb, gray);
*v_out = rsPackColorTo8888(result);
}
void filter() {
rsForEach(script, in, out);
}
and finally, AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.rsgray"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="16" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.rsgray.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
res/drawable-nodpi contains tulips.jpg. You won't find the rsDebug() statement that I've added in gray.rs in Romain Guy's code.
Anyway, the code compiles, with or without rsDebug(). However, the problem starts when I try to run the app on a device.
I tried to run the app on my Nexus 4 running Android 4.4. With the code as shown, it works fine and I get a greyscale image. However, if I comment out the rsDebug() line, the app does not work. I just get a black screen.
Here is the logcat output.
With rsDebug() :
11-26 16:22:41.563: D/dalvikvm(21523): GC_FOR_ALLOC freed 69K, 2% free 9046K/9148K, paused 16ms, total 16ms
11-26 16:22:41.573: I/dalvikvm-heap(21523): Grow heap (frag case) to 11.862MB for 3145744-byte allocation
11-26 16:22:41.603: D/dalvikvm(21523): GC_FOR_ALLOC freed <1K, 1% free 12118K/12224K, paused 30ms, total 30ms
11-26 16:22:41.683: D/dalvikvm(21523): GC_FOR_ALLOC freed <1K, 1% free 12117K/12224K, paused 11ms, total 11ms
11-26 16:22:41.693: I/dalvikvm-heap(21523): Grow heap (frag case) to 14.862MB for 3145744-byte allocation
11-26 16:22:41.703: D/dalvikvm(21523): GC_FOR_ALLOC freed 0K, 1% free 15189K/15300K, paused 14ms, total 14ms
11-26 16:22:41.753: V/RenderScript(21523): 0x74ed5020 Launching thread(s), CPUs 4
11-26 16:22:41.753: W/Adreno-RS(21523): <rsdVendorAllocationDestroyQCOM:194>: rsdVendorAllocationDestroy: No context!
11-26 16:22:41.753: E/RenderScript(21523): Successfully loaded runtime: libRSDriver_adreno.so
11-26 16:22:41.783: D/dalvikvm(21523): GC_FOR_ALLOC freed <1K, 1% free 15201K/15300K, paused 11ms, total 11ms
11-26 16:22:41.803: D/dalvikvm(21523): GC_FOR_ALLOC freed <1K, 1% free 15202K/15300K, paused 11ms, total 12ms
11-26 16:22:41.813: W/Adreno-RS(21523): <rsdCompileBitcode:289>: Header check (bitcode_SHA1) failed for /data/data/com.example.rsgray/cache/com.android.renderscript.cache/gray-adreno.meta
11-26 16:22:41.813: W/Adreno-RS(21523): <rsdDumpCompileLog:499>: Build log for gray: RS code uses long(i64) data type
11-26 16:22:41.813: W/Adreno-RS(21523): RS bitcode does not contain an invokable compute root
11-26 16:22:41.813: W/Adreno-RS(21523): <rsdVendorScriptInitQCOM:610>: ERROR: __BuildProgram returned -11
11-26 16:22:41.813: D/RenderScript(21523): long gray.rs 18142906 0x114d6ba
11-26 16:22:41.813: D/RenderScript(21523): long gray.rs 18142906 0x114d6ba
11-26 16:22:41.813: D/RenderScript(21523): long gray.rs 18142906 0x114d6ba
11-26 16:22:41.813: D/RenderScript(21523): long gray.rs 18142906 0x114d6ba
.
. a million more such lines
.
11-26 16:22:44.686: D/RenderScript(21523): long gray.rs 18145771 0x114e1eb
11-26 16:22:44.686: D/RenderScript(21523): long gray.rs 18145771 0x114e1eb
11-26 16:22:44.686: D/RenderScript(21523): long gray.rs 18145771 0x114e1eb
11-26 16:22:44.686: D/RenderScript(21523): long gray.rs 18145771 0x114e1eb
11-26 16:22:44.717: I/Adreno-EGL(21523): <qeglDrvAPI_eglInitialize:320>: EGL 1.4 QUALCOMM build: (CL3776187)
11-26 16:22:44.717: I/Adreno-EGL(21523): OpenGL ES Shader Compiler Version:
11-26 16:22:44.717: I/Adreno-EGL(21523): Build Date: 10/15/13 Tue
11-26 16:22:44.717: I/Adreno-EGL(21523): Local Branch:
11-26 16:22:44.717: I/Adreno-EGL(21523): Remote Branch: partner/upstream
11-26 16:22:44.717: I/Adreno-EGL(21523): Local Patches:
11-26 16:22:44.717: I/Adreno-EGL(21523): Reconstruct Branch:
11-26 16:22:44.747: D/OpenGLRenderer(21523): Enabling debug mode 0
Without rsDebug() :
11-26 16:23:41.327: D/dalvikvm(21902): GC_FOR_ALLOC freed 56K, 1% free 9046K/9136K, paused 18ms, total 18ms
11-26 16:23:41.337: I/dalvikvm-heap(21902): Grow heap (frag case) to 11.862MB for 3145744-byte allocation
11-26 16:23:41.367: D/dalvikvm(21902): GC_FOR_ALLOC freed <1K, 1% free 12118K/12212K, paused 27ms, total 27ms
11-26 16:23:41.427: D/dalvikvm(21902): GC_FOR_ALLOC freed <1K, 1% free 12117K/12212K, paused 11ms, total 11ms
11-26 16:23:41.437: I/dalvikvm-heap(21902): Grow heap (frag case) to 14.862MB for 3145744-byte allocation
11-26 16:23:41.447: D/dalvikvm(21902): GC_FOR_ALLOC freed 0K, 1% free 15189K/15288K, paused 12ms, total 12ms
11-26 16:23:41.477: V/RenderScript(21902): 0x74ed4f18 Launching thread(s), CPUs 4
11-26 16:23:41.477: W/Adreno-RS(21902): <rsdVendorAllocationDestroyQCOM:194>: rsdVendorAllocationDestroy: No context!
11-26 16:23:41.477: E/RenderScript(21902): Successfully loaded runtime: libRSDriver_adreno.so
11-26 16:23:41.507: D/dalvikvm(21902): GC_FOR_ALLOC freed <1K, 1% free 15201K/15288K, paused 12ms, total 13ms
11-26 16:23:41.527: D/dalvikvm(21902): GC_FOR_ALLOC freed <1K, 1% free 15202K/15288K, paused 12ms, total 12ms
11-26 16:23:41.537: D/bcc(21902): Cache /data/data/com.example.rsgray/cache/com.android.renderscript.cache/gray.o.info is dirty due to the source it dependends on has been changed:
11-26 16:23:43.419: I/Adreno-EGL(21902): <qeglDrvAPI_eglInitialize:320>: EGL 1.4 QUALCOMM build: (CL3776187)
11-26 16:23:43.419: I/Adreno-EGL(21902): OpenGL ES Shader Compiler Version:
11-26 16:23:43.419: I/Adreno-EGL(21902): Build Date: 10/15/13 Tue
11-26 16:23:43.419: I/Adreno-EGL(21902): Local Branch:
11-26 16:23:43.419: I/Adreno-EGL(21902): Remote Branch: partner/upstream
11-26 16:23:43.419: I/Adreno-EGL(21902): Local Patches:
11-26 16:23:43.419: I/Adreno-EGL(21902): Reconstruct Branch:
11-26 16:23:43.449: D/OpenGLRenderer(21902): Enabling debug mode 0
I can not understand how a debug statement can affect the way in which the app runs. Any help on why I'm facing this problem would be much appreciated.
So that's the first part of my problem.
The second part : When I try to run the exact same code on the Galaxy Note 10.1 N8013 running Android 4.1.2 and on another piece of hardware with the APQ8064, also running Android 4.1.2, the app does not work.
Here's the logcat output with my hardware :
01-02 00:00:51.043: E/Trace(1684): error opening trace file: No such file or directory (2)
01-02 00:00:51.043: D/ActivityThread(1684): setTargetHeapUtilization:0.25
01-02 00:00:51.043: D/ActivityThread(1684): setTargetHeapIdealFree:8388608
01-02 00:00:51.053: D/ActivityThread(1684): setTargetHeapConcurrentStart:2097152
01-02 00:00:51.183: V/RenderScript(1684): rsContextCreate dev=0x7276fdd0
01-02 00:00:51.183: V/RenderScript(1684): 0x616350e0 Launching thread(s), CPUs 4
01-02 00:00:51.203: V/ScriptC(1684): Create script for resource = gray
01-02 00:00:51.203: E/bcc(1684): CPU is krait2
01-02 00:00:51.274: W/bcc(1684): Unable to open /data/data/com.example.rsgray/cache/com.android.renderscript.cache/gray.o in read mode. (reason: No such file or directory)
01-02 00:00:51.404: A/libc(1684): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 1701 (.example.rsgray)
And finally, here's the logcat output with the Samsung tablet :
01-02 10:34:47.470: D/dalvikvm(19022): GC_FOR_ALLOC freed 48K, 11% free 7046K/7875K, paused 13ms, total 13ms
01-02 10:34:47.475: I/dalvikvm-heap(19022): Grow heap (frag case) to 10.495MB for 3145744-byte allocation
01-02 10:34:47.495: D/dalvikvm(19022): GC_CONCURRENT freed <1K, 9% free 10117K/11015K, paused 11ms+1ms, total 18ms
01-02 10:34:47.585: D/dalvikvm(19022): GC_FOR_ALLOC freed <1K, 9% free 10117K/11015K, paused 10ms, total 10ms
01-02 10:34:47.590: I/dalvikvm-heap(19022): Grow heap (frag case) to 13.494MB for 3145744-byte allocation
01-02 10:34:47.610: D/dalvikvm(19022): GC_CONCURRENT freed <1K, 7% free 13189K/14151K, paused 11ms+3ms, total 23ms
01-02 10:34:47.610: D/dalvikvm(19022): WAIT_FOR_CONCURRENT_GC blocked 12ms
01-02 10:34:47.610: V/RenderScript(19022): rsContextCreate dev=0x40e3b288
01-02 10:34:47.615: V/RenderScript(19022): 0x411e3008 Launching thread(s), CPUs 3
01-02 10:34:47.625: V/ScriptC(19022): Create script for resource = gray
01-02 10:34:47.625: I/bcc(19022): LIBBCC build time: 2013/01/09 23:19:52
01-02 10:34:47.625: I/bcc(19022): LIBBCC build revision: Unknown (not git)
01-02 10:34:47.645: D/StopWatch(19022): StopWatch calcFileSHA1 time (us): 17719
01-02 10:34:47.650: D/StopWatch(19022): StopWatch calcFileSHA1 time (us): 3031
01-02 10:34:47.650: W/bcc(19022): Unable to open file in read mode. (reason: No such file or directory)
01-02 10:34:47.750: A/libc(19022): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 19053 (.example.rsgray)
That's about it. If anyone has any idea how to interpret this, please do let me know.
Thanks!

I've just encountered the same issue. It seems to be fixed when rsDebug is somewhere in the same function. This fixed it for me:
if(x > 0) {
if(x < 0) {
rsDebug("Workaround for renderscript bug", 0.0f);
}
/* Code */
}
Using this, rsDebug is never actually called, so it will not output anything.
Note this does not work:
if(0) {
rsDebug("Workaround for renderscript bug", 0.0f);
}
This is probably optimized out.

Related

Getting Fatal Signal 11 error

I am making a SIP client using PortSIP library made based on AndroidSIPSample project. I get the following error:
01-09 02:00:52.730: A/libc(750): Fatal signal 11 (SIGSEGV) at 0x00000c0d (code=1), thread 750 (ovative.innovox)
The error is not coming when I am running AndroidSIPSample project downloaded from PortSIP website.
Following is my logcat output:
01-09 02:00:47.910: D/dalvikvm(750): Trying to load lib /data/app-lib/in.innovative.innovox-2/libportsipcore.so 0x416fc190
01-09 02:00:47.981: D/dalvikvm(750): Added shared lib /data/app-lib/in.innovative.innovox-2/libportsipcore.so 0x416fc190
01-09 02:00:48.400: D/dalvikvm(750): GC_FOR_ALLOC freed 63K, 8% free 2656K/2876K, paused 81ms, total 91ms
01-09 02:00:48.432: I/dalvikvm-heap(750): Grow heap (frag case) to 5.087MB for 2457616-byte allocation
01-09 02:00:48.510: D/dalvikvm(750): GC_FOR_ALLOC freed 2K, 5% free 5053K/5280K, paused 70ms, total 70ms
01-09 02:00:49.530: D/dalvikvm(750): GC_FOR_ALLOC freed 28K, 4% free 5351K/5540K, paused 53ms, total 57ms
01-09 02:00:49.550: I/dalvikvm-heap(750): Grow heap (frag case) to 6.451MB for 1127536-byte allocation
01-09 02:00:49.630: D/dalvikvm(750): GC_FOR_ALLOC freed 1K, 3% free 6450K/6644K, paused 73ms, total 73ms
01-09 02:00:51.990: I/Choreographer(750): Skipped 167 frames! The application may be doing too much work on its main thread.
01-09 02:00:52.010: D/gralloc_goldfish(750): Emulator without GPU emulation detected.
01-09 02:00:52.730: A/libc(750): Fatal signal 11 (SIGSEGV) at 0x00000c0d (code=1), thread 750 (ovative.innovox)
I don't know what is causing it, I even put images in xhdpi drawable folder for xhdpi devices according to this answer. But still getting the error.
Please help me solve this error.
I was getting the error because I was passing wrong argument to a method of the PortSIP library, so because of that the library was throwing error.

App flicks or twinkles at some point on android 4.2.2

I have spent long time on this, this is driving me craze.
My app works all fine on android 4.1 and below. But it have a big problem running on android 4.2.2
At some point the app just start a endless flicking or twinkling, until it eat up all memory of the phone, then the phone died.
I have no idea where this problem is triggered, i don't know which line of code cause this strange problem. Because it has not bad log at all, it runs from onCreate to the final line of onResume and its all fine, but after that it just jumped in to onDestroy automatically, then run into onCreate again, it's an endless loop.
During the loops, all logs i have got is like this:
11-26 16:48:56.497 1491-1491/com.efergy.module W/EGL_emulation﹕ eglSurfaceAttrib not implemented
11-26 16:48:56.545 1491-1491/com.efergy.module D/dalvikvm﹕ GC_EXPLICIT freed 212K, 47% free 18253K/34312K, paused 1ms+0ms, total 6ms
11-26 16:48:56.549 1491-1491/com.efergy.module D/dalvikvm﹕ GC_EXPLICIT freed 6K, 47% free 18251K/34312K, paused 1ms+0ms, total 6ms
11-26 16:48:56.565 1491-1491/com.efergy.module D/dalvikvm﹕ GC_EXPLICIT freed 259K, 47% free 18505K/34312K, paused 0ms+1ms, total 4ms
11-26 16:48:56.593 1491-1491/com.efergy.module W/EGL_emulation﹕ eglSurfaceAttrib not implemented
11-26 16:48:56.649 1491-1491/com.efergy.module D/dalvikvm﹕ GC_EXPLICIT freed 269K, 47% free 18253K/34312K, paused 0ms+1ms, total 6ms
11-26 16:48:56.661 1491-1491/com.efergy.module D/dalvikvm﹕ GC_EXPLICIT freed 6K, 47% free 18251K/34312K, paused 0ms+1ms, total 7ms
11-26 16:48:56.673 1491-1491/com.efergy.module D/dalvikvm﹕ GC_EXPLICIT freed 244K, 47% free 18448K/34312K, paused 1ms+1ms, total 7ms
11-26 16:48:56.705 1491-1491/com.efergy.module W/EGL_emulation﹕ eglSurfaceAttrib not implemented
11-26 16:48:56.753 1491-1491/com.efergy.module D/dalvikvm﹕ GC_EXPLICIT freed 213K, 47% free 18254K/34312K, paused 0ms+0ms, total 5ms
11-26 16:48:56.761 1491-1491/com.efergy.module D/dalvikvm﹕ GC_EXPLICIT freed 6K, 47% free 18251K/34312K, paused 0ms+1ms, total 7ms
11-26 16:48:56.773 1491-1491/com.efergy.module D/dalvikvm﹕ GC_EXPLICIT freed 259K, 47% free 18505K/34312K, paused 0ms+0ms, total 5ms
11-26 16:48:56.793 1491-1491/com.efergy.module W/EGL_emulation﹕ eglSurfaceAttrib not implemented
Any words or recommendations to help me find out where the problem is are appreciated.
Thanks in advance.
Finally i solved this problem by myself.
In my case, it caused by the abuse of
updateConfiguration()
i use it to manage language in each activity inside
onConfigurationChanged()
Once the change of the orientation triggered the onConfigurationChanged(), inside it will call updateConfiguration() which will trigger onConfigurationChanged() again, that will running into an endless loop.
So carefully review your use of these two functions, you will find something.

GPS updates aren't called

I want to receive updates from GPS, but i can't. Method onLocationChanged isn't calling. In this application i using Google Maps API, too. I don't know, maybe it is some cause of my problems.
It's code about GPS in MainActivity:
LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
final LocationListener locationListener = new LocationListener() {
public void onLocationChanged(Location location)
{
txtLat.setText("Latitude: " + String.valueOf((int)(location.getLatitude())) + ","
+ String.valueOf(((location.getLatitude() * 100) % 100)) + " degrees");
txtLong.setText("Longtitude: " + String.valueOf((int)(location.getLongitude())) + ","
+ String.valueOf(((location.getLongitude() * 100) % 100)) + " degrees");
}
public void onStatusChanged(String provider, int status, Bundle extras) {}
public void onProviderEnabled(String provider) {}
public void onProviderDisabled(String provider) {}
};
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
and in Manifest i have declared these permissions:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
and other that Google Maps API v2 required
EDIT:
LogCat:
06-27 14:25:28.785: D/dalvikvm(5206): GC_FOR_ALLOC freed 42K, 8% free 2500K/2716K, paused 42ms, total 48ms
06-27 14:25:28.836: I/dalvikvm-heap(5206): Grow heap (frag case) to 6.147MB for 3712016-byte allocation
06-27 14:25:28.906: D/dalvikvm(5206): GC_FOR_ALLOC freed 2K, 4% free 6122K/6344K, paused 64ms, total 64ms
06-27 14:25:28.965: D/dalvikvm(5206): GC_CONCURRENT freed <1K, 4% free 6122K/6344K, paused 8ms+5ms, total 66ms
06-27 14:25:29.595: D/dalvikvm(5206): GC_CONCURRENT freed 3766K, 53% free 3523K/7464K, paused 24ms+46ms, total 149ms
06-27 14:25:30.025: D/dalvikvm(5206): GC_CONCURRENT freed 243K, 51% free 3681K/7464K, paused 5ms+5ms, total 52ms
06-27 14:25:30.045: E/Google Maps Android API(5206): Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above
06-27 14:25:30.385: D/dalvikvm(5206): GC_FOR_ALLOC freed 146K, 49% free 3826K/7464K, paused 39ms, total 40ms
06-27 14:25:30.685: D/dalvikvm(5206): GC_CONCURRENT freed 82K, 44% free 4234K/7464K, paused 16ms+26ms, total 133ms
06-27 14:25:31.066: D/libEGL(5206): Emulator without GPU support detected. Fallback to software renderer.
06-27 14:25:31.095: I/Choreographer(5206): Skipped 77 frames! The application may be doing too much work on its main thread.
06-27 14:25:31.115: D/libEGL(5206): loaded /system/lib/egl/libGLES_android.so
06-27 14:25:31.175: D/gralloc_goldfish(5206): Emulator without GPU emulation detected.
06-27 14:25:31.819: D/dalvikvm(5206): GC_CONCURRENT freed 402K, 41% free 4428K/7464K, paused 30ms+60ms, total 386ms
06-27 14:25:31.915: D/dalvikvm(5206): WAIT_FOR_CONCURRENT_GC blocked 428ms
06-27 14:25:32.427: D/dalvikvm(5206): GC_CONCURRENT freed 630K, 41% free 4429K/7464K, paused 31ms+18ms, total 100ms
06-27 14:25:32.427: D/dalvikvm(5206): WAIT_FOR_CONCURRENT_GC blocked 59ms
06-27 14:33:03.695: E/Trace(5381): error opening trace file: No such file or directory (2)
06-27 14:33:04.395: D/dalvikvm(5381): GC_FOR_ALLOC freed 46K, 9% free 2500K/2720K, paused 42ms, total 45ms
06-27 14:33:04.435: I/dalvikvm-heap(5381): Grow heap (frag case) to 6.147MB for 3712016-byte allocation
06-27 14:33:04.485: D/dalvikvm(5381): GC_FOR_ALLOC freed 2K, 4% free 6122K/6348K, paused 43ms, total 44ms
06-27 14:33:04.555: D/dalvikvm(5381): GC_CONCURRENT freed <1K, 4% free 6122K/6348K, paused 5ms+5ms, total 70ms
06-27 14:33:05.235: D/dalvikvm(5381): GC_CONCURRENT freed 3774K, 53% free 3500K/7448K, paused 20ms+84ms, total 157ms
06-27 14:33:05.615: D/dalvikvm(5381): GC_CONCURRENT freed 232K, 51% free 3663K/7448K, paused 72ms+5ms, total 118ms
06-27 14:33:05.645: E/Google Maps Android API(5381): Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above
06-27 14:33:05.875: D/dalvikvm(5381): GC_FOR_ALLOC freed 190K, 49% free 3847K/7448K, paused 39ms, total 40ms
06-27 14:33:06.268: D/dalvikvm(5381): GC_CONCURRENT freed 62K, 44% free 4223K/7448K, paused 71ms+77ms, total 284ms
06-27 14:33:06.815: D/libEGL(5381): Emulator without GPU support detected. Fallback to software renderer.
06-27 14:33:06.865: D/libEGL(5381): loaded /system/lib/egl/libGLES_android.so
06-27 14:33:06.906: I/Choreographer(5381): Skipped 120 frames! The application may be doing too much work on its main thread.
06-27 14:33:07.005: D/gralloc_goldfish(5381): Emulator without GPU emulation detected.
06-27 14:33:07.455: I/Choreographer(5381): Skipped 38 frames! The application may be doing too much work on its main thread.
06-27 14:33:07.545: D/dalvikvm(5381): GC_CONCURRENT freed 381K, 41% free 4427K/7448K, paused 8ms+111ms, total 349ms
06-27 14:33:07.545: D/dalvikvm(5381): WAIT_FOR_CONCURRENT_GC blocked 237ms
06-27 14:33:08.246: D/dalvikvm(5381): GC_CONCURRENT freed 630K, 41% free 4430K/7448K, paused 72ms+7ms, total 171ms
06-27 14:33:08.246: D/dalvikvm(5381): WAIT_FOR_CONCURRENT_GC blocked 32ms
If you're attempting to retrieve the location using the GPS provider, and you're inside a building or have lousy GPS reception, the onLocationChanged will never be called.
There will be no automatic fallback to Wifi or celltower.
Always check what kind of provider you are using, even when specifying criteria.
Google has released a bunch of new Location APIs through Google Play Services that offers more efficient ways of retrieving user location (improving accuracy and battery-life).
I suggest you take a look at those and follow the Retrieving the Current Location tutorial (it includes a sample app that you can download).

Testing activesync with android virtual devices

I am trying to setup a android virtual device to test syncing with an activesync-server.
I followed these steps:
The problem is that syncing is not working at all, but there are no errors like connection errors ...
IMO the problem is that the virtual device only has a private IP, so the server never can send anything to it?
So I probably need some kind of forwarding, like here:
But I am not sure if that’s correct and I am also not sure which ports should be forwarded.
Here is the logcat, when I want to sync:
W/InputMethodManagerService( 148): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#41302038 attribute=null
I/Choreographer( 274): Skipped 41 frames! The application may be doing too much work on its main thread.
D/dalvikvm( 477): GC_CONCURRENT freed 396K, 6% free 8392K/8903K, paused 15ms+7ms, total 527ms
D/dalvikvm( 274): GC_CONCURRENT freed 360K, 11% free 9493K/10567K, paused 29ms+48ms, total 142ms
I/EAS ContactsSyncAdapterService( 477): Contact sync requested for test#example.com
D/dalvikvm( 148): GREF has increased to 601
D/dalvikvm( 477): WAIT_FOR_CONCURRENT_GC blocked 0ms
I/Choreographer( 274): Skipped 33 frames! The application may be doing too much work on its main thread.
D/dalvikvm( 477): GC_EXPLICIT freed 333K, 7% free 8355K/8903K, paused 78ms+32ms, total 1269ms
I/EAS EmailSyncAdapterService( 477): performSync
I/EAS EmailSyncAdapterService( 477): Mail sync requested for test#example.com
D/dalvikvm( 460): WAIT_FOR_CONCURRENT_GC blocked 0ms
D/dalvikvm( 460): GC_EXPLICIT freed 216K, 5% free 8483K/8839K, paused 145ms+94ms, total 914ms
D/dalvikvm( 148): WAIT_FOR_CONCURRENT_GC blocked 0ms
D/dalvikvm( 148): GC_EXPLICIT freed 510K, 7% free 11338K/12167K, paused 8ms+35ms, total 323ms
D/dalvikvm( 274): GC_CONCURRENT freed 415K, 11% free 9486K/10567K, paused 25ms+28ms, total 125ms
E/Inbox[test#example.com]( 477): Uncaught exception in EasSyncServicejava.lang.ArrayIndexOutOfBoundsException: length=32; index=32
E/Inbox[test#example.com]( 477): Sync ended due to an exception.
D/dalvikvm( 477): GC_CONCURRENT freed 376K, 6% free 8420K/8903K, paused 5ms+18ms, total 66ms
I don't think this is a problem with your networking setup. It looks like you have an error in your Sync code, that is causing the process to stop:
E/Inboxtest#example.com: Uncaught exception in EasSyncServicejava.lang.ArrayIndexOutOfBoundsException: length=32; index=32
E/Inboxtest#example.com: Sync ended due to an exception.
>
Wrap this code in a try/catch block to understand what is happening better.

SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

Can someone explain this error?
"SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length".
I think it concerns with editText. Is there a solution for it?
This is my log.
1-07 14:29:47.654: D/OpenGLRenderer(24479): Enabling debug mode 0
01-07 14:30:36.954: E/SensorManager(24479): thread start
01-07 14:30:36.959: D/SensorManager(24479): registerListener :: handle = 0 name= LSM330DLC 3-axis Accelerometer delay= 200000 Listener=
android.view.OrientationEventListener$SensorEventListenerImpl#43000e98
01-07 14:30:37.139: E/SpannableStringBuilder(24479): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
01-07 14:30:37.139: E/SpannableStringBuilder(24479): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
01-07 14:30:37.419: I/Process(24479): Sending signal. PID: 24479 SIG: 9
01-07 14:30:37.654: E/Trace(25014): error opening trace file: No such file or directory (2)
01-07 14:30:37.754: D/dalvikvm(25014): GC_FOR_ALLOC freed 108K, 6% free 12258K/12931K, paused 15ms, total 16ms
01-07 14:30:37.754: I/dalvikvm-heap(25014): Grow heap (frag case) to 14.860MB for 2457616-byte allocation
01-07 14:30:37.779: D/dalvikvm(25014): GC_CONCURRENT freed 6K, 5% free 14651K/15367K, paused 12ms+2ms, total 23ms
01-07 14:30:37.809: D/dalvikvm(25014): GC_FOR_ALLOC freed 0K, 5% free 14651K/15367K, paused 11ms, total 11ms
01-07 14:30:37.819: I/dalvikvm-heap(25014): Grow heap (frag case) to 19.018MB for 4367376-byte allocation
01-07 14:30:37.834: D/dalvikvm(25014): GC_CONCURRENT freed 0K, 4% free 18917K/19655K, paused 2ms+2ms, total 16ms
01-07 14:30:37.834: D/dalvikvm(25014): WAIT_FOR_CONCURRENT_GC blocked 3ms
01-07 14:30:37.894: D/dalvikvm(25014): GC_FOR_ALLOC freed 2660K, 17% free 17674K/21063K, paused 13ms, total 13ms
01-07 14:30:37.909: D/dalvikvm(25014): GC_FOR_ALLOC freed 688K, 14% free 18212K/21063K, paused 10ms, total 10ms
01-07 14:30:37.944: D/dalvikvm(25014): GC_FOR_ALLOC freed <1K, 11% free 18890K/21063K, paused 12ms, total 12ms
01-07 14:30:37.949: I/dalvikvm-heap(25014): Grow heap (frag case) to 20.170MB for 1235556-byte allocation
01-07 14:30:37.964: D/dalvikvm(25014): GC_FOR_ALLOC freed 0K, 10% free 20097K/22279K, paused 11ms, total 11ms
01-07 14:30:38.019: D/libEGL(25014): loaded /system/lib/egl/libEGL_mali.so
01-07 14:30:38.024: D/libEGL(25014): loaded /system/lib/egl/libGLESv1_CM_mali.so
01-07 14:30:38.024: D/libEGL(25014): loaded /system/lib/egl/libGLESv2_mali.so
01-07 14:30:38.029: D/(25014): Device driver API match
01-07 14:30:38.029: D/(25014): Device driver API version: 10
01-07 14:30:38.029: D/(25014): User space API version: 10
01-07 14:30:38.029: D/(25014): mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Fri Sep 28
10:42:56 KST 2012
01-07 14:30:38.064: D/OpenGLRenderer(25014): Enabling debug mode 0
Just add this property to your edit text and your problem will definitely be resolved
android:inputType="textNoSuggestions"
Add the above property to each of your edit text used in the application, or simply where you get the error in that edit text only.
It's probably because you are using 3rd party keyboard instead of the native phone keyboard.
This often happens with SwiftKey.
Just ignore them. Its because your OS might have had some new keyboards like Swype, or some other customized keyboards, and these kind of things come popping up. So you don't have to worry.
Check if you have any element such as button or text view duplicated (copied twice) in the activity xml file that corresponds to the screen where this encounters. I did this unnoticed and had to face the same issue.
Add the android:textIsSelectable="false" in editText
For example
<EditText
android:id="#+id/edit_IONumber"
android:layout_width="0dp"
android:layout_weight="3"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:textIsSelectable="false"
android:layout_height="wrap_content"
android:background="#drawable/edit_text_shape"
android:padding="5dip" />

Categories

Resources