【发布时间】:2021-05-29 19:52:18
【问题描述】:
我正在从 Cocos Creator V2.4.3 导出的 android 项目中构建 apk,但使用 Gradle 时出现以下错误
A problem occurred configuring project ':game'.
> java.lang.NullPointerException (no error message)
我已经删除了所有的 android SDK、NDK 并重新安装了 Android Studio,然后重新更新了 SDK、NDK、Build Tool。 但是错误仍然存在。
一些配置:
Android SDK = 23、26、28、30
SDK 构建工具 = 30.0.3
NDK = 19.2.5345600
Gradle 版本:4.10.3
Gradle 插件版本:3.2.0
JDK:jdk1.8.0_281
build.gradle 看起来像这样
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
有人知道应该如何解决这个问题吗?
【问题讨论】:
标签: android-studio gradle nullpointerexception apk cocos2d-js