OpenGl renderer on Android - android

I am trying to make a simple renderer with OpenGL2.0, made up only of a main activity, surface view, and renderer file. Whenever I run it on an avd, the screen turns black and says the program has encountered a problem. Here is the logcat
08-04 03:55:59.722: D/libEGL(6287): Emulator without GPU support detected. Fallback to software renderer.
08-04 03:55:59.821: I/Choreographer(6287): Skipped 292 frames! The application may be doing too much work on its main thread.
08-04 03:56:00.042: D/libEGL(6287): loaded /system/lib/egl/libGLES_android.so
08-04 03:56:00.801: D/gralloc_goldfish(6287): Emulator without GPU emulation detected.
08-04 03:56:00.835: W/dalvikvm(6287): threadid=11: thread exiting with uncaught exception (group=0x40a71930)
08-04 03:56:00.881: E/AndroidRuntime(6287): FATAL EXCEPTION: GLThread 102
08-04 03:56:00.881: E/AndroidRuntime(6287): java.lang.IllegalArgumentException: No configs match configSpec
08-04 03:56:00.881: E/AndroidRuntime(6287): at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:863)
08-04 03:56:00.881: E/AndroidRuntime(6287): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1024)
08-04 03:56:00.881: E/AndroidRuntime(6287): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1401)
08-04 03:56:00.881: E/AndroidRuntime(6287): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
08-04 03:56:02.155: I/Choreographer(6287): Skipped 121 frames! The application may be doing too much work on its main thread.
08-04 03:56:07.941: I/Process(6287): Sending signal. PID: 6287 SIG: 9
Can the problem be recognized from this or should I provide code as well?

Related

Can't connect to remote database

