You are using the wrong build.gradle
file.
In your top-level file you can’t define an android
block.
Just move this part inside the module/build.gradle
file.
android {
compileSdkVersion 17
buildToolsVersion '23.0.0'
}
dependencies {
compile files('app/libs/junit-4.12-JavaDoc.jar')
}
apply plugin: 'maven'
More Related Contents:
- Android Studio: Add jar as library?
- How to manually include external aar package using Gradle for Android
- Android studio adds unwanted permission after running application on real device
- Android Material and appcompat Manifest merger failed
- Adding local .aar files to Gradle build using “flatDirs” is not working
- android studio 0.4.2: Gradle project sync failed error
- Why are there two build.gradle files in an Android Studio project?
- Android dependency has different version for the compile and runtime
- Execution failed for task ‘:app:compileDebugAidl’: aidl is missing
- How to get current flavor in gradle
- Gradle DSL method not found: ‘runProguard’
- Gradle error: Minimum supported Gradle version is 3.3. Current version is 3.2
- Autoincrement VersionCode with gradle extra properties
- Android Studio Gradle issue upgrading to version 0.5.0 – Gradle Migrating From 0.8 to 0.9 – Also Android Studio upgrade to 0.8.1
- Error:Execution failed for task ‘:app:transformResourcesWithMergeJavaResForDebug’
- Android Studio: Resolving Duplicate Classes
- Error : Please fix the version conflict either by updating the version of the google-services plugin
- Conflict with dependency ‘com.android.support:support-annotations’. Resolved versions for app (23.1.0) and test app (23.0.1) differ
- How do I read properties defined in local.properties in build.gradle
- How to include a library module dependency in an Android Studio project?
- Gradle is failing on syncing my project in the new Android Studio 2.0
- Dex error On Android Studio 3.0 Beta4
- Unable to resolve dependency for ‘:app@debug/compileClasspath’: Could not resolve
- Error:Execution failed for task ‘:ProjectName:mergeDebugResources’. > Crunching Cruncher *some file* failed, see logs
- Android Studio: Re-download dependencies and sync project
- How to exclude res folder from gradle build flavours?
- Could not find property ‘outputFile’ on com.android.build.gradle.internal.api.ApplicationVariantImpl
- Android build gradle is too slow (Dependency Resolution)
- Failed to resolve: com.google.firebase:firebase-core:11.2.0
- Android using Gradle Build flavors in the code like an if case