GaiaX icon indicating copy to clipboard operation
GaiaX copied to clipboard

GaiaXAndroidDemo Android Studio 编译报错

Open jiyun-hu opened this issue 1 year ago • 1 comments

描述这个问题

GaiaXAndroidDemo Android Studio 编译报错

A problem occurred configuring project ':GXAnalyzeAndroid'.

Failed to notify project evaluation listener. java.lang.NullPointerException (no error message) Could not get unknown property 'debug' for SoftwareComponentInternal set of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.

复现步骤

可通过分步复现该问题:

  1. git clone 项目
  2. Android Studio 打开编译 GaiaXAndroidDemo 项目
  3. gradle 报错

预期正确的结果

GaiaXAndroidDemo 项目能正确编译、运行

截图

客户端 (请填写如下信息) : Android Studio 版本: Android Studio Koala | 2024.1.1 Patch 1 Build #AI-241.18034.62.2411.12071903, built on July 11, 2024 Runtime version: 17.0.11+0-17.0.11b1207.24-11852314 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 13.4 GC: G1 Young Generation, G1 Old Generation Memory: 4096M Cores: 10 Metal Rendering is ON Registry: ide.experimental.ui=true Non-Bundled Plugins: ASM Bytecode Viewer (9.7)

崩溃日志 在这里添加崩溃日志

附加信息 在这里添加有关该问题的任何其他信息。

jiyun-hu avatar Oct 23 '24 03:10 jiyun-hu

注释掉 GaiaX/GaiaXAnalyze/GXAnalyzeAndroid/build.gradle 文件下 from components.debug

afterEvaluate {
    publishing {
        publications {
            // Creates a Maven publication called "release".
            release(MavenPublication) {

                if (project.hasProperty("type")) {
                    if (project.getProperty("type").equals("release")) {
                        from components.release
                    } else {
                        from components.debug
                    }
                } else {
                    //**注释掉这一行**  from components.debug
                }

                if (project.hasProperty("version")) {
                    version = project.getProperty("version")
                } else {
                    version = '0.0.0'
                }
                if (project.hasProperty("group")) {
                    groupId = project.getProperty("group")
                } else {
                    groupId = 'com.github.alibaba.GaiaX'
                }

                artifactId = 'GaiaX-Analyze'
            }
        }
    }
}

jiyun-hu avatar Oct 23 '24 09:10 jiyun-hu