Android SDK Emulator with OpenGL ES 2.0 Support? - android

recently while reading some tutorials online, I saw this video suggesting that the Android SDK now supports OpenGL ES 2.0:
http://www.youtube.com/watch?feature=player_embedded&v=T--vFtyZvc4
Enthusiastically, I added the option for 'GPU Emulation' in my emulator and tried to run a basic HelloOpenGLES20 app, however I was greeted with this error, and some null pointer exceptions which doesn't make sense:
Sorry!
The application
LessonOneActivity (process
lesson.One has stopped
unexpectedly. Please try again.
Force close
The app runs fine on a real Android phone displaying some spinning triangles, I'm wondering if anyone has encountered the problem I'm facing, I've did a fair share of googling but could find no solutions =(
Here's the log:
04-26 06:42:08.782: D/AndroidRuntime(577): Shutting down VM
04-26 06:42:08.813: W/dalvikvm(577): threadid=1: thread exiting with uncaught exception (group=0x40015560)
04-26 06:42:08.842: E/AndroidRuntime(577): FATAL EXCEPTION: main
04-26 06:42:08.842: E/AndroidRuntime(577): java.lang.RuntimeException: Unable to resume activity {lesson.One/com.learnopengles.android.lesson1.LessonOneActivity}: java.lang.NullPointerException
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2120)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2135)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1668)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.os.Handler.dispatchMessage(Handler.java:99)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.os.Looper.loop(Looper.java:130)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread.main(ActivityThread.java:3683)
04-26 06:42:08.842: E/AndroidRuntime(577): at java.lang.reflect.Method.invokeNative(Native Method)
04-26 06:42:08.842: E/AndroidRuntime(577): at java.lang.reflect.Method.invoke(Method.java:507)
04-26 06:42:08.842: E/AndroidRuntime(577): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-26 06:42:08.842: E/AndroidRuntime(577): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-26 06:42:08.842: E/AndroidRuntime(577): at dalvik.system.NativeStart.main(Native Method)
04-26 06:42:08.842: E/AndroidRuntime(577): Caused by: java.lang.NullPointerException
04-26 06:42:08.842: E/AndroidRuntime(577): at android.opengl.GLSurfaceView.onResume(GLSurfaceView.java:512)
04-26 06:42:08.842: E/AndroidRuntime(577): at com.learnopengles.android.lesson1.LessonOneActivity.onResume(LessonOneActivity.java:46)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1150)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.Activity.performResume(Activity.java:3832)
04-26 06:42:08.842: E/AndroidRuntime(577): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2110)
04-26 06:42:08.842: E/AndroidRuntime(577): ... 12 more
04-26 06:42:13.292: I/Process(577): Sending signal. PID: 577 SIG: 9

I have run the code, and the exception is due to the fact that the emulator still does not support GLES20. If you print more information, you'll see that supportsEs2 is false.
Why the emulator does not support GLES20 even if GPU Emulation is set to true is system-dependent. If you are developing on Linux, it may be related to the graphics card. Here is a similar question with some possible solutions. At least you can try it.
EDIT:
According to the official site, you need to set your emulator target to API 15 (rev03) or higher.

Related

AVD crashes saying 'Unfortunately, libcocos2dx has crashed'

I just loaded my app created by cocos2dx-3.10 and when I open with it an AVD (again I haven't done any modifications to the app) the app crashes and gives the error: Unfortunately, libcocos2dx has crashed.
here is what I get in my android Monitor:
03-05 18:34:56.668 1435-1435/? D/dalvikvm: Not late-enabling CheckJNI (already on)
03-05 18:34:56.989 1435-1435/com.trying.name E/Trace: error opening trace file: No such file or directory (2)
03-05 18:34:57.419 1435-1435/com.trying.name D/AndroidRuntime: Shutting down VM
03-05 18:34:57.419 1435-1435/com.trying.name W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xb2f2b288)
03-05 18:34:57.518 1435-1435/com.trying.name E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: Couldn't load cocos2dcpp: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:535)
at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:248)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:263)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
03-05 18:35:11.559 1435-1435/? I/Process: Sending signal. PID: 1435 SIG: 9

google app invites(beta) not working in android 2.3.6

