Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


View constant conversion errors aren't very clear #252

baroquebobcat opened this Issue · 4 comments

2 participants

Nick Howard Uwe Kubosch
Nick Howard

When you attempt to use a symbol for a view value, and there isn't a constant it maps to, you get an error with a message like cannot convert instance of class org.jruby.RubySymbol to int from the ruboto/widgets.rb file. It'd be nice if the error was more specific. eg :match_parent doesn't have a corresponding View constant, maybe directing people to the docs for ViewGroup.LayoutParams and Gravity as those are where the constants are converted from.

I ran into this because the default generated activity is not android-7 compatible as it uses :match_parent which was introduced in android-8.

Uwe Kubosch donv was assigned
Uwe Kubosch

Hi @baroquebobcat !

Sorry for the late response. I'll take a look at improving the error message to something more helpful.

Not so good that our activity template fails on android-7, but is android-7 an interesting target anymore?

Uwe Kubosch

Revisiting this now.

Uwe Kubosch donv referenced this issue from a commit
Uwe Kubosch donv * Issue #252 View constant conversion errors aren't very clear
* Added a hopefully better error message when a constant is not found.
Uwe Kubosch

Hi @baroquebobcat !

Does this look better? The error message has been changes like you requested.

Uwe Kubosch donv closed this
Nick Howard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.