android - 构建 Android 应用程序时出现问题,LeftShift 错误

标签 android android-gradle-plugin build.gradle build-error beeware

我在 android studio 中遇到构建问题,我用 beeware 制作了一个 android 应用程序,当我尝试构建它时出现错误。

我尝试从 android studio 构建它,并且修复了所有版本问题以及除此错误之外的所有其他问题

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

我搜索了答案,但没有找到有用的东西

这是 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'
}

最佳答案

对每个任务进行更改

来自:

task abc << {
    .
    .
}

至:

task abc {
     doLast {
        .
        .
     }
}

关于android - 构建 Android 应用程序时出现问题,LeftShift 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55942909/

相关文章:

Android:如何在 ListView 中永久删除一个项目?

android - java.lang.NoClassDefFoundError : com. google.android.gms.R$styleable 仅当布局文件中存在 map fragment 时

Android 构建错误 : Program type already present: android. support.v7.app.**

Gradle 加载 Groovy 3 库

android - 由于缺少库,IntelliJ 无法构建 Gradle 项目

android - Google Play 控制台警告 : Unknown validation VALIDATE_APP_MESSAGE_NO_APKS

java - 是否可以使用 Android NDK 在 Android 应用程序中集成 IPOPT 等 C++ 求解器?

android - gradle junit测试报告不是xml格式

android - 导入项目时Android Studio中的Gradle同步错误

android - 如何将 Google Play 服务修订版与安装版本匹配?