Google App Invites(Beta) is not working in android 2.3.6 devices.
I tried out in a 4 devices of different versions & it failed only in 2.3.6.
Kindly point me to resources to resolve this error!
Below is the stacktrace
06-16 08:49:13.939 6396-6396/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.gms/com.google.android.gms.appinvite.AppInviteActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.google.android.gms.appinvite.ui.widget.g.<init>(SourceFile:167)
at com.google.android.gms.appinvite.ui.widget.s.b(SourceFile:80)
at com.google.android.gms.appinvite.ui.widget.d.a(SourceFile:76)
at com.google.android.gms.appinvite.ui.context.h.a(SourceFile:409)
at android.support.v4.app.Fragment.b(SourceFile:1786)
at android.support.v4.app.s.a(SourceFile:953)
at android.support.v4.app.s.a(SourceFile:1136)
at android.support.v4.app.a.run(SourceFile:739)
at android.support.v4.app.s.h(SourceFile:1499)
at android.support.v4.app.l.onStart(SourceFile:548)
at com.google.android.gms.appinvite.AppInviteActivity.onStart(SourceFile:270)

java.lang.UnsatisfiedLinkError: debugLevel

Alright, I've been going thru posts left and right trying to figure out this error.. I've managed to fix a few errors, but this is just driving me nuts.. it has almost no information.. or atleast none that makes any sense to me.
D/dalvikvm(431): Trying to load lib /data/data/com.hyperlinkup.manglerbt/lib/libventrilo_interface.so 0x405156c8
D/dalvikvm(431): Added shared lib /data/data/com.hyperlinkup.manglerbt/lib/libventrilo_interface.so 0x405156c8
D/dalvikvm(431): No JNI_OnLoad found in /data/data/com.hyperlinkup.manglerbt/lib/libventrilo_interface.so 0x405156c8, skipping init
D/dalvikvm(431): GC_EXTERNAL_ALLOC freed 61K, 53% free 2565K/5379K, external 1027K/1038K, paused 89ms
W/dalvikvm(431): No implementation found for native Lcom/hyperlinkup/manglerbt/VentriloInterface;.debuglevel (I)I
D/AndroidRuntime(431): Shutting down VM
W/dalvikvm(431): threadid=1: thread exiting with uncaught exception (group=0x40015560)
E/AndroidRuntime(431): FATAL EXCEPTION: main
E/AndroidRuntime(431): java.lang.UnsatisfiedLinkError: debuglevel
E/AndroidRuntime(431): at com.hyperlinkup.manglerbt.VentriloInterface.debuglevel(Native Method)
E/AndroidRuntime(431): at com.hyperlinkup.manglerbt.ServerList.onCreate(ServerList.java:96)
E/AndroidRuntime(431): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(431): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
E/AndroidRuntime(431): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
E/AndroidRuntime(431): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
E/AndroidRuntime(431): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
E/AndroidRuntime(431): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(431): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(431): at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime(431): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(431): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(431): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime(431): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime(431): at dalvik.system.NativeStart.main(Native Method)
I/Process(431): Sending signal. PID: 431 SIG: 9
I'm trying to rework the Mangler app to use Bluetooth recording (via startBluetoothSco), but I want to make sure the original is working before incorporating the bluetooth functionality.. Any help I can get on this matter would be greatly appreciated.
edit: thinking maybe my issue is with jni_wrappers.c.. first 3 #include's are unresolved.. original build was on linux system it would appear, so it's looking for jni.h, stdint.h and ventrilo3.h
Answer is in the Logcat Stacktrace itself
No implementation found for native Lcom/hyperlinkup/manglerbt/VentriloInterface;.debuglevel (I)I D/AndroidRuntime(431): Shutting down VM
There is a Native method called debuglevel in VentriloInterface. You have not implemented that method. So, the VM throws java.lang.UnsatisfiedLinkError.

Android - why is GC suddenly removing my object?

