Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Issue #2

Closed
Gauloix opened this issue May 28, 2015 · 3 comments
Closed

Android Issue #2

Gauloix opened this issue May 28, 2015 · 3 comments

Comments

@Gauloix
Copy link

Gauloix commented May 28, 2015

When building Android project, got this error :

cannot access bolts.Task
    [javac] class file for bolts.Task not found
    [javac]                     ParseInstallation.getCurrentInstallation().saveInBackground();

There is no bolts-android-1.1.4.jar in platforms/android/libs.

thank you @grrrian !

@Gauloix Gauloix changed the title Android Bolt Error Android Issue May 28, 2015
@Gauloix
Copy link
Author

Gauloix commented May 28, 2015

I manually copied bolts-android-1.1.4.jar in platforms/android/libs.

Now, I can build and run the app.
parsePlugin.initialize is working.

parsePlugin.subscribe fail and crash the app.

In adb logcat, I have found this :

E/AndroidRuntime(19435): FATAL EXCEPTION: pool-2-thread-2
E/AndroidRuntime(19435): Process: com.project.app, PID: 19435
E/AndroidRuntime(19435): java.lang.IllegalStateException: PushService.subscribe, PushService.unsubscribe, and PushService.setDefaultPushCallback methods cannot be used in conjunction with ParsePushBroadcastReceiver. See ParsePush.subscribe and ParsePush.unsubscribe.
E/AndroidRuntime(19435):    at com.parse.PushService.checkManifestAndThrowExceptionIfNeeded(PushService.java:417)
E/AndroidRuntime(19435):    at com.parse.PushService.subscribe(PushService.java:297)
E/AndroidRuntime(19435):    at com.parse.PushService.subscribe(PushService.java:262)
E/AndroidRuntime(19435):    at org.apache.cordova.core.ParsePlugin$6.run(ParsePlugin.java:147)
E/AndroidRuntime(19435):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/AndroidRuntime(19435):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/AndroidRuntime(19435):    at java.lang.Thread.run(Thread.java:818)
W/ActivityManager(  778):   Force finishing activity com.project.app/.MainActivity

Any idea ?

@grrrian
Copy link
Owner

grrrian commented May 28, 2015

Ok, it seems like you have installed plugins on top of one another and they are conflicting. My plugin does not use setDefaultPushCallback.

You probably installed avivais' branch before installing mine. You should of uninstalled his plugin first.

I would make a backup of what you have (or use some sort of source control system like Git), then using the command line:

  1. uninstall the plugin: $ cordova platform rm com.parse.cordova.core.pushplugin
  2. re-install from my repo: $ cordova plugin add https://github.com/grrrian/phonegap-parse-plugin --variable APP_ID=PARSE_APP_ID --variable CLIENT_KEY=PARSE_CLIENT_KEY

If this was not enough, try removing platforms/android: $ cordova platform rm android and repeat steps 1 and 2.

@grrrian
Copy link
Owner

grrrian commented May 29, 2015

Never mind, there was actually a bug in the code. I fixed it but I didn't have the time to test it-- I don't use subscriptions in my app. Can you pull my latest branch and try it out? Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants