Search suggestions fail in 2.2 - android

My application uses in-app search, dynamically builds search suggestions on each request, puts them in a MatrixCursor and returns the suggestions to be displayed. Info on search suggestions here:
http://developer.android.com/guide/topics/search/adding-custom-suggestions.html
This works perfectly fine in 2.1-update1, but when I loaded it on a 2.2 phone, I get a fatal error when I try to search. Here is the relevant logs:
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): error changing cursor and caching columns
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): java.lang.NumberFormatException: My String Message
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at java.lang.Long.parse(Long.java:364)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at java.lang.Long.parseLong(Long.java:354)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at java.lang.Long.parseLong(Long.java:320)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.database.MatrixCursor.getLong(MatrixCursor.java:255)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.database.CursorWrapper.getLong(CursorWrapper.java:127)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.widget.CursorAdapter.getItemId(CursorAdapter.java:156)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.widget.AutoCompleteTextView.buildDropDown(AutoCompleteTextView.java:1248)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1137)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:1019)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:1002)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.app.SearchDialog.onDataSetChanged(SearchDialog.java:612)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.app.SuggestionsAdapter.notifyDataSetChanged(SuggestionsAdapter.java:193)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.widget.CursorAdapter.changeCursor(CursorAdapter.java:260)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.app.SuggestionsAdapter.changeCursor(SuggestionsAdapter.java:238)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.widget.CursorFilter.publishResults(CursorFilter.java:67)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:282)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.os.Handler.dispatchMessage(Handler.java:99)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.os.Looper.loop(Looper.java:123)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at java.lang.reflect.Method.invokeNative(Native Method)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at java.lang.reflect.Method.invoke(Method.java:521)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-22 12:13:05.935: ERROR/SuggestionsAdapter(1028): at dalvik.system.NativeStart.main(Native Method)
07-22 12:13:05.935: DEBUG/AndroidRuntime(1028): Shutting down VM
07-22 12:13:05.935: WARN/dalvikvm(1028): threadid=1: thread exiting with uncaught exception (group=0x4001d7f0)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): FATAL EXCEPTION: main
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): java.lang.NumberFormatException: My String Message
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at java.lang.Long.parse(Long.java:364)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at java.lang.Long.parseLong(Long.java:354)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at java.lang.Long.parseLong(Long.java:320)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at android.database.MatrixCursor.getLong(MatrixCursor.java:255)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at android.database.CursorWrapper.getLong(CursorWrapper.java:127)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at android.widget.CursorAdapter.getItemId(CursorAdapter.java:156)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at android.widget.AutoCompleteTextView.buildDropDown(AutoCompleteTextView.java:1248)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at android.widget.AutoCompleteTextView.showDropDown(AutoCompleteTextView.java:1137)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at android.widget.AutoCompleteTextView.updateDropDownForFilter(AutoCompleteTextView.java:1019)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at android.widget.AutoCompleteTextView.onFilterComplete(AutoCompleteTextView.java:1002)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:285)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at android.os.Handler.dispatchMessage(Handler.java:99)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at android.os.Looper.loop(Looper.java:123)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at java.lang.reflect.Method.invokeNative(Native Method)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at java.lang.reflect.Method.invoke(Method.java:521)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-22 12:13:05.945: ERROR/AndroidRuntime(1028): at dalvik.system.NativeStart.main(Native Method)
where "My String Message" is the value of the SUGGEST_COLUMN_TEXT_1 field of the first (in this case only) row to be returned as a suggestion in the cursor. The stack trace does not touch my code at all, and following it in a debugger shows the error occurs some time after I return the suggestions cursor in my search suggestion content provider.
Why is their adapter suddenly trying to interpret a String as a Long? Has anyone else encountered this?
Thanks!

The code is failing when it's trying to access the ID column ("_id") which is required in any search suggestions cursor, and must be a Long.
Is it possible that you're not including that column, or, you're creating that column but writing your strings into it inadvertently?
See http://developer.android.com/guide/topics/search/adding-custom-suggestions.html#SuggestionTable

Just a reference for others who stuck, the column _id is case sensitive. Defining the column as "_ID" will FAIL and hit exception.

