As it took me some time to find the solution for this error, I post my problem and solution here in the hope that I find it next time faster:
Error:(39, 0) Gradle DSL method not found: 'minSdkVersion()'
What I tried to do:
I followed the Android Test Blueprint's sample to define the library versions in the top level / rootProject'S build.gradle file:
ext { minSdkVersion 16 }
And wanted to use it in the app's/module's build.gradle file:
minSdkVersion rootProject.ext.minSdkVersion
After half an hour or so I notices that this was a simple typo -.-
Solution
Add the "=" sign when you define a variable, else, Gradle thinks you call an Android method which it does not yet know in the top level build file:
ext { minSdkVersion = 16 }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With