Program type already present:
com.badlogic.gdx.graphics.g2d.freetype.FreeType$Pointer Message{kind=ERROR,
text=Program type already present:
com.badlogic.gdx.graphics.g2d.freetype.FreeType$Pointer,
sources=[Unknown source file], tool name=Optional.of(D8)}
我已经为此错误搜索了几天的解决方案,但找不到有效的解决方案。
其中一个模块,可能是"core",已经包含此库(freetype(。尝试将其从"android"部分中删除
//实现"com.badlogicgames.gdx:gdx freetype:$gdxVersion">
我没有找到任何freetype。它在缓存中。所以我只是使用使缓存无效
文件->使缓存无效并重新启动
第二个我评论了在所有节点中的双重实现,比如在"核心"节点中:
buildscript {
repositories {//instructions
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.badlogicgames.gdx:gdx-tools:1.9.8'//this addon
}
在同一个libGDX项目渐变文件中:
project(":core") {
apply plugin: "java"
dependencies {
implementation "com.badlogicgames.gdx:gdx:$gdxVersion"
// implementation 'com.badlogicgames.gdx:gdx-tools:1.9.8' } }
,然后我进行了编译,错误就消失了。现在终于可以生产APK 了
(不确定,但是,在此之前,已经在android gradle文件中评论了proguard路径。(
对我来说也有这个问题,但告诉我已经有了自己的类。我没有混淆任何api
或implementation
,没有任何重复。
帮助我的是手动删除项目的android/build
目录和core/build
目录并重新运行它