-
Couldn't load subscription status.
- Fork 4.2k
Update build for Android Studio 3.0 #445
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
Conversation
|
saw the reported issue: https://stackoverflow.com/questions/47023424/gadle-3-0-flavor-error-duplicate-class too. |
hello-jni/app/build.gradle
Outdated
| android { | ||
| compileSdkVersion 25 | ||
| buildToolsVersion '25.0.2' | ||
| buildToolsVersion '26.0.2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this line.
You no longer need to explicitly specify the build tools version. AGP uses a recommended default automatically :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| compile fileTree(dir: 'libs', include: ['*.jar']) | ||
| compile 'com.android.support:appcompat-v7:25.2.0' | ||
| compile 'com.android.support.constraint:constraint-layout:1.0.1' | ||
| compile 'com.android.support:appcompat-v7:25.4.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use global properties here?
See: https://developer.android.com/studio/build/gradle-tips.html#configure-project-wide-properties
(And yeah, I just noticed that I specify buildToolsVersion in the sample. I'll remove it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is good point, will use this global feature in multi-module project environment. This one is one module project, keep it in one place for simplicity case.
hello-jni/build.gradle
Outdated
|
|
||
| allprojects { | ||
| repositories { | ||
| jcenter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put google() first, before jcenter().
Believe it or not, certain things features, such as like running Lint checks on Kotlin code from the command line, doesn't work unless you include google() first (don't ask me why).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, will change other samples too
|
uploaded with fix from code review, @adarshf, may you kindly have one more look? thanks |
adding 'flavorDimensions' for for hello-jni for Android Studio 3.0 requirements. @rschiu, @jomof, @qchong may you kindly take a look?