Ceylon on Android

100 views
Skip to first unread message

Stephane Epardaud

unread,
Jun 2, 2016, 9:11:02 AM6/2/16
to ceylon...@googlegroups.com, ceylon-dev
You can find all the info on how to run Ceylon on Android here: http://ceylon-lang.org/blog/2016/06/02/ceylon-on-android/

Feel free to try this and report any issues you find. Or better yet, contribute :)

Cheers!
--
Stéphane Épardaud

Gavin King

unread,
Jun 2, 2016, 10:04:03 AM6/2/16
to ceylo...@googlegroups.com, ceylon...@googlegroups.com
Yay!
> --
> You received this message because you are subscribed to the Google Groups
> "ceylon-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ceylon-dev+...@googlegroups.com.
> To post to this group, send email to ceylo...@googlegroups.com.
> Visit this group at https://groups.google.com/group/ceylon-dev.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ceylon-dev/CAKU9E9tozaS0-cFjmVYdzQZUKu-U9JxzaETVsNb4xm_QJsUVwg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
Gavin King
ga...@ceylon-lang.org
http://profiles.google.com/gavin.king
http://ceylon-lang.org
http://hibernate.org
http://seamframework.org

Rohit Mohan

unread,
Jun 4, 2016, 10:43:36 AM6/4/16
to ceylon-dev, ceylon...@googlegroups.com

I tried using Ceylon with Android today with some popular Android libraries and couldn’t get all of them to work.

The libraries that I tried were:

  • Retrofit (A popular HTTP client for Android)
  • Picasso/Glide (Two image downloading and caching libraries)
  • Butterknife (Field and method binding for Android views)

Out of all these, I could get only Retrofit to work.

With Picasso, I get this error. (Similar error with Glide)

Modules containing the following packages need to be declared as imports:
(Tip: try running again with the '--show-suggestions' option)
    com.squareup.okhttp ... [shared]
ceylon import-jar: Problems were found, aborting.
:app:compileDebugCeylonWithCeylonc FAILED

With butterknife, I get this.

Note: Visiting transitive dependencies for com.android.support.support-annotations/23.4.0 
    shared com.android.support.support-annotations/23.4.0 ... [OK, but seems unused]
Note: Visiting transitive dependencies for com.jakewharton.butterknife-annotations/8.0.1 
    shared com.jakewharton.butterknife-annotations/8.0.1 ... [OK, but seems unused]
Modules containing the following packages need to be declared as imports:
(Tip: try running again with the '--show-suggestions' option)
    android.support.v4.graphics.drawable
ceylon import-jar: Problems were found, aborting.
:app:compileDebugCeylonWithCeylonc FAILED

I'm not sure if I'm doing something wrong on my part.

--

Rohit Mohan

Stephane Epardaud

unread,
Jun 6, 2016, 9:44:03 AM6/6/16
to ceylon...@googlegroups.com, ceylon-dev
So the problem with picasso is that it has an optional dependency on okhttp and the methods I use in Gradle's API to traverse dependencies do not list optional dependencies, so I'm looking for a workaround.

--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users...@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/35b8878c-538c-4dce-9453-94a3d284e1bd%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Stéphane Épardaud

Stephane Epardaud

unread,
Jun 6, 2016, 11:10:29 AM6/6/16
to ceylon...@googlegroups.com, ceylon-dev
And the second one is due to a missing dependency in the descriptor. I just released version 0.0.5 of the Gradle Ceylon Android plugin, where you can set `ceylon { forceImports true }` to bypass Maven descriptor issues.

Let me know how it works for you?

Thanks!
--
Stéphane Épardaud

Rohit Mohan

unread,
Jun 6, 2016, 12:44:58 PM6/6/16
to ceylon...@googlegroups.com, ceylon-dev
Thanks. The project with Butterknife builds now. But the app crashes when I run it and I get this error:

https://gist.github.com/rohitmohan96/6e6d3729fb8bc909bf4cbadef317e8e8 

Stephane Epardaud

unread,
Jun 28, 2016, 8:16:23 AM6/28/16
to ceylon-dev
Hi, Can you test with the latest 0.0.6 Gradle Android Ceylon plugin and a new distrib? It should support APT now, at least enough for butterknife.

There's a trick, though, it's that you have to declare your injected value with `@packageProtected shared late` annotations, because it's an annotation limited to fields and we can't make fields public in Ceylon, hence the `@packageProtected` compiler annotation trick.

Can you let me know if it works for you?

Thanks, cheers.

--
You received this message because you are subscribed to the Google Groups "ceylon-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-dev+...@googlegroups.com.
To post to this group, send email to ceylo...@googlegroups.com.
Visit this group at https://groups.google.com/group/ceylon-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-dev/CAF7ZTx%2BROjJaDGCPnQYgd2JTEpXcp8hG4utJcXn%2BZ188Ad%2BnaQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Stéphane Épardaud
Reply all
Reply to author
Forward
0 new messages