I found different answers relating to this issue but non worked for me, so am not sure if I have added something wrong somewhere.
Error:
Gradle sync failed: No signature of method: com.android.build.gradle.AppPlugin.getNdkFolder() is applicable for argument types: () values: []
build.gradle module
apply plugin: 'com.android.application'
import org.apache.tools.ant.taskdefs.condition.Os
android {
compileSdkVersion 21
buildToolsVersion "21"
defaultConfig {
applicationId 'com.domain.game'
minSdkVersion 11
targetSdkVersion 11
ndk {
moduleName "cocos2dcpp_shared"
}
sourceSets.main {
jni.srcDirs = []
jniLibs.srcDir 'src/main/libs'
java.srcDirs += '../../Classes'
assets.srcDirs = ['../../Resources']
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
}
task buildNative(type: Exec, description: 'Compile JNI source via NDK') {
def ndkDir = project.plugins.findPlugin('com.android.application').getNdkFolder()
//def ndkDir = project.plugins.findPlugin('com.android.application').getNdkFolder()
if(Os.isFamily(Os.FAMILY_WINDOWS))
commandLine "${ndkDir}\\ndk-build.cmd",'-C', file('src/main/jni').absolutePath, '-j', Runtime.runtime.availableProcessors(), 'all'
else
commandLine "${ndkDir}/ndk-build",'-C', file('src/main/jni').absolutePath, '-j', Runtime.runtime.availableProcessors(), 'all'
}
task cleanNative(type: Exec, description: 'Clean JNI object files') {
def ndkDir = project.plugins.findPlugin('com.android.application').getNdkFolder()
if(Os.isFamily(Os.FAMILY_WINDOWS))
commandLine "${ndkDir}\\ndk-build.cmd",'-C', file('src/main/jni').absolutePath, 'clean'
else
commandLine "${ndkDir}/ndk-build",'-C', file('src/main/jni').absolutePath, 'clean'
}
clean.dependsOn 'cleanNative'
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn buildNative
}
dependencies {
compile project(':googleplayservices_lib')
compile files('libs/OpenIAB-0.9.6-sync2.jar')
compile files('libs/android-support-v4.jar')
compile files('libs/GiftizSDK_1.5.0.jar')
}
build.gradle project
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}
allprojects {
repositories {
jcenter()
}
}
gradle-wrapper.properties
#Thu Apr 06 06:38:18 BST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
Any help would be much appreciated.
Thanks
Update:
local.properties
ndk.dir=C\:\\AndroidEclipse\\android-ndk-r10e
sdk.dir=C\:\\AndroidEclipse\\SDK
It fails on this line def ndkDir = project.plugins.findPlugin('com.android.application').getNdkFolder()
use plugins.getPlugin('com.android.application').sdkHandler.ndkFolder or android.ndkDirectory instead.
Related
I am trying to build a flutter app I get so many problems while building it and found a solutions for all of them but now I am stuck since the morning with this one:
> Task :firebase_auth:generateDebugRFile FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':firebase_auth:generateDebugRFile'.
> Could not resolve all files for configuration ':firebase_auth:debugCompileClasspath'.
> Could not find browser-1.0.0.aar (androidx.browser:browser:1.0.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/browser/browser/1.0.0/browser-1.0.0.aar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 37s
my project build.gradle:
buildscript {
ext.kotlin_version = '1.5.31'
repositories {
google()
jcenter()
maven {
url 'http://storage.googleapis.com/r8-releases/raw'
}
}
dependencies {
classpath 'com.android.tools:r8:2.1.75'
classpath 'com.google.gms:google-services:4.3.2'
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
my app build.gradle:
buildscript {
repositories {
// ...
maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal
}
dependencies {
// ...
// OneSignal-Gradle-Plugin
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.6, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 30
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}
defaultConfig {
applicationId "com.inspireui.fluxstore"
minSdkVersion 20
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
resConfigs "en"
manifestPlaceholders = [
onesignal_app_id: 'PUT_YOUR_ONESIGNAL_APP_ID_HERE',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: 'REMOTE'
]
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.browser:browser:1.3.0'
// For checking GMS availability.
implementation "com.google.android.gms:play-services-base:17.6.0"
// Fix duplicate exoplayer
implementation 'com.google.android.exoplayer:exoplayer:2.14.1'
}
googleServices { disableVersionCheck = true }
//Fix android-r issue
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
afterEvaluate {project ->
if (project.hasProperty("android") && project.property("android").compileSdkVersion.equals("android-R")) {
android {
compileSdkVersion 30
}
}
}
}
gradle.propertis:
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
Solutions I tried:
invalidate cache and restart
flutter clean && flutter pub get
gradlew clean && gradlew build
delete the %USER%/.android and %USER%/.gradle and delete every thing related to android studio and reinstalled it
use a VPN ( tried 3 )
but unfortunatly, nothing helped me
for further info: I am building fluxstore app
I still think its a connection issue . is maven google available in your browser with no VPN ?
if no then here is a old solution of mine , on how to configure gradle to use you VPN properly . Because you need to tell gradle to send request over VPN using gradle.properties file .
When compiling project(build apk) it returns error:
e: C:\Users\1\FlutterSDK\flutter\.pub-cache\hosted\pub.dartlang.org\rtmp_publisher-0.3.7\android\src\main\kotlin\com\app\rtmp_publisher\Camera.kt: (634, 49): Unresolved reference: startStream
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':rtmp_publisher:compileReleaseKotlin'.
> Compilation error. See log for more details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Version Kotlin is relevant
Gradle file android\build.gradle:
buildscript {
ext.kotlin_version = '1.5.10'
repositories {
google()
jcenter()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
classpath 'com.android.tools.build:gradle:4.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Gradle file android\app\build.gradle:
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 30 // was 28
// added for rtmp
packagingOptions {
exclude 'project.clj'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "youinroll.com"
minSdkVersion 23
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
versionCode 3
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
shrinkResources false
minifyEnabled false
}
}
allprojects {
repositories {
google()
mavenCentral()
maven{url "https://storage.googleapis.com/download.flutter.io"}
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
The application has broadcast using the phone-camera, the problem is in it.
Apparently problem is in connectimg java and kotlin.
Updating and deleting flutter/gradle perfomed.
I faced this exact same issue after upgrading the project and gradle settings.
I managed to fix this by reducing kotlin version to
ext.kotlin_version = '1.3.50'
This started giving code compiling issue, for this, I removed this line from build.gradle file
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
I am trying to convert a .aar package to a .jar package according to the title above. I have tried several procedures(including those mentioned here), but all without success. It seems that it is necessary to convert all the contents of the package (including resources, manifest, etc.) to .jar.
The reason for this is that I need to publish .jar files together with my library in an artifactory repository, since .aar gets the following error when referencing it in 'libs /' in the assemble process:
Execution failed for task ':integration-lib:bundleReleaseAar'.
> Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR.
Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :integration-lib project caused this error: /Users/thomas/Projetos/mobile-integration-lib/integration-lib/libs/PPCompAndroid-v1.32.aar
I also tried to import it by creating a new module with .jar/.aar file and referencing it in the library gradle, but it is not deployed in the artifactory repository.
My Gradle library:
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'
def application = new Application()
class Application {
def packageName = 'com.soufan.integration-lib'
def versionMajor = 0
def versionMinor = 0
def versionPatch = 27
def versionName() {
return (versionPatch > 0 ? "${versionMajor}.${versionMinor}.${versionPatch}" : "${versionMajor}.${versionMinor}")
}
def static gitVersion() {
def process = ['/bin/bash', '-c', 'git rev-list HEAD | wc -l | xargs'].execute()
return process.text.toInteger()
}
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.0"
defaultConfig {
minSdkVersion 22
targetSdkVersion 30
versionCode application.gitVersion()
versionName application.versionName()
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
publishing {
publications {
aar(MavenPublication) {
groupId application.getPackageName()
version application.versionName()
artifactId project.getName()
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.compile.allDependencies.each { dependency ->
if (dependency.group != null) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dependency.group)
dependencyNode.appendNode('artifactId', dependency.name)
dependencyNode.appendNode('version', dependency.version)
}
}
}
}
}
}
artifactory {
contextUrl = URL_DEPLOY
publish {
repository {
repoKey = DEPLOY_REPO_KEY
username = USER_NAME
password = API_KEY
}
defaults {
publications('aar')
publishArtifacts = true
properties = ['qa.level': 'basic', 'dev.team': 'core']
publishPom = true
}
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
implementation 'com.squareup.okhttp3:okhttp:4.0.1'
// Dependencies
implementation files('libs/NeptuneLiteApi_V2.04.00_20180329.jar')
implementation files('libs/PPCompAndroid-v1.32.aar')
implementation files('libs/libposdigital-1.5.1-4-release.aar')
implementation files('libs/zoop-emv-connect-pax-a920-pos_0.10.jar')
}
My Project Gradle:
buildscript {
ext.kotlin_version = "1.3.72"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.10.0"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
For historical reason instrumentation tests are not stored in androidTests directory as required and i can't change directories structure (actually whole app is tests for the library used). I was able to build and install apk with gradle, but no tests were found:
:app-tests:connectedDebugAndroidTest
Tests on test_avd(AVD) - 4.1.2 failed: Instrumentation run failed due to 'java.lang.ClassNotFoundException'
com.android.builder.testing.ConnectedDevice > No tests found.[test_avd(AVD) - 4.1.2] FAILED
No tests found. This usually means that your test classes are not in the form that your test runner expects (e.g. don't inherit from TestCase or lack #Test annotations).
:app-tests:connectedDebugAndroidTest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app-tests:connectedDebugAndroidTest'.
> There were failing tests. See the report at: file:///Users/asmirnov/Documents/dev/src/project/app-tests/build/reports/androidTests/connected/index.html
Actually the tests are in src folder, written correctly and can be built/runned using Ant:
public abstract class BaseTest extends AndroidTestCase
{
...
public class AppInfoTest extends BaseTest
{
#Test
public void testAllProperties()
{
...
...
How can i make Gradle process src folder as android (instrumentation) tests?
Here is my current build.gradle file (it uses the experimental Android Gradle plugin version 0.7.2 because we have an NDK library):
apply plugin: 'com.android.model.application'
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
}
repositories {
mavenLocal()
mavenCentral()
}
model {
android {
compileSdkVersion 16
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "app.tests"
minSdkVersion.apiLevel 9
targetSdkVersion.apiLevel 16
versionCode 359
versionName "1.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
sources {
main {
// overriding paths from default ones to actual ones
// what about 'androidTests' ?
manifest { source {
srcDir '.'
include 'AndroidManifest.xml'
} }
java { source { srcDirs = ['src'] } }
res { source { srcDirs = ['res'] } }
jni {
dependencies {
project ":library" // native library dependency
}
}
}
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':library')
}
UPDATE 1 (for sschuberth):
Config:
apply plugin: 'com.android.model.application'
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
}
repositories {
mavenLocal()
mavenCentral()
}
model {
android {
compileSdkVersion 16
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "app.tests"
minSdkVersion.apiLevel 9
targetSdkVersion.apiLevel 16
versionCode 359
versionName "1.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
sourceSets {
androidTest {
manifest.srcFile 'AndroidManifest.xml' // error here
java.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':library')
}
Error
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/asmirnov/Documents/dev/src/project/app-tests/build.gradle' line: 32
* What went wrong:
A problem occurred configuring project ':app-tests'.
> Exception thrown while executing model rule: android { ... } # app-tests/build.gradle line 16, column 5
> Could not find property 'manifest' on source set 'android test'.
Not completely sure this will work for your scenario, but you can update the root of the androidTest sourceSet like this
android {
sourceSets {
androidTest.setRoot('src')
}
}
There is also a test source set if it's just Java code, nothing Android specific.
You could also play around with the java.srcDir setting...
The above setting will look at these locations for your files.
<project>/<module>/src/AndroidManifest.xml
<project>/<module>/src/java
If you'd like to move both into the /src directory, you can use
sourceSets {
androidTest {
setRoot 'src'
java.srcDirs = ['src']
}
}
More Android Gradle details can be read at Configuring the Structure
You are welcome to debug these settings yourself with this setup
sourceSets {
androidTest {
setRoot 'src'
java.srcDirs = ['./src']
}
println "androidTest.manifest.srcFile = ${androidTest.manifest.srcFile}"
println "androidTest.java.srcDirs = ${androidTest.java.srcDirs}"
}
When you just clean the project, you'll see those lines being printed to the console
Instead of sources {} you should use sourceSets {} and the androidTest source set to customize the test source code location:
model { // Required for experimental plugin.
android {
sourceSets {
androidTest {
manifest.srcFile '../AppTest/AndroidManifest.xml'
java.srcDirs = ['../AppTest/src']
res.srcDirs = ['../AppTest/res']
assets.srcDirs = ['../AppTest/assets']
}
}
}
}
Note that this not not apply to unit test. For unit test (like with Robolectric), use the test source set.
It was tricky solution: to use experimental gradle plugin to compile native code with NDK and regular gradle plugin for test app.
build.gradle:
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
// experimental gradle plugin for the library to compile native code with NDK
classpath "com.android.tools.build:gradle-experimental:0.7.2"
// regular gradle plugin for the tests
classpath 'com.android.tools.build:gradle:2.1.2'
}
}
subprojects {
task listAllDependencies(type: DependencyReportTask) {}
}
library gradle (experimental):
apply plugin: 'com.android.model.library'
...
model {
android {
...
ndk {
moduleName = "library-jni"
cppFlags.add("-std=c++11")
cppFlags.add("-fexceptions")
stl = "c++_static"
abiFilters.addAll(['armeabi-v7a', 'x86']) // supported abis only
}
...
}
...
}
app/build.gradle (regular):
apply plugin: 'com.android.application'
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
}
repositories {
mavenLocal()
mavenCentral()
}
android {
compileSdkVersion 16
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "app.tests"
minSdkVersion 9
targetSdkVersion 16
versionCode 359
versionName "1.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
}
androidTest {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
jni {
dependencies {
project ":library"
}
}
}
}
}
dependencies {
androidTestCompile project(':library')
androidTestCompile fileTree(include: ['*.jar'], dir: 'libs')
}
beginner android developer so not a lot of experience on how the gradle works, I've tried looking at other examples but I still cant get my problem. Basically, I've just downloaded one of the sample projects from google android developer examples, and cant successfully build the project. I keep getting: Gradle sync failed: Gradle DSL method not found: 'compile()'
The app gradle is:
apply plugin: 'com.android.application'
android {
enforceUniquePackageName = false
compileSdkVersion android_compile_version
buildToolsVersion android_version
defaultConfig {
minSdkVersion android_min_sdk_version
targetSdkVersion android_compile_version
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile "com.android.support:appcompat-v7:${appcompat_library_version}"
compile "com.android.support:support-v4:${support_library_version}"
compile project(':libraries:BaseGameUtils')
compile 'com.google.android.gms:play-services:4.3.23'
}
buildscript {
repositories {
jcenter()
}
}
and as for the project gradle:
// this is the parent build configuration for all the sample projects.
// for more information on gradle build files when used in a multi-project build, see
// http://gradle.org/docs/current/userguide/multi_project_builds.html
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
// allprojects apply to every project
allprojects {
repositories {
jcenter()
}
ext {
android_compile_version = 23
android_version = '23.0.1'
android_min_sdk_version = 9
appcompat_library_version = '23.0.1'
support_library_version = '23.0.1'
gms_library_version = '8.1.0'
}
}