I am trying to connect to a remote mySQL database which is hosted on my own system means the localhost. I am pasting the code for the whole class here so please see if there is a bug in it. The problem that I am facing is mentioned below the class code.
Code for the class goes here:
public class Login extends Activity implements OnClickListener {
private EditText user, pass;
private Button mSubmit, mRegister;
// Progress Dialog
private ProgressDialog pDialog;
// JSON parser class
JSONParser jsonParser = new JSONParser();
private static final String LOGIN_URL="http://127.0.0.1:8080/webservice/login.php";
private static final String TAG_SUCCESS = "success";
private static final String TAG_MESSAGE = "message";
#Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
// setup input fields
user = (EditText) findViewById(R.id.username);
pass = (EditText) findViewById(R.id.password);
// setup buttons
mSubmit = (Button) findViewById(R.id.login);
mRegister = (Button) findViewById(R.id.register);
// register listeners
mSubmit.setOnClickListener(this);
mRegister.setOnClickListener(this);
}
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.login:
new AttemptLogin().execute();
break;
case R.id.register:
Intent i = new Intent(this, Register.class);
startActivity(i);
break;
default:
break;
}
}
class AttemptLogin extends AsyncTask<String, String, String> {
#Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(Login.this);
pDialog.setMessage("Attempting login...");
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
pDialog.show();
}
#Override
protected String doInBackground(String... args) {
// TODO Auto-generated method stub
// Check for success tag
int success;
String username = user.getText().toString();
String password = pass.getText().toString();
try {
// Building Parameters
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("username", username));
params.add(new BasicNameValuePair("password", password));
Log.d("request!", "starting");
// getting product details by making HTTP request
JSONObject json = jsonParser.makeHttpRequest(LOGIN_URL, "POST",
params);
// check your log for json response
Log.d("Login attempt", "login attempt");
// json success tag
success = json.getInt(TAG_SUCCESS);
if (success == 1) {
Log.d("Login Successful!", json.toString());
// save user data
SharedPreferences sp = PreferenceManager
.getDefaultSharedPreferences(Login.this);
Editor edit = sp.edit();
edit.putString("username", username);
edit.commit();
Intent i = new Intent(Login.this, ReadComments.class);
finish();
startActivity(i);
return json.getString(TAG_MESSAGE);
} else {
Log.d("Login Failure!", json.getString(TAG_MESSAGE));
return json.getString(TAG_MESSAGE);
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
protected void onPostExecute(String file_url) {
// dismiss the dialog once product deleted
pDialog.dismiss();
if (file_url != null) {
Toast.makeText(Login.this, file_url, Toast.LENGTH_LONG).show();
}
}
}
}
The application crashes after showing the "Attempting log in" dialog with the message "Database is closed". I am including the information from catlog here so give it a look if it helps.
06-17 03:19:18.309: D/dalvikvm(2019): GC_FOR_ALLOC freed 161K, 8% free 2971K/3224K, paused 35ms, total 49ms
06-17 03:19:18.429: D/request!(2019): starting
06-17 03:19:18.459: I/Choreographer(2019): Skipped 36 frames! The application may be doing too much work on its main thread.
06-17 03:19:18.609: I/Choreographer(2019): Skipped 129 frames! The application may be doing too much work on its main thread.
06-17 03:19:18.669: I/Choreographer(2019): Skipped 43 frames! The application may be doing too much work on its main thread.
06-17 03:19:18.739: I/Choreographer(380): Skipped 61 frames! The application may be doing too much work on its main thread.
06-17 03:19:18.819: I/Choreographer(380): Skipped 37 frames! The application may be doing too much work on its main thread.
06-17 03:19:18.909: I/Choreographer(2019): Skipped 164 frames! The application may be doing too much work on its main thread.
06-17 03:19:18.929: I/Choreographer(380): Skipped 36 frames! The application may be doing too much work on its main thread.
06-17 03:19:18.939: I/Choreographer(2019): Skipped 33 frames! The application may be doing too much work on its main thread.
06-17 03:19:19.039: I/Choreographer(2019): Skipped 30 frames! The application may be doing too much work on its main thread.
06-17 03:19:19.299: I/Choreographer(2019): Skipped 32 frames! The application may be doing too much work on its main thread.
06-17 03:19:19.399: I/Choreographer(2019): Skipped 56 frames! The application may be doing too much work on its main thread.
06-17 03:19:20.819: I/Choreographer(2019): Skipped 42 frames! The application may be doing too much work on its main thread.
06-17 03:19:20.889: I/Choreographer(2019): Skipped 32 frames! The application may be doing too much work on its main thread.
06-17 03:19:21.749: I/Choreographer(2019): Skipped 37 frames! The application may be doing too much work on its main thread.
06-17 03:19:21.879: I/Choreographer(2019): Skipped 48 frames! The application may be doing too much work on its main thread.
06-17 03:19:22.449: I/Choreographer(2019): Skipped 52 frames! The application may be doing too much work on its main thread.
06-17 03:19:22.749: W/System.err(2019): org.apache.http.conn.HttpHostConnectException: Connection to http://127.0.0.1:8080 refused
06-17 03:19:22.779: I/Choreographer(2019): Skipped 55 frames! The application may be doing too much work on its main thread.
06-17 03:19:22.989: W/System.err(2019): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:183)
06-17 03:19:22.989: W/System.err(2019): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
06-17 03:19:22.989: W/System.err(2019): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
06-17 03:19:23.029: I/Choreographer(2019): Skipped 43 frames! The application may be doing too much work on its main thread.
06-17 03:19:23.279: W/System.err(2019): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
06-17 03:19:23.279: W/System.err(2019): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
06-17 03:19:23.279: W/System.err(2019): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
06-17 03:19:23.279: W/System.err(2019): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
06-17 03:19:23.289: W/System.err(2019): at com.example.mysqltest.JSONParser.makeHttpRequest(JSONParser.java:110)
06-17 03:19:23.289: W/System.err(2019): at com.example.mysqltest.Login$AttemptLogin.doInBackground(Login.java:121)
06-17 03:19:23.289: W/System.err(2019): at com.example.mysqltest.Login$AttemptLogin.doInBackground(Login.java:1)
06-17 03:19:23.289: W/System.err(2019): at android.os.AsyncTask$2.call(AsyncTask.java:288)
06-17 03:19:23.289: W/System.err(2019): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
06-17 03:19:23.289: W/System.err(2019): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
06-17 03:19:23.289: W/System.err(2019): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
06-17 03:19:23.289: W/System.err(2019): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
06-17 03:19:23.289: W/System.err(2019): at java.lang.Thread.run(Thread.java:841)
06-17 03:19:23.319: I/Choreographer(2019): Skipped 42 frames! The application may be doing too much work on its main thread.
06-17 03:19:23.739: W/System.err(2019): Caused by: java.net.ConnectException: failed to connect to /127.0.0.1 (port 8080): connect failed: ECONNREFUSED (Connection refused)
06-17 03:19:23.739: W/System.err(2019): at libcore.io.IoBridge.connect(IoBridge.java:114)
06-17 03:19:23.739: W/System.err(2019): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
06-17 03:19:23.759: W/System.err(2019): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
06-17 03:19:23.769: W/System.err(2019): at java.net.Socket.connect(Socket.java:843)
06-17 03:19:23.769: W/System.err(2019): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
06-17 03:19:23.769: W/System.err(2019): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:144)
06-17 03:19:23.769: W/System.err(2019): ... 15 more
06-17 03:19:23.769: W/System.err(2019): Caused by: libcore.io.ErrnoException: connect failed: ECONNREFUSED (Connection refused)
06-17 03:19:23.829: I/Choreographer(2019): Skipped 84 frames! The application may be doing too much work on its main thread.
06-17 03:19:23.839: W/System.err(2019): at libcore.io.Posix.connect(Native Method)
06-17 03:19:23.839: W/System.err(2019): at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:85)
06-17 03:19:23.849: W/System.err(2019): at libcore.io.IoBridge.connectErrno(IoBridge.java:127)
06-17 03:19:23.849: W/System.err(2019): at libcore.io.IoBridge.connect(IoBridge.java:112)
06-17 03:19:23.849: W/System.err(2019): ... 20 more
06-17 03:19:23.849: E/Buffer Error(2019): Error converting result java.lang.NullPointerException: lock == null
06-17 03:19:23.879: I/Choreographer(2019): Skipped 49 frames! The application may be doing too much work on its main thread.
06-17 03:19:24.439: I/Choreographer(2019): Skipped 31 frames! The application may be doing too much work on its main thread.
06-17 03:19:24.499: I/Choreographer(2019): Skipped 34 frames! The application may be doing too much work on its main thread.
06-17 03:19:24.569: E/JSON Parser(2019): Error parsing data org.json.JSONException: End of input at character 0 of
06-17 03:19:24.569: D/Login attempt(2019): login attempt
06-17 03:19:25.019: W/dalvikvm(2019): threadid=11: thread exiting with uncaught exception (group=0xb4a8aba8)
06-17 03:19:25.199: E/AndroidRuntime(2019): FATAL EXCEPTION: AsyncTask #1
06-17 03:19:25.199: E/AndroidRuntime(2019): Process: com.example.mysqltest, PID: 2019
06-17 03:19:25.199: E/AndroidRuntime(2019): java.lang.RuntimeException: An error occured while executing doInBackground()
06-17 03:19:25.199: E/AndroidRuntime(2019): at android.os.AsyncTask$3.done(AsyncTask.java:300)
06-17 03:19:25.199: E/AndroidRuntime(2019): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
06-17 03:19:25.199: E/AndroidRuntime(2019): at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
06-17 03:19:25.199: E/AndroidRuntime(2019): at java.util.concurrent.FutureTask.run(FutureTask.java:242)
06-17 03:19:25.199: E/AndroidRuntime(2019): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
06-17 03:19:25.199: E/AndroidRuntime(2019): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
06-17 03:19:25.199: E/AndroidRuntime(2019): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
06-17 03:19:25.199: E/AndroidRuntime(2019): at java.lang.Thread.run(Thread.java:841)
06-17 03:19:25.199: E/AndroidRuntime(2019): Caused by: java.lang.NullPointerException
06-17 03:19:25.199: E/AndroidRuntime(2019): at com.example.mysqltest.Login$AttemptLogin.doInBackground(Login.java:128)
06-17 03:19:25.199: E/AndroidRuntime(2019): at com.example.mysqltest.Login$AttemptLogin.doInBackground(Login.java:1)
06-17 03:19:25.199: E/AndroidRuntime(2019): at android.os.AsyncTask$2.call(AsyncTask.java:288)
06-17 03:19:25.199: E/AndroidRuntime(2019): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
06-17 03:19:25.199: E/AndroidRuntime(2019): ... 4 more
06-17 03:19:25.229: I/Choreographer(2019): Skipped 35 frames! The application may be doing too much work on its main thread.
06-17 03:19:25.279: W/ActivityManager(380): Force finishing activity com.example.mysqltest/.Login
06-17 03:19:25.309: D/gralloc(51): Registering a buffer in the process that created it. This may cause memory ordering problems.
06-17 03:19:25.309: E/libEGL(51): called unimplemented OpenGL ES API
06-17 03:19:25.309: E/libEGL(51): called unimplemented OpenGL ES API
06-17 03:19:25.319: E/libEGL(51): called unimplemented OpenGL ES API
06-17 03:19:25.319: E/libEGL(51): called unimplemented OpenGL ES API
06-17 03:19:25.319: E/SurfaceFlinger(51): glCheckFramebufferStatusOES error 886920962
06-17 03:19:25.319: E/SurfaceFlinger(51): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
06-17 03:19:25.319: E/libEGL(51): called unimplemented OpenGL ES API
06-17 03:19:25.319: E/libEGL(51): called unimplemented OpenGL ES API
06-17 03:19:25.329: I/Choreographer(2019): Skipped 91 frames! The application may be doing too much work on its main thread.
06-17 03:19:25.359: W/WindowManager(380): Screenshot failure taking screenshot for (123x221) to layer 21015
06-17 03:19:25.589: I/Choreographer(380): Skipped 92 frames! The application may be doing too much work on its main thread.
06-17 03:19:25.599: I/Choreographer(2019): Skipped 203 frames! The application may be doing too much work on its main thread.
06-17 03:19:25.669: I/Choreographer(2019): Skipped 65 frames! The application may be doing too much work on its main thread.
06-17 03:19:25.719: I/Choreographer(380): Skipped 115 frames! The application may be doing too much work on its main thread.
06-17 03:19:25.779: I/Choreographer(2019): Skipped 92 frames! The application may be doing too much work on its main thread.
06-17 03:19:25.839: I/Choreographer(542): Skipped 288 frames! The application may be doing too much work on its main thread.
06-17 03:19:25.869: I/Choreographer(380): Skipped 35 frames! The application may be doing too much work on its main thread.
06-17 03:19:25.939: I/Choreographer(380): Skipped 45 frames! The application may be doing too much work on its main thread.
06-17 03:19:25.939: I/Choreographer(2019): Skipped 41 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.069: I/Choreographer(380): Skipped 124 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.119: I/Choreographer(380): Skipped 41 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.129: I/Choreographer(2019): Skipped 35 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.169: I/Choreographer(2019): Skipped 30 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.259: I/Choreographer(380): Skipped 35 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.269: I/Choreographer(2019): Skipped 89 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.309: I/Choreographer(380): Skipped 35 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.319: I/Choreographer(2019): Skipped 46 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.369: I/Choreographer(380): Skipped 46 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.379: I/Choreographer(2019): Skipped 54 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.469: I/Choreographer(2019): Skipped 80 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.499: I/Choreographer(380): Skipped 115 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.589: I/Choreographer(2019): Skipped 116 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.619: I/Choreographer(380): Skipped 80 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.689: I/Choreographer(380): Skipped 37 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.849: I/Choreographer(380): Skipped 77 frames! The application may be doing too much work on its main thread.
06-17 03:19:26.939: I/Choreographer(380): Skipped 43 frames! The application may be doing too much work on its main thread.
06-17 03:19:27.009: I/Choreographer(380): Skipped 41 frames! The application may be doing too much work on its main thread.
06-17 03:19:27.169: I/Choreographer(380): Skipped 36 frames! The application may be doing too much work on its main thread.
06-17 03:19:27.349: E/WindowManager(2019): android.view.WindowLeaked: Activity com.example.mysqltest.Login has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{b4d95578 V.E..... R.....ID 0,0-228,72} that was originally added here
06-17 03:19:27.349: E/WindowManager(2019): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:348)
06-17 03:19:27.349: E/WindowManager(2019): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
06-17 03:19:27.349: E/WindowManager(2019): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
06-17 03:19:27.349: E/WindowManager(2019): at android.app.Dialog.show(Dialog.java:286)
06-17 03:19:27.349: E/WindowManager(2019): at com.example.mysqltest.Login$AttemptLogin.onPreExecute(Login.java:103)
06-17 03:19:27.349: E/WindowManager(2019): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:587)
06-17 03:19:27.349: E/WindowManager(2019): at android.os.AsyncTask.execute(AsyncTask.java:535)
06-17 03:19:27.349: E/WindowManager(2019): at com.example.mysqltest.Login.onClick(Login.java:82)
06-17 03:19:27.349: E/WindowManager(2019): at android.view.View.performClick(View.java:4438)
06-17 03:19:27.349: E/WindowManager(2019): at android.view.View$PerformClick.run(View.java:18422)
06-17 03:19:27.349: E/WindowManager(2019): at android.os.Handler.handleCallback(Handler.java:733)
06-17 03:19:27.349: E/WindowManager(2019): at android.os.Handler.dispatchMessage(Handler.java:95)
06-17 03:19:27.349: E/WindowManager(2019): at android.os.Looper.loop(Looper.java:136)
06-17 03:19:27.349: E/WindowManager(2019): at android.app.ActivityThread.main(ActivityThread.java:5017)
06-17 03:19:27.349: E/WindowManager(2019): at java.lang.reflect.Method.invokeNative(Native Method)
06-17 03:19:27.349: E/WindowManager(2019): at java.lang.reflect.Method.invoke(Method.java:515)
06-17 03:19:27.349: E/WindowManager(2019): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
06-17 03:19:27.349: E/WindowManager(2019): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
06-17 03:19:27.349: E/WindowManager(2019): at dalvik.system.NativeStart.main(Native Method)
06-17 03:19:27.359: I/Choreographer(2019): Skipped 273 frames! The application may be doing too much work on its main thread.
06-17 03:19:27.449: I/Choreographer(2019): Skipped 85 frames! The application may be doing too much work on its main thread.
06-17 03:20:10.919: D/LightsService(380): Excessive delay setting light: 89ms
Please note that the about catlog information is after I press the login button.
Please, check mysql-service is running or not.
If no then service is stop, then check space available at harddisk.
If space is not availbale then try to increase free space or increase
hard disk space, then restart mysql service.

