[Galaxy S III Android Development] gianogli:
Google contacts sync issue...

From crdroid 3.7 I noticed an issue during the sync of my contacts in the google account.

As a lot of people reported in the last 2/3 months sometime in the screen of my device appears the error message "Google Contacts Sync has stopped".

If I run logcat during the issue I can extract these logs:

*******

10-23 23:00:59.652 29544 29564 E AndroidRuntime: FATAL EXCEPTION: SyncAdapterThread-1

10-23 23:00:59.652 29544 29564 E AndroidRuntime: Process: com.google.process.gapps, PID: 29544

10-23 23:00:59.652 29544 29564 E AndroidRuntime: java.lang.NoSuchMethodError: No virtual method parse(Ljava/lang/String;Ljava/lang/String;)Lcom/android/i18n/phonenumbers/Phonenumber$PhoneNumber; in class Lcom/android/i18n/phonenumbers/PhoneNumberUtil; or its super classes (declaration of 'com.android.i18n.phonenumbers.PhoneNumberUtil' appears in /system/framework/ext.jar)

10-23 23:00:59.652 29544 29564 E AndroidRuntime: at com.google.android.syncadapters.contacts.ContactHandler.formatPhoneNumber(ContactHandler.java:1272)

10-23 23:00:59.652 29544 29564 E AndroidRuntime: at com.google.android.syncadapters.contacts.ContactHandler.convertEntityToEntry(ContactHandler.java:1140)

10-23 23:00:59.652 29544 29564 E AndroidRuntime: at com.google.android.syncadapters.contacts.ContactsSyncAdapter.sendEntityToServer(ContactsSyncAdapter.java:839)

10-23 23:00:59.652 29544 29564 E AndroidRuntime: at com.google.android.syncadapters.contacts.ContactsSyncAdapter.processLocalChanges(ContactsSyncAdapter.java:802)

10-23 23:00:59.652 29544 29564 E AndroidRuntime: at com.google.android.syncadapters.contacts.ContactsSyncAdapter.innerPerformSync(ContactsSyncAdapter.java:374)

10-23 23:00:59.652 29544 29564 E AndroidRuntime: at com.google.android.syncadapters.contacts.ContactsSyncAdapter.onPerformLoggedSync(ContactsSyncAdapter.java:202)

10-23 23:00:59.652 29544 29564 E AndroidRuntime: at com.google.android.syncadapters.contacts.delegation.SyncAdapterProxy.onPerformLoggedSync(SyncAdapterProxy.java:128)

10-23 23:00:59.652 29544 29564 E AndroidRuntime: at com.google.android.common.LoggingThreadedSyncAdapter.onPerformSync(LoggingThreadedSyncAdapter.java:33)

10-23 23:00:59.652 29544 29564 E AndroidRuntime: at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)

10-23 23:00:59.780 29544 29564 I Process : Sending signal. PID: 29544 SIG: 9

*******

I think that this issue is related to the changelog of "libphonenumber" (version 8.7.0) that you can find here:

https://github.com/googlei18n/libphonenumber/blob/master/release_notes.txt

*******

- [Java only] Changing public APIs that take in strings representing phone

numbers or parts of phone numbers to take in CharSequence instead. Updating

some of the internal methods to do the same. This affects ShortNumberInfo and

PhoneNumberUtil, namely the following methods:

- parse & parseAndKeepRawInput

- formatWithCarrierCode & formatWithPreferredCarrierCode

- isNumberMatch

- isPossibleNumber

- isAlphaNumber

*******

I found that libphonenumber library has been updated to v.8.7.1 from 8.3.3 into the crdroid repositories at the end of July:

https://github.com/crdroidandroid/a...mmit/05120d357e218d2f9d4dc97bae2cb929483fb507

I think that from this commit the contacts syncing stopped working.

I've just found this post in xda where someone found the causes and a possible solution to this issue:

https://xdaforums.com/showpost.php?p=74033107&postcount=215

I think that use the proposed ext.jar file is not a good solution but I think that someone of you, with these information, could modify the right code into the crdroid repositories to solve definitely the problem.

[MENTION=4258086]firebird11[/MENTION]: Could you solve this issue in this crdroid 3.x branch?

Also this link could be useful: https://github.com/robolectric/robolectric/issues/3320

Thanks...