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
Related
I've made my Android app tablet optimized and I followed the tutorial here:
Everything is great, but I am trying to select an item (say, the 1st item) with a button in the ActionBar.
I tried this answer to use performItemClick but on I've got error reports of java.lang.IllegalStateException
in android.support.v4.app.ListFragment.ensureList, java.lang.IllegalStateException: Content view not yet created, and java.lang.NullPointerException
in android.content.ComponentName.<init>
I've tried checking if the ListView is null and still get the error reports on the Play Store. How do I properly select an item in my list programmatically?
Update to add logcat and the code is virtually identical to the tutorials in the links:
Logcat A:
java.lang.IllegalStateException: Content view not yet created
at android.support.v4.app.ListFragment.ensureList(ListFragment.java:328)
at android.support.v4.app.ListFragment.getListView(ListFragment.java:222)
at com.ccwilcox.meteorshower.MeteorList.showMeteorDetails(MeteorList.java:69)
at com.ccwilcox.meteorshower.MeteorList.onListItemClick(MeteorList.java:62)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:298)
at android.widget.AbsListView.performItemClick(AbsListView.java:1280)
at com.ccwilcox.meteorshower.MainActivity.viewUpcomingEvent(MainActivity.java:648)
at com.ccwilcox.meteorshower.MainActivity.onOptionsItemSelected(MainActivity.java:534)
at android.app.Activity.onMenuItemSelected(Activity.java:2606)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:361)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:1045)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:592)
at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:149)
at android.view.View.performClick(View.java:4222)
at android.view.View$PerformClick.run(View.java:17273)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Logcat B:
java.lang.NullPointerException
at android.content.ComponentName.<init>(ComponentName.java:75)
at android.content.Intent.<init>(Intent.java:2874)
at com.ccwilcox.meteorshower.MeteorList.showMeteorDetails(MeteorList.java:86)
at com.ccwilcox.meteorshower.MeteorList.onListItemClick(MeteorList.java:62)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:284)
at android.widget.ListView.performItemClick(ListView.java:3701)
at com.ccwilcox.meteorshower.MainActivity.viewUpcomingEvent(MainActivity.java:648)
at com.ccwilcox.meteorshower.MainActivity.onOptionsItemSelected(MainActivity.java:534)
at android.app.Activity.onMenuItemSelected(Activity.java:2205)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:361)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:779)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:861)
at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)
at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)
at android.view.View$PerformClick.run(View.java:9152)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Update 2
And here is the code that is causing the problem:
if (mListFragment.listView != null) {
mListFragment.listView.performItemClick(mListFragment.listView.getAdapter().getView(position, null, null), position, mListFragment.listView.getAdapter().getItemId(position));
}
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)?
I am getting following exception on android market for my app.
Exception class java.lang.IllegalArgumentException
Source method WindowManagerImpl.findViewLocked()
I am unable to understand why and where this is coming from? I never got this exception on my device. Does anybody have a clue how to solve this? Or see it on my device?
java.lang.IllegalArgumentException: View not attached to window manager
at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355)
at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200)
at android.view.Window$LocalWindowManager.removeView(Window.java:432)
at android.app.Dialog.dismissDialog(Dialog.java:278)
at android.app.Dialog.access$000(Dialog.java:71)
at android.app.Dialog$1.run(Dialog.java:111)
at android.app.Dialog.dismiss(Dialog.java:268)
at android.app.Dialog.cancel(Dialog.java:951)
at com.bappy.cror.GameActivity$17$1.run(GameActivity.java:719)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
at dalvik.system.NativeStart.main(Native Method)
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
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.