Related

Google play services lib NoClassDefFoundError

I've tried to use Location API from google-play-services-lib.
I've set up project according to the developer page
http://developer.android.com/google/play-services/setup.html
After running application it crashes with error. Logcat:
Failed resolving interface 1013
'Lcom/google/android/gms/location/LocationListener;
java.lang.NoClassDefFoundError: com.example.fragments.MyFragment
MyFragment implements LocationListener and GooglePlayServices interfaces.
I have spent lot of time by googling but no solution found. Can someone help? Thank you.
LOGCAT:
07-22 14:08:15.329: E/AndroidRuntime(13259): FATAL EXCEPTION: main
07-22 14:08:15.329: E/AndroidRuntime(13259): java.lang.NoClassDefFoundError:
com.example.fragments.MyFragment
07-22 14:08:15.329: E/AndroidRuntime(13259): at
com.example.fragments.BaseFragment.getPages(BaseFragment.java:80)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
com.example.fragments.BaseFragment.onCreate(BaseFragment.java:48)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.support.v4.app.Fragment.performCreate(Fragment.java:1477)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:893)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:570)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1164)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.app.Activity.performStart(Activity.java:5114)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2153)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.app.ActivityThread.access$600(ActivityThread.java:141)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.os.Looper.loop(Looper.java:137)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
android.app.ActivityThread.main(ActivityThread.java:5039)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
java.lang.reflect.Method.invokeNative(Native Method)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
java.lang.reflect.Method.invoke(Method.java:511)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-22 14:08:15.329: E/AndroidRuntime(13259): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-22 14:08:15.329: E/AndroidRuntime(13259): at dalvik.system.NativeStart.main(Native
Method)
#marlin
1) Go to project properties at java build path and check everything from order and export.
2) http://android-er.blogspot.in/2012/12/add-reference-library-google-play.html
Let me know if you are still struck with any issue
Thanks
I had the same situation, and in my case the problem was that I recently updated to a new android bundle (manually, by downloading the new bundle), but for some reason, I kept the old one on my PC, too. So, I had two different directories "adt-bundle-windows-x86-________" on my PC. Normally, this didn't pose any problems, but apparently, the Google Utils were updated into the older directory, while I was developing my app in the newer directory. This messed up the whole thing.
My solution was to move the older directory "adt-bundle-windows-x86-________" away so that there was only exactly 1 directory "adt-bundle-windows-x86-________" present on the PC. Then I updated everything to a clean state with the SDK Manager. From then on, things worked smoothly.
What I have done was to update everything to latest versions and switch to latest Android SDK in the project settings. My starting point was https://github.com/playgameservices/play-games-plugin-for-unity/issues/193

Signed Exported Android App failing with apache.commons.logging class cannot be converted to 'a.a.a.a.c'