Uncaught module cordova/plugin/BarcodeScanner not found PhoneGap

I had created a Phonegap android project in which I am trying to read a QRCode.For that I had included the library project Of BarcodeScanner from here https://github.com/wildabeast/BarcodeScanner .
But while I am trying to add this library to my PhoneGap Project , Initially it shows green symbol but after that it turns in red cross.
I think because of that I am getting this log in Logcat :
05-1512:48:37.489:D/DroidGap(863):onMessage(onPageFinished,file:///android_asset/www/index.html)
05-15 12:48:37.749: D/CordovaNetworkManager(863): Connection Type: 3g
05-15 12:48:37.749: D/DroidGap(863): onMessage(networkconnection,3g)
05-15 12:48:37.758: D/CordovaNetworkManager(863): Connection Type: 3g
05-15 12:48:37.768: D/DroidGap(863): onMessage(spinner,stop)
05-15 12:48:38.138: D/dalvikvm(863): GC_FOR_ALLOC freed 222K, 4% free 8166K/8455K, paused 40ms, total 43ms
05-15 12:48:39.579: D/DroidGap(863): onMessage(spinner,stop)
05-15 12:48:42.718: I/Choreographer(863): Skipped 30 frames! The application may be doing too much work on its main thread.
05-15 12:48:44.508: D/CordovaLog(863): Uncaught module cordova/plugin/BarcodeScanner not found
05-15 12:48:44.508: E/Web Console(863): Uncaught module cordova/plugin/BarcodeScanner not found at file:///android_asset/www/cordova-2.6.0.js:50
So I got stuck here.Any suggestion ?

Android AVD emulator not running app, but device does? (OpenGL)

Hi I am trying to run some sample openGl code on an emulator. I am new to Android development. It crashes on the emulator but not my device, a Samsung Galaxy Note phone N7000.
The AVD settings I tried were:
Target: Android 4.1 - API Level 16
CPU/ABI: ARM (armeabi-v7a)
SD Card: 32 MiB
Skin: Built-in : WGA800
Here are the errors on the console:
10-15 13:23:34.287: E/Trace(621): error opening trace file: No such file or directory (2)
10-15 13:23:34.848: D/libEGL(621): Emulator without GPU support detected. Fallback to software renderer.
10-15 13:23:34.878: D/libEGL(621): loaded /system/lib/egl/libGLES_android.so
10-15 13:23:34.947: D/gralloc_goldfish(621): Emulator without GPU emulation detected.
10-15 13:23:34.977: W/dalvikvm(621): threadid=11: thread exiting with uncaught exception (group=0x40a13300)
10-15 13:23:34.977: E/AndroidRuntime(621): FATAL EXCEPTION: GLThread 72
10-15 13:23:34.977: E/AndroidRuntime(621): java.lang.IllegalArgumentException: No configs match configSpec
10-15 13:23:34.977: E/AndroidRuntime(621): at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:863)
10-15 13:23:34.977: E/AndroidRuntime(621): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1024)
10-15 13:23:34.977: E/AndroidRuntime(621): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1401)
10-15 13:23:34.977: E/AndroidRuntime(621): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
10-15 13:23:35.377: I/Choreographer(621): Skipped 67 frames! The application may be doing too much work on its main thread.
10-15 13:23:36.658: I/Choreographer(621): Skipped 72 frames! The application may be doing too much work on its main thread.
Thanks
Bob
10-15 13:23:34.848: D/libEGL(621): Emulator without GPU support detected. Fallback to software renderer.
Just recreate or edit your emulator and be sure that under the hardware list you have
GPU Emulation set to Yes

