Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

gradle errors :not found property



  • hi all.
    I am going to continue a project which has made by another developer.this project run succesfully in his desktop.
    but
    I have problem with gradle.build.
    it makes error about keywords like android ,... .
    why it makes error only in my desktop ?
    here is my build.gradle file:

    buildscript {
    repositories {
    google()
    jcenter()
    }

    dependencies {
    

    classpath 'com.google.gms:google-services:4.3.1'

    classpath 'com.android.support:appcompat-v7:22.2.1'

    classpath 'com.parse.bolts:bolts-tasks:1.3.0'
    

    classpath 'com.parse:parse-android:1.11.0'

    classpath 'com.android.support:design:22.2.1'
    

    classpath 'com.android.support:design:22.2.1'

        classpath fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
        }
    }
    
    allprojects {
      apply plugin: 'com.android.application'
    }
    android {
        /*******************************************************
         * The following variables:
         * - androidBuildToolsVersion,
         * - androidCompileSdkVersion
         * - qt5AndroidDir - holds the path to qt android files
         *                   needed to build any Qt application
         *                   on Android.
         *
         * are defined in gradle.properties file. This file is
         * updated by QtCreator and androiddeployqt tools.
         * Changing them manually might break the compilation!
         *******************************************************/
    
        compileSdkVersion androidCompileSdkVersion.toInteger()
    
        buildToolsVersion androidBuildToolsVersion
        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
                aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
                res.srcDirs = [qt5AndroidDir + '/res', 'res']
                resources.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                assets.srcDirs = ['assets']
                jniLibs.srcDirs = ['libs']
           }
        }
    
        lintOptions {
            abortOnError false
        }
    }
    

    here is my gradle-wrapper
    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    distributionUrl=https://services.gradle.org/distributions/gradle-4.6-bin.zip
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists

    how can fix this error?

    A problem occurred evaluating root project 'android-build'.

    Plugin with id 'com.android.application' not found.



  • @ali1377
    when I delete plugin line it makes error to android line :

    What went wrong:
    A problem occurred evaluating root project 'android-build'.

    Could not find method android() for arguments [build_5kt6vfvn89yoapx6fdkq5cp9n$_run_closure2@42ef042a] on root project 'android-build' of type org.gradle.api.Project.

    why?
    I read some solution that say aboout top level gradle and module gradle (in android studio) but
    in qt do we have these file ?
    I have just build.gradle and gradle-wrapper .
    are they like perevios pair(top level gradle and module gradle) ?


Log in to reply