2

i have building problem in android studio, i have made an android app with beeware and when i am trying to build it i get an error.

I have tried building it from android studio and i fixed all the versions problems and everything else except this error

Could not find method leftShift() for arguments [build_m0k5smvps1e1hvx1einev6dw$_run_closure1@34e45104] on task ':buildPythonDebug' of type org.gradle.api.DefaultTask.

I searched for answers but i didn't found something useful

this is the build.gradle

    buildscript {
repositories {
    jcenter()
    google()
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.4.0'
}
}

task buildPythonDebug << {
exec {
    commandLine "voc -v -p app -o build/intermediates/classes/debug   app".split()
}
exec {
    commandLine "voc -v -p app_packages -o build/intermediates/classes/debug app_packages".split()
}
}

task buildPythonRelease << {
exec {
    commandLine "voc -v -p app -o build/intermediates/classes/release app".split()
}
exec {
    commandLine "voc -v -p app_packages -o build/intermediates/classes/release app_packages".split()
}
}
task run << {
exec {
    commandLine "adb shell am start -n com.example.HelloWorld/android.AppName".split()
}
}

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
}
sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        res.srcDirs = ['res']
    }
}
}

project.afterEvaluate {
packageDebug.dependsOn buildPythonDebug
packageRelease.dependsOn buildPythonRelease
run.dependsOn installDebug
}

dependencies {
implementation 'com.android.support:appcompat-v7:25.3.1'
implementation 'com.android.support:recyclerview-v7:25.3.1'
}
Wolfgang Fahl
  • 15,016
  • 11
  • 93
  • 186
Titus22
  • 33
  • 1
  • 5
  • `task name << {...}` is deprecated and was removed in 5.0. https://discuss.gradle.org/t/task-leftshift-closure-deprecation-clarification/20599 – Zoe May 02 '19 at 04:59

1 Answers1

4

For every task change it

from:

task abc << {
    .
    .
}

to:

task abc {
     doLast {
        .
        .
     }
}
Ali Kazi
  • 1,561
  • 1
  • 15
  • 22