My app runs perfectly when I "Run as Android Application" from Eclipse. In the past I've also successfully exported a signed version of the app.
Now, suddenly the exported version of the app crashes immediately. The key message seems to be
Caused by: a.a.a.a.b: The chosen LogFactory implementation does not extend LogFactory. Please check your configuration. (Caused by java.lang.ClassCastException: The application has specified that a custom LogFactory implementation should be used but Class 'org.apache.commons.logging.impl.LogFactoryImpl' cannot be converted to 'a.a.a.a.c'. Please check the custom implementation. Help can be found # http://commons.apache.org/logging/troubleshooting.html.).
Here are the Proguard settings. Am I missing something?
-dontwarn org.apache.**
-dontwarn org.apache.commons.logging.**
-ignorewarnings
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
The apache.org doc says:
A custom LogFactory implementation can only be used if the implementation class loaded dynamically at runtime can be cast to the LogFactory class that loaded it. There are several ways in which this cast can fail. The most obvious is that the source code may not actually extend LogFactory. The source may be compatible but if the LogFactory class against which the source is compiled is not binary compatible then the cast will also fail.
There is also another more unusual way in which this cast can fail: even when the binary is compatible, the implementation class loaded at runtime may be linked to a different instance of the LogFactory class. For more information, see the tech guide.
This situation may be encountered in containers which use a custom LogFactory implementation. The implementation will typically be provided in a shared, high level classloader together with JCL. When an application classloader contains LogFactory, the implementation will be loaded from that higher level classloader. The implementation class will be linked to the LogFactory class loaded by the higher level classloader. Even if the LogFactory implementations are binary compatible, since they are loaded by different classloaders the two LogFactory Class instances are not equal and so the cast must fail.
They go on to say potential Fixes include:
There are various ways to fix this problem. Which fix is right depends on the circumstances.
If you are happy using another classloading policy for the application, select a classloading policy which ensures that LogFactory will be loaded from the shared classloader containing the custom implementation.
If you want to bypass the container adaption mechanism then set the appropriate system property to the default value when the container is started:
-Dorg.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
If you want to continue to use the default container mechanism then:
• Find and replace the commons-logging implementation used by the container with the most modern release
• Replace the commons-logging jar in the application with the commons-logging-adapters jar. This will ensure that application classloader will delegate to it's parent when loading LogFactory.
I thought that the "-Dorg.apache.commons......" command would go into the proguard-project.txt file but that caused the app to fail to even be built. So bottom line, I don't understand what apache is trying to say and am hoping some of you experienced folks could provide some clarity/guidance.
Here's the stack trace:
07-22 02:49:32.109: E/AndroidRuntime(13589): FATAL EXCEPTION: AsyncTask #1
07-22 02:49:32.109: E/AndroidRuntime(13589): java.lang.RuntimeException: An error occured while executing doInBackground()
07-22 02:49:32.109: E/AndroidRuntime(13589): at android.os.AsyncTask$3.done(AsyncTask.java:299)
07-22 02:49:32.109: E/AndroidRuntime(13589): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
07-22 02:49:32.109: E/AndroidRuntime(13589): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
07-22 02:49:32.109: E/AndroidRuntime(13589): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
07-22 02:49:32.109: E/AndroidRuntime(13589): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
07-22 02:49:32.109: E/AndroidRuntime(13589): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
07-22 02:49:32.109: E/AndroidRuntime(13589): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
07-22 02:49:32.109: E/AndroidRuntime(13589): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
07-22 02:49:32.109: E/AndroidRuntime(13589): at java.lang.Thread.run(Thread.java:856)
07-22 02:49:32.109: E/AndroidRuntime(13589): Caused by: a.a.a.a.b: The chosen LogFactory implementation does not extend LogFactory. Please check your configuration. (Caused by java.lang.ClassCastException: The application has specified that a custom LogFactory implementation should be used but Class 'org.apache.commons.logging.impl.LogFactoryImpl' cannot be converted to 'a.a.a.a.c'. Please check the custom implementation. Help can be found #http://commons.apache.org/logging/troubleshooting.html.)
07-22 02:49:32.109: E/AndroidRuntime(13589): at a.a.a.a.c.a(Unknown Source)
07-22 02:49:32.109: E/AndroidRuntime(13589): at a.a.a.a.e.run(Unknown Source)
07-22 02:49:32.109: E/AndroidRuntime(13589): at java.security.AccessController.doPrivileged(AccessController.java:45)
07-22 02:49:32.109: E/AndroidRuntime(13589): at a.a.a.a.c.a(Unknown Source)
07-22 02:49:32.109: E/AndroidRuntime(13589): at a.a.a.a.c.h(Unknown Source)
07-22 02:49:32.109: E/AndroidRuntime(13589): at a.a.a.a.c.c(Unknown Source)
07-22 02:49:32.109: E/AndroidRuntime(13589): at a.a.b.f.b.b.<init>(Unknown Source)
07-22 02:49:32.109: E/AndroidRuntime(13589): at a.a.b.f.b.g.<init>(Unknown Source)
07-22 02:49:32.109: E/AndroidRuntime(13589): at toolbox.e.a(Unknown Source)
07-22 02:49:32.109: E/AndroidRuntime(13589): at toolbox.e.doInBackground(Unknown Source)
07-22 02:49:32.109: E/AndroidRuntime(13589): at android.os.AsyncTask$2.call(AsyncTask.java:287)
07-22 02:49:32.109: E/AndroidRuntime(13589): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
07-22 02:49:32.109: E/AndroidRuntime(13589): ... 5 more
07-22 02:49:32.109: E/AndroidRuntime(13589): Caused by: java.lang.ClassCastException: The application has specified that a custom LogFactory implementation should be used but Class 'org.apache.commons.logging.impl.LogFactoryImpl' cannot be converted to 'a.a.a.a.c'. Please check the custom implementation. Help can be found #http://commons.apache.org/logging/troubleshooting.html.
07-22 02:49:32.109: E/AndroidRuntime(13589): ... 17 more
07-22 02:49:32.169: E/(13589): <s3dReadConfigFile:75>: Can't open file for reading
07-22 02:49:32.169: E/(13589): <s3dReadConfigFile:75>: Can't open file for reading
07-22 02:49:32.359: E/SMD(176): DCD ON
07-22 02:49:33.090: E/MP-Decision(1545): DOWN Ld:36 Ns:1.100000 Ts:190 rq:0.400000 seq:196.000000
07-22 02:49:34.191: E/MP-Decision(1545): UP Ld:79 Nw:1.990000 Tw:140 rq:1.700000 seq:147.000000
07-22 02:49:35.353: E/SMD(176): DCD ON
07-22 02:49:36.734: E/Sensors(713): accelHandler -0.001198 -0.114961 10.077044
07-22 02:49:36.944: E/MP-Decision(1545): DOWN Ld:27 Ns:1.100000 Ts:190 rq:0.300000 seq:196.000000
07-22 02:49:38.356: E/SMD(176): DCD ON
07-22 02:49:38.977: E/MP-Decision(1545): UP Ld:36 Nw:1.990000 Tw:140 rq:2.800000 seq:147.000000
07-22 02:49:39.317: E/WifiP2pStateTracker(713): getNetworkInfo : NetworkInfo: type: WIFI_P2P[], state: DISCONNECTED/DISCONNECTED, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: true
07-22 02:49:39.447: E/ActivityThread(11387): Service com.facebook.katana.platform.PlatformService has leaked ServiceConnection com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation$BlueServiceConnection#4235a770 that was originally bound here
07-22 02:49:39.447: E/ActivityThread(11387): android.app.ServiceConnectionLeaked: Service com.facebook.katana.platform.PlatformService has leaked ServiceConnection com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation$BlueServiceConnection#4235a770 that was originally bound here
07-22 02:49:39.447: E/ActivityThread(11387): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:965)
07-22 02:49:39.447: E/ActivityThread(11387): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:859)
07-22 02:49:39.447: E/ActivityThread(11387): at android.app.ContextImpl.bindService(ContextImpl.java:1308)
07-22 02:49:39.447: E/ActivityThread(11387): at android.app.ContextImpl.bindService(ContextImpl.java:1300)
07-22 02:49:39.447: E/ActivityThread(11387): at android.content.ContextWrapper.bindService(ContextWrapper.java:401)
07-22 02:49:39.447: E/ActivityThread(11387): at com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation.f(DefaultBlueServiceOperationFactory.java:426)
07-22 02:49:39.447: E/ActivityThread(11387): at com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation.a(DefaultBlueServiceOperationFactory.java:384)
07-22 02:49:39.447: E/ActivityThread(11387): at com.facebook.katana.platform.PlatformService.b(PlatformService.java:184)
07-22 02:49:39.447: E/ActivityThread(11387): at com.facebook.katana.platform.PlatformService.a(PlatformService.java:36)
07-22 02:49:39.447: E/ActivityThread(11387): at com.facebook.katana.platform.PlatformService$MessageHandler.handleMessage(PlatformService.java:71)
07-22 02:49:39.447: E/ActivityThread(11387): at android.os.Handler.dispatchMessage(Handler.java:99)
07-22 02:49:39.447: E/ActivityThread(11387): at android.os.Looper.loop(Looper.java:137)
07-22 02:49:39.447: E/ActivityThread(11387): at android.app.ActivityThread.main(ActivityThread.java:4918)
07-22 02:49:39.447: E/ActivityThread(11387): at java.lang.reflect.Method.invokeNative(Native Method)
07-22 02:49:39.447: E/ActivityThread(11387): at java.lang.reflect.Method.invoke(Method.java:511)
07-22 02:49:39.447: E/ActivityThread(11387): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
07-22 02:49:39.447: E/ActivityThread(11387): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
07-22 02:49:39.447: E/ActivityThread(11387): at dalvik.system.NativeStart.main(Native Method)
07-22 02:49:39.517: E/Launcher(24512): Error finding setting, default accessibility to not found: accessibility_enabled
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): com.facebook.debug.log.TerribleFailure: Exception unbinding: OperationType{Operation Name=platform_authorize_app, forRemote=false}
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.debug.log.FbLogImpl.f(FbLogImpl.java:147)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.debug.log.FbLogImpl.a(FbLogImpl.java:118)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.debug.log.BLog.a(BLog.java:790)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation.e(DefaultBlueServiceOperationFactory.java:362)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation.d(DefaultBlueServiceOperationFactory.java:103)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation$1.b(DefaultBlueServiceOperationFactory.java:261)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.common.dispose.AbstractListenableDisposable.a(AbstractListenableDisposable.java:34)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation.c(DefaultBlueServiceOperationFactory.java:288)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation.a(DefaultBlueServiceOperationFactory.java:603)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation.b(DefaultBlueServiceOperationFactory.java:561)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation.c(DefaultBlueServiceOperationFactory.java:103)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation$4.run(DefaultBlueServiceOperationFactory.java:537)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at android.os.Handler.handleCallback(Handler.java:615)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at android.os.Handler.dispatchMessage(Handler.java:92)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at android.os.Looper.loop(Looper.java:137)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at android.app.ActivityThread.main(ActivityThread.java:4918)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at java.lang.reflect.Method.invokeNative(Native Method)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at java.lang.reflect.Method.invoke(Method.java:511)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at dalvik.system.NativeStart.main(Native Method)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): Caused by: java.lang.IllegalArgumentException: Service not registered: com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation$BlueServiceConnection#4235a770
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:917)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at android.app.ContextImpl.unbindService(ContextImpl.java:1338)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at android.content.ContextWrapper.unbindService(ContextWrapper.java:412)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): at com.facebook.fbservice.ops.DefaultBlueServiceOperationFactory$DefaultOperation.e(DefaultBlueServiceOperationFactory.java:357)
07-22 02:49:39.667: A/fb4a(:<default>):BlueServiceOperationFactory$Operation(11387): ... 17 more
I encountered the same problem when an external JAR in my project was using org.apache.commons.logging.impl.LogFactoryImpl.
It is worth noting that the JAR itself might have compiled classes from different packages, All residing within the JAR file. Just open the JAR and take a look.
In the proguard settings file you should declare all of the prefixes in the jar, e.g:
-keep org.apache.** { *; }
-keep com.somejar.** { *; }
Another option would be to tell proguard to ignore the entire JAR altogether.
also check: How can I exclude external .jar from obfuscation by Proguard (Android project)?