When I'm creating object to write to output stream (size is lower than 150KB) it probably gets instantly destroyed, because of:
System.out.println("Sending object..");
Packet p = new Packet(mJpegData); // here exists
System.out.println(p); // reference exists
oos.writeObject(p); // null exception error
full error:
04-26 21:37:01.414: W/System.err(12888): java.lang.NullPointerException
04-26 21:37:01.414: W/System.err(12888): at pl.aadamczyk.webcamera.Preview$PreCallback.onPreviewFrame(Preview.java:148)
04-26 21:37:01.417: W/System.err(12888): at android.hardware.Camera$EventHandler.handleMessage(Camera.java:583)
04-26 21:37:01.417: W/System.err(12888): at android.os.Handler.dispatchMessage(Handler.java:99)
04-26 21:37:01.417: W/System.err(12888): at android.os.Looper.loop(Looper.java:130)
04-26 21:37:01.417: W/System.err(12888): at android.app.ActivityThread.main(ActivityThread.java:3687)
04-26 21:37:01.417: W/System.err(12888): at java.lang.reflect.Method.invokeNative(Native Method)
04-26 21:37:01.417: W/System.err(12888): at java.lang.reflect.Method.invoke(Method.java:507)
04-26 21:37:01.417: W/System.err(12888): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
04-26 21:37:01.417: W/System.err(12888): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-26 21:37:01.417: W/System.err(12888): at dalvik.system.NativeStart.main(Native Method)
04-26 21:37:01.472: D/dalvikvm(12888): GC_FOR_MALLOC freed 1152K, 57% free 2820K/6535K, external 1596K/2108K, paused 17ms
04-26 21:37:01.472: I/System.out(12888): My Object has been GC'd. Packet#4063d908
04-26 21:37:01.523: D/dalvikvm(12888): GC_CONCURRENT freed 28K, 50% free 3311K/6535K, external 1596K/2108K, paused 3ms+10ms
"My Object has been GC'd. " is printed by Packet's finalizer.
whole code: http://pastebin.com/zc5TcSgY
Why GS is removing my object? I've got in about 120 MB free memory.
How to fix it?
I think the problem is with oos because it might be the one causing NullPointerException.
Change your code a little as below:
System.out.println("Sending object..");
Packet p = new Packet(mJpegData); // here exists
System.out.println(p); // reference exists
if(oos != null)
oos.writeObject(p);
else
Log.w("oos", "its null");

Can't start ListActivity via Intent

I have 2 activities. First activity extends Activity and second extends ListActivity.
I need to call ListActivity from the Activity class
I have tried the following.
Intent intent = new Intent(firstclassname.this, secongclassname.class);
startActivity(intent);
I've added an entry in the manifest file but it doen't work.
That same code works for the Activity class (if the second class extends ListActivity)
I got following Logcat output
04-26 15:51:48.235: INFO/ActivityManager(52): Starting activity: Intent { cmp=android.com.testHTML/.FindFilesByType }
04-26 15:51:48.395: ERROR/ArrayAdapter(3113): You must supply a resource ID for a TextView
04-26 15:51:48.395: WARN/dalvikvm(3113): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)
04-26 15:51:48.405: ERROR/AndroidRuntime(3113): Uncaught handler: thread main exiting due to uncaught exception
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextView
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:347)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.AbsListView.obtainView(AbsListView.java:1273)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ListView.makeAndAddView(ListView.java:1658)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ListView.fillDown(ListView.java:637)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ListView.fillFromTop(ListView.java:694)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ListView.layoutChildren(ListView.java:1516)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.AbsListView.onLayout(AbsListView.java:1112)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.View.layout(View.java:6569)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1108)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.LinearLayout.onLayout(LinearLayout.java:920)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.View.layout(View.java:6569)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.View.layout(View.java:6569)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.LinearLayout.onLayout(LinearLayout.java:918)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.View.layout(View.java:6569)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.View.layout(View.java:6569)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.ViewRoot.performTraversals(ViewRoot.java:979)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.os.Handler.dispatchMessage(Handler.java:99)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.os.Looper.loop(Looper.java:123)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.app.ActivityThread.main(ActivityThread.java:4203)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at java.lang.reflect.Method.invokeNative(Native Method)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at java.lang.reflect.Method.invoke(Method.java:521)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at dalvik.system.NativeStart.main(Native Method)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): Caused by: java.lang.ClassCastException: android.widget.LinearLayout
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:340)
04-26 15:51:48.414: ERROR/AndroidRuntime(3113): ... 30 more
04-26 15:51:48.436: INFO/Process(52): Sending signal. PID: 3113 SIG: 3
04-26 15:51:48.446: INFO/dalvikvm(3113): threadid=7: reacting to signal 3
04-26 15:51:48.446: ERROR/dalvikvm(3113): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
04-26 15:51:58.289: WARN/ActivityManager(52): Launch timeout has expired, giving up wake lock!
04-26 15:51:58.289: WARN/ActivityManager(52): Activity idle timeout for HistoryRecord{4391c898 android.com.testHTML/.FindFilesByType}
What am I doing wrong?
Your activity is properly started.
The problem is in ArrayAdapter that you are using. You are not providing the resource id of the TextView.
Check out which constructor you are using and provide the correct parameters.

Categories

Resources