No Class Def Found Error Android-Bolts Parse - java

I am using Android Studio (latest version) for developing my app. I use Parse as a backend solution. Everything was working smooth until i found out that parse have new release and i wanted to upgrade from Parse-1.7.1.jar to Parse-1.8.3.jar (latest version).
Since parse now use Bolts lib i also added the library like this:
compile 'com.parse.bolts:bolts-android:1.1.4'
Parse.initialize();
Also i use the facebook-sdk for dont know if this have to do anything with this mess.
All i get in my Application onCreate method is this error
03-08 22:07:05.841 24519-24533/ant.flow E/dalvikvm﹕ Could not find class 'bolts.Task$TaskCompletionSource', referenced from method com.parse.ParsePinningEventuallyQueue.waitForOperationSetAndEventuallyPin
03-08 22:07:05.841 24519-24519/ant.flow E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: ant.flow, PID: 24519
java.lang.NoClassDefFoundError: bolts.BoltsExecutors
at bolts.Task.<clinit>(Task.java:31)
at com.parse.ParseSQLiteDatabase.<init>(ParseSQLiteDatabase.java:45)
at com.parse.ParseSQLiteDatabase.openDatabaseAsync(ParseSQLiteDatabase.java:33)
at com.parse.ParseSQLiteOpenHelper.getDatabaseAsync(ParseSQLiteOpenHelper.java:43)
at com.parse.ParseSQLiteOpenHelper.getWritableDatabaseAsync(ParseSQLiteOpenHelper.java:39)
at com.parse.OfflineStore.findAsync(OfflineStore.java:390)
at com.parse.OfflineStore.findAsync(OfflineStore.java:354)
at com.parse.ParsePin.getParsePin(ParsePin.java:22)
at com.parse.ParseQuery.countFromLocalDatastoreAsync(ParseQuery.java:885)
at com.parse.ParseQuery.access$1700(ParseQuery.java:78)
at com.parse.ParseQuery$22.call(ParseQuery.java:1132)
at com.parse.ParseQuery$22.call(ParseQuery.java:1128)
at com.parse.ParseQuery.doWithRunningCheck(ParseQuery.java:912)
at com.parse.ParseQuery.countInBackground(ParseQuery.java:1128)
at com.parse.ParseInstallation.hasCurrentInstallationAsync(ParseInstallation.java:88)
at com.parse.GcmRegistrar.updateAsync(GcmRegistrar.java:96)
at com.parse.Parse.initialize(Parse.java:240)
at ant.flow.SocialApplication.onCreate(SocialApplication.java:33)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1025)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4581)
at android.app.ActivityThread.access$1600(ActivityThread.java:161)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1325)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5356)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)

Related

Android kotlin - app stopps when check if GPS is enabled

This is the code:
val gps_enabled = locationManager!!.isProviderEnabled(LocationManager.GPS_PROVIDER)
if(!gps_enabled) {
Log.d("letsSee", "GPS IS OFF")
}else{
Log.d("letsSee", "GPS IS ON")
}
The app crashes when I try to check for GPS whether it's on or off. Everything works fine without the check but I still need to check it!
Any ideas?
09-16 03:59:12.533 32454-32454/com.amoflirt.amoflirt E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
09-16 03:59:13.713 32454-32454/com.amoflirt.amoflirt E/AndroidRuntime: FATAL EXCEPTION: main
kotlin.KotlinNullPointerException
at com.amoflirt.amoflirt.MainActivity.getLocation(MainActivity.kt:95)
at com.amoflirt.amoflirt.MainActivity$onCreate$3.onClick(MainActivity.kt:67)
at android.view.View.performClick(View.java:4475)
at android.view.View$PerformClick.run(View.java:18786)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at dalvik.system.NativeStart.main(Native Method)
Make sure locationManager has been defined before you access it.
As a sidenote, you might be able to use Kotlin's lazy init:
val locationManager by lazy { //however you define it normally }
That will only initialize it once it's first accessed, and then keep that instance for the lifetime of the class.

App crashes when restoring from background

I have static values that are deleted after my application is a long time in the background or after opening many different apps, causing that my app crashes.
I think that Android OS is removing data from my app or "killing" it.
Is there any way to keep my app's data to avoid this problem?
NOTE: I can't save this values on SharedPreferences or in a database because there are many HashMaps and ArrayLists, is too much information.
It is necessary that these values are static because I need them available in many classes o my app in any time.
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.proyect/com.proyect.gui.ActivityMenu}: java.lang.NullPointerException: println needs a message
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2266)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316)
at android.app.ActivityThread.access$600(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1298)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:5225)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException: println needs a message
at android.util.Log.println_native(Native Method)
at android.util.Log.v(Log.java:117)
at com.proyect.gui.FragmentMenu.onActivityCreated(FragmentMenu.java:145)
at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:1983)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1092)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1234)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2046)
at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:174)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:597)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171)
at android.app.Activity.performStart(Activity.java:5143)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2239)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316) 
at android.app.ActivityThread.access$600(ActivityThread.java:150) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1298) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:213) 
at android.app.ActivityThread.main(ActivityThread.java:5225) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:525) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) 
at dalvik.system.NativeStart.main(Native Method) 
Change this:
Log.v("errorTag", e.getMessage());
To this:
String error = e.getMessage();
if(error == null)
error = "It's crashed here";
Log.v("errorTag", error );
OR SIMPLER
Log.v("errorTag", e );
The point is that e.getMessage() is null. So, always check if e.getMessage() is not null before print it

