Gradle 无法将依赖项添加到我的LibGDX项目中的gdx pd

Gradle 无法将依赖项添加到我的LibGDX项目中的gdx pd,gradle,libgdx,puredata,libpd,Gradle,Libgdx,Puredata,Libpd,各位!!我正在尝试向in build.gradle添加依赖项,但当我尝试对项目进行synk时,出现以下错误: 原因:groovy.lang.MissingPropertyException:无法获取类型为org.gradle.api.internal.artifacts.dsl.dependency.DefaultDependencyHandler的对象的未知属性“pdVersion” 这是我的Gradle文件的外观: buildscript { repositories { mav

各位!!我正在尝试向in build.gradle添加依赖项,但当我尝试对项目进行synk时,出现以下错误:

原因:groovy.lang.MissingPropertyException:无法获取类型为org.gradle.api.internal.artifacts.dsl.dependency.DefaultDependencyHandler的对象的未知属性“pdVersion”

这是我的Gradle文件的外观:

buildscript {


repositories {
    mavenLocal()
    mavenCentral()
    maven { url "https://plugins.gradle.org/m2/" }
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    jcenter()
    google()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.6.1'


}
}

所有项目{

version = '1.0'
ext {
    appName = "audio-demo"
    gdxVersion = '1.9.10'
    roboVMVersion = '2.3.7'
    box2DLightsVersion = '1.4'
    ashleyVersion = '1.7.0'
    aiVersion = '1.8.0'
}

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
    google()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}

项目(“:桌面”){ 应用插件:“java库”

}

项目(“:android”){ 应用插件:“android”

}

项目(“核心”){ 应用插件:“java库”

}

如果我尝试像这样指定$pdVersion:

ext {
    ...
    pdVersion = '0.7.0'
}
我得到另一个错误:

错误:未能解析:net.mgsx.gdx:gdx pd:0.7.0 在“项目结构”对话框中显示 受影响的模块:核心 错误:未能解析:net.mgsx.gdx:gdx pd:0.7.0 在“项目结构”对话框中显示 受影响模块:android


我做错了什么?提前谢谢你

该库的自述文件说它在Maven Central(或任何公共Maven repo)上都不可用,因此您必须在本地构建它并发布到本地Maven repo。
configurations { natives }

dependencies {
    implementation project(":core")
    api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
    api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
    natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
    natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
    natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a"
    natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
    natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
    api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
    natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
    api "net.mgsx.gdx:gdx-pd-backend-android:$pdVersion"
    natives "net.mgsx.gdx:gdx-pd-platform:$pdVersion:natives-armeabi"
    natives "net.mgsx.gdx:gdx-pd-platform:$pdVersion:natives-armeabi-v7a"
    natives "net.mgsx.gdx:gdx-pd-platform:$pdVersion:natives-arm64-v8a"
    natives "net.mgsx.gdx:gdx-pd-platform:$pdVersion:natives-x86"
    natives "net.mgsx.gdx:gdx-pd-platform:$pdVersion:natives-x86_64"
}
dependencies {
    api "com.badlogicgames.gdx:gdx:$gdxVersion"
    api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
    api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
    api "net.mgsx.gdx:gdx-pd:$pdVersion"
}
ext {
    ...
    pdVersion = '0.7.0'
}