Application stopped unexpectedly on launch - no compilation errors in Eclipse

My application for Android (API level 8+) is compiled without any error messages in Eclipse.
The console says:
[2011-08-04 16:10:50 - PROJECT_NAME] Android Launch!
[2011-08-04 16:10:50 - PROJECT_NAME] adb is running normally.
[2011-08-04 16:10:50 - PROJECT_NAME] Performing PACKAGE_NAME.MainActivity activity launch
[2011-08-04 16:10:52 - PROJECT_NAME] Uploading PROJECT_NAME.apk onto device '80A354043048365763'
[2011-08-04 16:10:52 - PROJECT_NAME] Installing PROJECT_NAME.apk...
[2011-08-04 16:10:55 - PROJECT_NAME] Success!
[2011-08-04 16:10:55 - PROJECT_NAME] Starting activity PACKAGE_NAME.MainActivity on device DEVICE_ID
[2011-08-04 16:10:56 - PROJECT_NAME] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=PACKAGE_NAME/.MainActivity }
This is what is always displayed there. The application is then started on my USB-connected Android device.
It used to work fine, until at some point in the developing process the following message appeared:.
Sorry! The application Messages (process PACKAGE_NAME) has stopped unexpectedly. Please try again. Force close.
In the background, there is the application window - but without any GUI elements: no buttons, no text. Just the application's title on the top.
I don't know why this message appears. I cannot test my application anymore. And - as I already said - there are no errors in Eclipse.
Logcat says the following:
08-04 16:35:27.666: INFO/ActivityManager(2365): Force stopping package PACKAGE_NAME uid=10077
08-04 16:35:27.676: INFO/ActivityManager(2365): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=PACKAGE_NAME/.MainActivity }
08-04 16:35:27.726: WARN/Flex(2448): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:27.766: INFO/ActivityManager(2365): Start proc PACKAGE_NAME for activity PACKAGE_NAME/.MainActivity: pid=4262 uid=10077 gids={3003}
08-04 16:35:27.916: WARN/ActivityThread(4262): Application PACKAGE_NAME is waiting for the debugger on port 8100...
08-04 16:35:27.926: INFO/System.out(4262): Sending WAIT chunk
08-04 16:35:28.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:28.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:28.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:28.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:28.016: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] 0. mDataNetType: 2
08-04 16:35:28.016: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] curNetwork=26203 curHPLMN=26203
08-04 16:35:28.126: INFO/System.out(4262): Debugger has connected
08-04 16:35:28.136: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:28.336: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:28.536: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:28.736: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:28.936: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:29.141: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:29.336: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:29.539: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:29.739: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:29.945: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:30.146: INFO/System.out(4262): debugger has settled (1340)
08-04 16:35:31.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:31.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:31.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:31.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:31.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] 0. mDataNetType: 2
08-04 16:35:31.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] curNetwork=26203 curHPLMN=26203
08-04 16:35:34.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:34.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:34.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:34.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:34.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] 0. mDataNetType: 2
08-04 16:35:34.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] curNetwork=26203 curHPLMN=26203
08-04 16:35:37.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:37.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:37.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:37.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:37.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] 0. mDataNetType: 2
08-04 16:35:37.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] curNetwork=26203 curHPLMN=26203
08-04 16:35:37.697: WARN/ActivityManager(2365): Launch timeout has expired, giving up wake lock!
08-04 16:35:37.894: WARN/ActivityManager(2365): Activity idle timeout for HistoryRecord{451e5930 PACKAGE_NAME/.MainActivity}
08-04 16:35:40.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:40.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:40.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:40.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:40.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] 0. mDataNetType: 2
08-04 16:35:40.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] curNetwork=26203 curHPLMN=26203
08-04 16:35:43.017: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:43.017: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:43.017: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:43.017: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:43.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] 0. mDataNetType: 2
08-04 16:35:43.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] curNetwork=26203 curHPLMN=26203
I hope somebody can help me ... :) I'm almost desperate. Thank you very much in advance!
Edit #1:
When I run the application in Eclipse's debug mode, the error message doesn't appear. The application window appears but without any GUI elements. And I have to close the window using the HOME button. The BACK button doesn't work. And in the application settings I can choose "Force Stop". So is there any problem with threads maybe? Maybe the application got stuck?
Edit #2:
It doesn't seem to be an Eclipse problem or phone problem as I am still able to create a "Hello World" app. It even runs on the phone.
Edit #3:
My main activity starts as follows:
public class MainActivity extends ListActivity {
When I change this to ...
public class MainActivity extends Activity {
... and comment out the following line, the application is shown without any error messages:
setListAdapter(this.m_adapter);
Edit #4:
I think I can remember again what I changed before the problem occurred for the first time: I implemented the code of a tutorial on ListViews which worked fine. But then I changed the ID of the listview (see tutorial: main.xml) from "android:list" to "resultList". So this was probably the cause.
When I change it back now, the error occurrs in initiateSearch() where it says thread.notifyAll();
When I comment out this line, everything works without any errors, but the application does not what it should do anymore, of course.
Having talked to Marco it turns out the error was to do with the id naming of the List element in the xml.
http://developer.android.com/reference/android/app/ListActivity.html - "...To do this, your own view MUST contain a ListView object with the id '#android:id/list' ..."
Eclipse is a bit rubbish sometimes!!
Things I would try in order:
Clean projects
Restart Eclipse
Completely remove the application and data & cache from your handset
On your phone go in to your settings-> Applications-> Development and disable then re-enable USB Debugging
Restart your phone
Rebuild your eclipse workspace
Let me know if any of those help

Android Hello World app crashes: IllegalArgumentException from Surface.lockCanvasNative

I am trying to run the simplest Hello World example app and looks like I can crash it even all it does is showing a TextView.
Steps to reproduce: Launch it in the emulator (1.5). Open the app - it shows the text view, then lock the phone by pressing "end call" button. Unlock by pressing "menu", then press "back". App crashes with "The process android.process.acore has stopped unexpectedly..." and Force Close button. It does not happen all the time, but I am able to reproduce it every time after wiping the user data at least.
I wonder if default Hello World is missing a detail which was considered too advanced for a hello world... Such problems with a basic example does not look very encouraging =)
Any idea what detail is missing and how to avoid this crash?
Stack (I've truncated timestamps):
37.478: DEBUG/KeyguardViewMediator(576): wakeWhenReadyLocked(82)
37.481: DEBUG/KeyguardViewMediator(576): handleWakeWhenReady(82)
37.481: DEBUG/KeyguardViewMediator(576): pokeWakelock(5000)
39.110: DEBUG/KeyguardViewMediator(576): pokeWakelock(5000)
39.140: WARN/InputManagerService(576): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#436e3fc0
40.990: ERROR/IMemory(679): binder=0x238aa8 transaction failed fd=-2147483647, size=0, err=-2147483646 (Unknown error: 2147483646)
40.990: ERROR/IMemory(679): cannot dup fd=-2147483647, size=0, err=-2147483646 (Bad file number)
40.990: ERROR/IMemory(679): cannot map BpMemoryHeap (binder=0x238aa8), size=0, fd=-1 (Bad file number)
40.990: ERROR/Surface(679): Couldn't map Surface's heap (binder=0x238aa8, heap=0x238b00)
40.990: DEBUG/AndroidRuntime(679): Shutting down VM
40.990: WARN/dalvikvm(679): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
40.990: ERROR/AndroidRuntime(679): Uncaught handler: thread main exiting due to uncaught exception
40.990: ERROR/AndroidRuntime(679): java.lang.IllegalArgumentException
40.990: ERROR/AndroidRuntime(679): at android.view.Surface.lockCanvasNative(Native Method)
40.990: ERROR/AndroidRuntime(679): at android.view.Surface.lockCanvas(Surface.java:196)
40.990: ERROR/AndroidRuntime(679): at android.view.ViewRoot.draw(ViewRoot.java:1175)
40.990: ERROR/AndroidRuntime(679): at android.view.ViewRoot.performTraversals(ViewRoot.java:1030)
40.990: ERROR/AndroidRuntime(679): at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)
40.990: ERROR/AndroidRuntime(679): at android.os.Handler.dispatchMessage(Handler.java:99)
40.990: ERROR/AndroidRuntime(679): at android.os.Looper.loop(Looper.java:123)
40.990: ERROR/AndroidRuntime(679): at android.app.ActivityThread.main(ActivityThread.java:3948)
40.990: ERROR/AndroidRuntime(679): at java.lang.reflect.Method.invokeNative(Native Method)
40.990: ERROR/AndroidRuntime(679): at java.lang.reflect.Method.invoke(Method.java:521)
40.990: ERROR/AndroidRuntime(679): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
40.990: ERROR/AndroidRuntime(679): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
40.990: ERROR/AndroidRuntime(679): at dalvik.system.NativeStart.main(Native Method)
41.000: INFO/Process(576): Sending signal. PID: 679 SIG: 3
41.000: INFO/dalvikvm(679): threadid=7: reacting to signal 3
41.030: ERROR/ActivityThread(576): Failed to find provider info for android.server.checkin
41.030: ERROR/Checkin(576): Error reporting crash: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/crashes
41.070: INFO/dalvikvm(679): Wrote stack trace to '/data/anr/traces.txt'
50.940: WARN/ActivityManager(576): Launch timeout has expired, giving up wake lock!
50.980: WARN/ActivityManager(576): Activity idle timeout for HistoryRecord{4366ac40 {com.android.launcher/com.android.launcher.Launcher}}
sounds to me more like something wrong with your emulator. Why dont you delete your emulator and create a new one and try again with a fresh project.
Hope that will help you. BTW why are you using emulator on 1.5?? Start to build applications for min 2.1.
Good luck.

Categories

Resources