NullPointerException with ViewPager

My app accesses a webservice. I put in a search term and the app returns a list of articles relating to the search term i use. These articles are presented in listview. something very strange is happening and I have no idea what is going wrong. My app works perfectly when entering any search term. However, when i enter a very specific search term " ebola", a result returns, and is displayed in listview. However, when i click on an item in the listview, my app crashes. This only happens for this very specific search term and no other. It is really frustrating as my code obviously works but for some unknown reason not for this very particular search term.
StackTrace:
02-03 10:24:51.286 31560-31560/com.example.lifesci_pubmed W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41611d40)
02-03 10:24:51.288 31560-31560/com.example.lifesci_pubmed E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.lifesci_pubmed, PID: 31560
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.lifesci_pubmed/com.android.lifesci_pubmed.ArticlePagerActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
at android.app.ActivityThread.access$800(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5086)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.android.lifesci_pubmed.ArticlePagerActivity.onCreate(ArticlePagerActivity.java:66)
at android.app.Activity.performCreate(Activity.java:5248)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
at android.app.ActivityThread.access$800(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5086)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
The piece of code that is quoted as being responsible for the nullpointException:
String title = (String) getIntent().getStringExtra(ArticleFragment.EXTRA_TITLE);
for (int i = 0; i < articles.size(); i++) {
if (articles.get(i).getTitle().equals(title)) { // this line here
myViewPager.setCurrentItem(i);
I think articles.get(i).getTitle() returning null! Please provide the json you are receiving from the backend. Check for jsonException as well.

Android Array Out of Bound Exception

I have built a Android App thats has a WebView to show a mobile website within the app.
I have started to get this exception on one device particularly
This issue is not seen on other devices.
I went through the source code and it looks like an issue with Android. Can any one help me understand that if we can do anything else in the app to suppress this exception
Note: In the stack trace, there is nothing related to the app code
AndroidAppCrashDump {"brand":"samsung","model":"GT-S6312","sdk":16,"android":"4.1.2","appVersion":"1.1.15","manufacturer":"samsung"}----java.lang.ArrayIndexOutOfBoundsException: length=1; index=1109619192 at
java.util.Arrays.fill(Arrays.java:855) at
android.support.v4.widget.ViewDragHelper.clearMotionHistory(ViewDragHelper.java:773) at
android.support.v4.widget.ViewDragHelper.cancel(ViewDragHelper.java:499) at
android.support.v4.widget.ViewDragHelper.shouldInterceptTouchEvent(ViewDragHelper.java:1031) at
android.support.v4.widget.DrawerLayout.onInterceptTouchEvent(DrawerLayout.java:868) at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1877) at
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2237) at
an droid.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1979) at
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2237) at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1979) at
android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2237) at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1979) at
com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2177) at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1482) at
android.app.Activity.dispatchTouchEvent(Activity.java:2469) at
android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.dispatchTouchEvent(ActionBarActivityDelegateICS.java:260) at
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2125) at
android.view.View.dispatchPointerEvent(View.java:7414) at
android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3523) at
android.vi ew.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3455) at
android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4565) at
android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4543) at
android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4647) at
android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171) at
android.os.MessageQueue.nativePollOnce(Native Method) at
android.os.MessageQueue.next(MessageQueue.java:125) at
android.os.Looper.loop(Looper.java:124) at
android.app.ActivityThread.main(ActivityThread.java:4963) 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:1038) at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) at
dalvik.system.NativeStart.main(Native Method)

Service not registered: org.OpenUDID.OpenUDID_manager#2b038438

I have an application published in Google play and some time ago i received two error reports in my developer console which looks just like this:
java.lang.IllegalArgumentException: Service not registered: org.OpenUDID.OpenUDID_manager#2b038438
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:891)
at android.app.ContextImpl.unbindService(ContextImpl.java:921)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:352)
at org.OpenUDID.OpenUDID_manager.onServiceConnected(OpenUDID_manager.java:68)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1064)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1081)
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:3701)
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:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
at dalvik.system.NativeStart.main(Native Method)
and second:
java.lang.IllegalArgumentException: Service not registered: org.OpenUDID.OpenUDID_manager#40590d88
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:934)
at android.app.ContextImpl.unbindService(ContextImpl.java:952)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:352)
at org.OpenUDID.OpenUDID_manager.onServiceConnected(OpenUDID_manager.java:68)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1107)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1124)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:4293)
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:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Can somebody explain me what is all this about? Non of the specified packages in stack trace are from my app.
Some of the libraries which i use are adcolony and appbooster. (I suppose that this libs might be the cause of problem).
Have a great new year 2014.if the answer is feasible than raise the answer and points :)
Hi i think i got the this problem please have a look.
Make sur you are using correct context.
one of these days
mService.unbindService(mConnection);
is obviously nonsense, calling unbind in the wrong context. It should be
unbindService(mConnection);
Additional mistake in the posted coding is the missing of
#Override
public boolean onUnbind(Intent intent) {
// All clients have unbound with unbindService()
return false;
}

Categories

Resources