I just installed android studio and updated the sdk. I created a new project, but it seems not to compile. There is a problem with gradle sync:
Error:(29, 0) Could not find method android() for arguments [build_st17khxxb7irr63f8isja72t$_run_closure4@3d9ba855] on root project 'MyApplication' of type org.gradle.api.Project.
This is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Some useless words because too much code
This is the build.gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
ext {
compileSdkVersion = 22
buildToolsVersion = '25.0.1'
}
}
android{
compileSdkVersion 22
buildToolsVersion '25.0.1'
dexOptions {
incremental true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}
}
dependencies {
compile files('app/libs/junit-4.12-JavaDoc.jar')
}