Android:TextToSpeech Not Working

Hi i create one application which is depend on TextToSpeech. When i am trying to run my
application It show the NullPointerException in Logcat. i search lot but didn't find helpful Answer.Here Check my Code on this link and Here is my logcat.
04-10 15:11:37.872: WARN/System.err(2798): java.lang.NullPointerException
04-10 15:11:37.872: WARN/System.err(2798): at com.example.examguide.ExamAppearingActivity.onCreate(ExamAppearingActivity.java:80)
04-10 15:11:37.872: WARN/System.err(2798): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-10 15:11:37.882: WARN/System.err(2798): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 15:11:37.882: WARN/System.err(2798): at android.os.Looper.loop(Looper.java:123)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread.main(ActivityThread.java:3683)
04-10 15:11:37.882: WARN/System.err(2798): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 15:11:37.892: WARN/System.err(2798): at java.lang.reflect.Method.invoke(Method.java:507)
04-10 15:11:37.892: WARN/System.err(2798): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-10 15:11:37.892: WARN/System.err(2798): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-10 15:11:37.892: WARN/System.err(2798): at dalvik.system.NativeStart.main(Native Method)
Any help is Appreciated...
you have used this code.
final List<ObjectiveWiseQuestion> QuestionWiseProfile1= db.getOneQuestion(examId);
but you have not opened db before. So it is getting null.
ok write
tts = new TextToSpeech(this, this);
before you use tts object.
The tts object is not initialized. Hence you get a null pointer exception there.

