I've been given a project to help with, but I cannot get it to work, and those who gave it to me are as stumped as I am. We're working on making an android software for Google Glass, using Android Studio 2.1.2. Also we've been setting up SDK and such.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
}
allprojects {
repositories {
jcenter()
}
}
android {
compileSdkVersion 'Google Inc.:Glass Development Kit Preview:19'
buildToolsVersion '23.0.1'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
}
That's the main build.gradle file. Then, in the app-folder, if that's important, this file lies. Also build.gradle.
apply plugin: 'com.android.application'
repositories {
jcenter()
}
android {
compileSdkVersion 'Google Inc.:Glass Development Kit Preview:19'
buildToolsVersion '23.0.1'
final def config = defaultConfig {
unimportant stuff
}
config
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
things
}
}
dexOptions {
hopefully unimportant
}
productFlavors {
}
}
dependencies {
a considerable amount
}
Now, I get the problem "Gradle DSL method not found: android()". There are more questions on here that ask about that. So, following the advice of those who answer, I attempted deleting the android and dependency things from the top gradle. I ended up with the following error. "Failed to set up SDK. Module 'app': platform 'Google Inc.:Glass Development Kit Preview:19' not found." This despite everything else is set up.
Now, note, the code as it looks obviously works, as it does for those who I got the code from. Something is very wrong on my end. I'm asking the good people of the internet, do you know what might be wrong?