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

A better fix for Google Play Services taking project properties #859

Merged
merged 3 commits into from
Mar 21, 2018

Conversation

yangtaufoo
Copy link
Contributor

An better extension of #858!

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion project.hasProperty('compileSdkVersion') ? project.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
Copy link
Owner

@evollu evollu Mar 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with gradle settings. curious here

  1. is project.hasProperty('compileSdkVersion') reading from main project so it is always defined?
  2. what is "18.+" for? you previous change was "11.+"

@yangtaufoo
Copy link
Contributor Author

yangtaufoo commented Mar 21, 2018

project.hasProperty(*) is reading the optional variables from the file android/build.gradle.

As it is optional, the user might not define it. As a fail safe when users do not define the variables, the default variables are there to make sure that compilation works.

I’ve made an error with the Google Play Services version. It should be 11.+ instead of 18.+

@@ -1,12 +1,17 @@
apply plugin: 'com.android.library'

def DEFAULT_COMPILE_SDK_VERSION = 26
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you change it back to 25? inline with react-native default

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I will do it. Any other requests?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks @evollu for reviewing in such short notice. Might want to update the readme to have a section where users can define their own Google Play Services version as per outlined in Android documentation (https://developer.android.com/studio/build/gradle-tips.html#configure-project-wide-properties)

@evollu evollu merged commit 5c56c7a into evollu:master Mar 21, 2018
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

Successfully merging this pull request may close these issues.

2 participants