Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GaiaXAndroidDemo Android Studio 编译报错 #495

Open
jiyun-hu opened this issue Oct 23, 2024 · 1 comment
Open

GaiaXAndroidDemo Android Studio 编译报错 #495

jiyun-hu opened this issue Oct 23, 2024 · 1 comment

Comments

@jiyun-hu
Copy link

描述这个问题

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
Copy link
Author

jiyun-hu commented Oct 23, 2024

注释掉 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'
            }
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant