1

Closed

cannot Sync

description

04-10 15:07:37.897: E/AndroidRuntime(351): FATAL EXCEPTION: ModernAsyncTask #1
04-10 15:07:37.897: E/AndroidRuntime(351): java.lang.RuntimeException: An error occured while executing doInBackground()
04-10 15:07:37.897: E/AndroidRuntime(351): at android.support.v4.content.ModernAsyncTask$3.done(ModernAsyncTask.java:137)
04-10 15:07:37.897: E/AndroidRuntime(351): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
04-10 15:07:37.897: E/AndroidRuntime(351): at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
04-10 15:07:37.897: E/AndroidRuntime(351): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
04-10 15:07:37.897: E/AndroidRuntime(351): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
04-10 15:07:37.897: E/AndroidRuntime(351): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
04-10 15:07:37.897: E/AndroidRuntime(351): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
04-10 15:07:37.897: E/AndroidRuntime(351): at java.lang.Thread.run(Thread.java:1019)
04-10 15:07:37.897: E/AndroidRuntime(351): Caused by: java.lang.NoSuchMethodError: android.database.sqlite.SQLiteQueryBuilder.buildQuery
04-10 15:07:37.897: E/AndroidRuntime(351): at pl.selvin.android.syncframework.content.BaseContentProvider.query(BaseContentProvider.java:402)
04-10 15:07:37.897: E/AndroidRuntime(351): at pl.selvin.android.ListSyncSample.provider.ListProvider.query(ListProvider.java:21)
04-10 15:07:37.897: E/AndroidRuntime(351): at android.content.ContentProvider$Transport.query(ContentProvider.java:187)
04-10 15:07:37.897: E/AndroidRuntime(351): at android.content.ContentResolver.query(ContentResolver.java:262)
04-10 15:07:37.897: E/AndroidRuntime(351): at android.support.v4.content.CursorLoader.loadInBackground(CursorLoader.java:49)
04-10 15:07:37.897: E/AndroidRuntime(351): at android.support.v4.content.CursorLoader.loadInBackground(CursorLoader.java:35)
04-10 15:07:37.897: E/AndroidRuntime(351): at android.support.v4.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:240)
04-10 15:07:37.897: E/AndroidRuntime(351): at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:51)
04-10 15:07:37.897: E/AndroidRuntime(351): at android.support.v4.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:40)
04-10 15:07:37.897: E/AndroidRuntime(351): at android.support.v4.content.ModernAsyncTask$2.call(ModernAsyncTask.java:123)
04-10 15:07:37.897: E/AndroidRuntime(351): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)

comments

Selvin wrote Apr 11, 2012 at 8:46 AM

error at 402 line of basecontentprovider.java ... this buildQuery method appear only in API > 11 ... temporary you should comment this line(it just log) i'll fix it in new release

BLOZZY wrote Apr 11, 2012 at 1:31 PM

here this comes up then

:41.461: D/pl.selvin.android.syncframework.content.BaseContentProvider(395): CP-update-sync: content://pl.selvin.android.ListSyncSample/pl_selvin_android_syncframework_dosync/DefaultScopeSyncService/defaultscope
04-11 13:08:41.471: E/pl.selvin.android.syncframework.content.BaseContentProvider(395): ParseException
04-11 13:08:41.471: E/pl.selvin.android.syncframework.content.BaseContentProvider(395): java.lang.IllegalArgumentException: Host name may not be null
04-11 13:08:41.471: E/pl.selvin.android.syncframework.content.BaseContentProvider(395): at org.apache.http.HttpHost.<init>(HttpHost.java:83)
04-11 13:08:41.471: E/pl.selvin.android.syncframework.content.BaseContentProvider(395): at org.apache.http.impl.client.AbstractHttpClient.determineTarget(AbstractHttpClient.java:497)
04-11 13:08:41.471: E/pl.selvin.android.syncframework.content.BaseContentProvider(395): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
04-11 13:08:41.471: E/pl.selvin.android.syncframework.content.BaseContentProvider(395): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
04-11 13:08:41.471: E/pl.selvin.android.syncframework.content.BaseContentProvider(395): at pl.selvin.android.syncframework.content.BaseContentProvider.Sync(BaseContentProvider.java:567)
04-11 13:08:41.471: E/pl.selvin.android.syncframework.content.BaseContentProvider(395): at pl.selvin.android.syncframework.content.BaseContentProvider.update(BaseContentProvider.java:437)
04-11 13:08:41.471: E/pl.selvin.android.syncframework.content.BaseContentProvider(395): at android.content.ContentProvider$Transport.update(ContentProvider.java:228)
04-11 13:08:41.471: E/pl.selvin.android.syncframework.content.BaseContentProvider(395): at android.content.ContentProviderClient.update(ContentProviderClient.java:77)
04-11 13:08:41.471: E/pl.selvin.android.syncframework.content.BaseContentProvider(395): at pl.selvin.android.ListSyncSample.syncadapter.SyncAdapter.onPerformSync(SyncAdapter.java:34)
04-11 13:08:41.471: E/pl.selvin.android.syncframework.content.BaseContentProvider(395): at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:164)
04-11 13:08:41.482: D/pl.selvin.android.syncframework.content.BaseContentProvider(395): CP-Sync: 0 d, 0 h, 0 m, 0 s, 14 m


thx

Selvin wrote Apr 13, 2012 at 2:50 PM

orginal we have:
        if (BuildConfig.DEBUG) {
            Log.d("Query", builder.buildQuery(projection, selection, null,
                    null, sortOrder, null));
        }

to fix it on API < 11 change it to:
        if (BuildConfig.DEBUG) {
            Log.d("Query", builder.buildQuery(projection, selection,
                    selectionArgs, null, null, sortOrder, null));
        }
or comment this whole code

i've just tested on 2.3.3 emulator and it works ... your new error is something other seems like service uri is wrong

public class Setup implements SetupInterface {
@Override
public String getServiceUrl() {
    return Constants.SERVICE_URI;
}
...
}