wuhu
wuhu

Reputation: 33

Basic android with eclipse : the process android.process.acore has stopped unexpectedly

I have started doing some exercises from an android development book. All i have done is

The first few lines of error in logcat are as follows :

02-04 03:05:21.218: ERROR/ContactsProvider(343): Cannot start provider
02-04 03:05:21.218: ERROR/ContactsProvider(343): java.lang.IllegalStateException: error upgrading the database to version 353
02-04 03:05:21.218: ERROR/ContactsProvider(343):  at com.android.providers.contacts.ContactsDatabaseHelper.onUpgrade(ContactsDatabaseHelper.java:1545)
02-04 03:05:21.218: ERROR/ContactsProvider(343):  at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:132)
02-04 03:05:21.218: ERROR/ContactsProvider(343):  at com.android.providers.contacts.ContactsDatabaseHelper.getWritableDatabase(ContactsDatabaseHelper.java:2550)
02-04 03:05:21.218: ERROR/ContactsProvider(343):  at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:187)
02-04 03:05:21.218: ERROR/ContactsProvider(343):  at com.android.providers.contacts.LegacyApiSupport.<init>(LegacyApiSupport.java:525)

Am not sure what is going wrong, can anyone help me? Tried searching for an answer but to avail. Thanks in advance,

Upvotes: 0

Views: 5589

Answers (4)

Mr Programmer
Mr Programmer

Reputation: 49

The problem is not with your code. You should get the same error even if you virtual device directly.

Creating a new Virtual Device works well. Make sure to delete the old one.

Upvotes: 1

m.k.
m.k.

Reputation: 21

I fixed it by the following method.

Android Virtual Device Manager > New

Remake Android Virtual Devices. Old setting delete.

Upvotes: 2

orange
orange

Reputation: 42

from Exception , it looks like sqlite cause this problem, Anriod has Mechanism, It can auto update your database, if you override onUpgrade method , just like the following:

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
  String sql = "DROP TABLE IF EXISTS " + TABLE_NAME;
  db.execSQL(sql);
  onCreate(db);
}

Upvotes: 1

Lucifer
Lucifer

Reputation: 29672

Try following, Remove Comment from your below line.

//setContentView(R.layout.main); to setContentView(R.layout.main);

and then try running again.

Upvotes: 0

Related Questions