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

Crash on creating state machine builder on Android #29

Closed
agrusha opened this issue Dec 25, 2014 · 6 comments
Closed

Crash on creating state machine builder on Android #29

agrusha opened this issue Dec 25, 2014 · 6 comments

Comments

@agrusha
Copy link

agrusha commented Dec 25, 2014

I've tried android sample project you've mentioned on your 'examples' page using the latest released squirrel library.
It crashes while trying to instantiate StateMachineBuilderImpl.
The reason is in following: java.lang.management API is not a part of Android (http://stackoverflow.com/questions/19595814/android-add-java-lang-management-api)
and that is why it can not instantiate managementService that requires a bunch of methods from this package.
As I can see, managementService is used only if it was directly declared in configuration.
So, probably, it is possible to make way to instantiate StateMachineBuilder without involving java.lang.management package. If so - it would allow to revive Android build. And that would be great indeed!

@dant3
Copy link
Contributor

dant3 commented Dec 25, 2014

👍 I like the philosophy of not creating that you don't need.

@hekailiang
Copy link
Owner

Hi agrusha,

thanks for let me knowing about this problem.

I am not familiar with android, so I am not quite understand how Android would revive. Because ManagementService is still missing the java.lang.management package even I make instantiate StateMachineBuilder without involving java.lang.management package.

It would be helpful if you can give me more information about this. And also it would be great if you can provide a pull request.

@agrusha
Copy link
Author

agrusha commented Dec 26, 2014

Well... The actual crash appears to happen only at the moment when android tries to create the instance of ManagementService. As far as it is initiated during StateMachineBuilderImpl creation process it is inevitable that Android bumps into it and throws an exception. But if one makes the way not to initiate the ManagementService object if there is no need in it, then Android won't fall.
Actually I'm working on such sort of solution by myself. I'll let You know if I'd succeed in that.

@hekailiang
Copy link
Owner

Great, thanks!
But my understanding is that ManagementService will cause compile failure as it import javax.management.* which is missing in Android. And defer initiate ManagementService won't help. Is that true? If not, how you solved this problem?

@agrusha
Copy link
Author

agrusha commented Dec 26, 2014

No, importing does not lead to crash, only trying to use unsupported classes directly

@dant3
Copy link
Contributor

dant3 commented Dec 31, 2014

It looks like it was resolved in 8074cec, I tried 0.3.4 release with this fix cherry-picked and it works for me.

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

3 participants