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

Reddit sample project won't build in android version 19 #22

Open
m3ltaw4y opened this issue Jul 1, 2016 · 5 comments
Open

Reddit sample project won't build in android version 19 #22

m3ltaw4y opened this issue Jul 1, 2016 · 5 comments
Labels

Comments

@m3ltaw4y
Copy link

m3ltaw4y commented Jul 1, 2016

Works fine for android 23.
Built from f538de3
changed
app.api_version = "23"
to
app.api_version = "19"
in config/android.rb

received following error during rake android:emulator

build/android/Development-19/java/com/yourcompany/reddit/ReachabilityDelegate.java:6: error: ConnectivityManager() is not public in ConnectivityManager; cannot be accessed from outside package
public ReachabilityDelegate() { super(); }
^
1 error
3 warnings
rake aborted!
Command failed with status (1): [/usr/bin/javac -d "build/android/Developme...]
/Users/tbomb/.rvm/gems/ruby-2.2.1/gems/rake-11.2.2/lib/rake/file_utils.rb:69:in block in create_shell_runner' /Users/tbomb/.rvm/gems/ruby-2.2.1/gems/rake-11.2.2/lib/rake/file_utils.rb:59:incall'
/Users/tbomb/.rvm/gems/ruby-2.2.1/gems/rake-11.2.2/lib/rake/file_utils.rb:59:in sh' /Users/tbomb/.rvm/gems/ruby-2.2.1/gems/rake-11.2.2/lib/rake/file_utils_ext.rb:37:insh'
/Library/RubyMotion/lib/motion/project/template/android.rb:537:in block (2 levels) in <top (required)>' /Library/RubyMotion/lib/motion/project/paralel_builder.rb:47:incall'
/Library/RubyMotion/lib/motion/project/paralel_builder.rb:47:in `block (2 levels) in initialize'
Tasks: TOP => build

@lrz
Copy link
Member

lrz commented Jul 1, 2016

Looks like the methods we use were introduced in API 21: https://developer.android.com/reference/android/net/ConnectivityManager.html

Maybe we should disable that Flow API if we target an Android API lower than 21?

@danhealy
Copy link

danhealy commented Jul 1, 2016

Is it possible to support lower versions by excluding some of the libraries? It's important due to current adoption rates https://developer.android.com/about/dashboards/index.html#Platform

@lrz
Copy link
Member

lrz commented Jul 1, 2016

Of course it's possible, we just need to programmatically check the version of Android and define the API accordingly. If you would like to submit a patch feel free!

@lrz
Copy link
Member

lrz commented Jul 1, 2016

Actually it might be better to do that at build time. We could isolate the problematic code in a .rb file and remove it from app.files in case the version of Android is lower.

@jjaffeux
Copy link
Contributor

jjaffeux commented Jul 3, 2016

I would like to have tests working on Android in RM before doing this kind of api version fixes, so we can start tests with different api platforms, otherwise it will become a nightmare to maintain.

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

No branches or pull requests

5 participants