Sqliteexception while updating timestamp?

I have this code:
String sql="UPDATE LAST_OPEN SET LAST_OPEN="+DATE+" WHERE STUDENT_ID ="+STUDENT_ID+" AND ITEM_ID="+ITEM_ID+" AND ITEM_NAME="+ITEM_TYPE+";";
db.execSQL(sql);
Where LAST_OPEN field is timestamp.I tried to run the same query in SQlite Browser it was working fine.But when this Sql is executed in app it shows this:
02-13 13:12:39.468: E/AndroidRuntime(2366): FATAL EXCEPTION: main
02-13 13:12:39.468: E/AndroidRuntime(2366): android.database.sqlite.SQLiteException: near "13": syntax error: UPDATE LAST_OPEN SET LAST_OPEN=2012-02-13 13:12:39 WHERE STUDENT_ID =5 AND ITEM_ID=1 AND ITEM_NAME=Activity;
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)
-13 13:12:39.468: E/AndroidRuntime(2366): at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1727)
02-13 13:12:39.468: E/AndroidRuntime(2366): at com.cuelearn.databases.last_open.update(last_open.java:205)
02-13 13:12:39.468: E/AndroidRuntime(2366): at com.cuelearn.main.threeshelf$1.onClick(threeshelf.java:197)
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.view.View.performClick(View.java:2408)
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.view.View$PerformClick.run(View.java:8816)
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.os.Handler.handleCallback(Handler.java:587)
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.os.Handler.dispatchMessage(Handler.java:92)
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.os.Looper.loop(Looper.java:123)
02-13 13:12:39.468: E/AndroidRuntime(2366): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-13 13:12:39.468: E/AndroidRuntime(2366): at java.lang.reflect.Method.invokeNative(Native Method)
02-13 13:12:39.468: E/AndroidRuntime(2366): at java.lang.reflect.Method.invoke(Method.java:521)
02-13 13:12:39.468: E/AndroidRuntime(2366): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-13 13:12:39.468: E/AndroidRuntime(2366): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
Can anyone tell where I am getting wrong?
Try with this sql statement :
String sql="UPDATE LAST_OPEN SET LAST_OPEN='"+DATE+"' WHERE STUDENT_ID ="+STUDENT_ID+" AND ITEM_ID="+ITEM_ID+" AND ITEM_NAME="+ITEM_TYPE+";";
as I know, when you are using any string data in sql statement you need to add '' in the beginning of the variable and at the end of it.
Try to change
LAST_OPEN=2012-02-13 13:12:39
with
LAST_OPEN = "2012-02-13 13:12:39"
The space between the numbers can be the problem. Hope this helps.

Gridview with imageview and textview

I found this example http://www.firstdroid.com/2011/02/06/android-tutorial-gridview-with-icon-and-text/ but I get Force Close and I don't understand why...
In LogCat I get :
07-22 09:40:00.767: ERROR/AndroidRuntime(320): Caused by: java.lang.ClassNotFoundException: android.view.Linearlayout in loader dalvik.system.PathClassLoader#44dac780
07-22 09:40:00.767: ERROR/AndroidRuntime(320): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
07-22 09:40:00.767: ERROR/AndroidRuntime(320): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
07-22 09:40:00.767: ERROR/AndroidRuntime(320): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
07-22 09:40:00.767: ERROR/AndroidRuntime(320): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
07-22 09:40:00.767: ERROR/AndroidRuntime(320): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
07-22 09:40:00.767: ERROR/AndroidRuntime(320): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
07-22 09:40:00.767: ERROR/AndroidRuntime(320): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
Have anyone any idea?
In the example i think all the xml tags like LinearLayout, ImageView etc are lower case. That is causing the problm

Categories

Resources