首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在gradle构建时未能应用插件[id 'com.chaquo.python']

在gradle构建时未能应用插件[id 'com.chaquo.python']
EN

Stack Overflow用户
提问于 2020-12-06 14:38:32
回答 1查看 1.1K关注 0票数 2

我试图在我的android应用程序中使用python,方法是使用chaquopy。我找到了在android 这里中集成chaqu伦的教程。我为app和项目级别更新我的分级文件。评估项目':app‘时出现了一个问题。

未能应用插件id 'com.chaquo.python‘没有这样的属性:类的dslScope :com.chaquo.python

下面是我的build.gradle应用程序级别的代码

代码语言:javascript
复制
apply plugin: 'com.android.application'
apply plugin: 'com.chaquo.python'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

defaultConfig {
    sourceSets {
        python {
            srcDirs = ["src/main/python"]
        }
    }

    python {
        buildPython "usr/bin/python3"
        buildPython "python3"
    }

    ndk {
        abiFilters "armeabi-v7a", "x86"
    }

    applicationId "com.softvision.nowyouseeus"
    minSdkVersion 19
    targetSdkVersion 29
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.mlkit:face-detection:16.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

}

bild.gradle项目级

代码语言:javascript
复制
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
    google()
    jcenter()
    maven {url "https://chaquo.com/maven"}
}
dependencies {
    classpath "com.android.tools.build:gradle:4.1.0"
    classpath 'com.chaquo.python:gradle:6.3.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-06 14:59:36

Chaqu皮6.3.0与Android插件版本4.1.0不兼容,你应该收到一个警告。

有关兼容组合,请参见这里。您可能应该升级到当前的Chaquopy版本9.0.0。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65169273

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档