每次我尝试构建microG时,都会出现这个错误:
$ ./gradlew build
Skipping debug jar:microg-ui-tools:preBuild UP-TO-DATE
:microg-ui-tools:preDebugBuild UP-TO-DATE
:microg-ui-tools:checkDebugManifest
:microg-ui-tools:preDebugAndroidTestBuild UP-TO-DATE
:microg-ui-tools:preDebugUnitTestBuild UP-TO-DATE
:microg-ui-tools:preReleaseBuild UP-TO-DATE
:microg-ui-tools:preReleaseUnitTestBuild UP-TO-DATE
:microg-ui-tools:prepareComAndroidSupportAnimatedVectorDrawable2531Library
:microg-ui-tools:prepareComAndroidSupportAppcompatV72531Library
:microg-ui-tools:prepareComAndroidSupportPreferenceV142531Library
:microg-ui-tools:prepareComAndroidSupportPreferenceV72531Library
:microg-ui-tools:prepareComAndroidSupportRecyclerviewV72531Library
:microg-ui-tools:prepareComAndroidSupportSupportCompat2531Library
:microg-ui-tools:prepareComAndroidSupportSupportCoreUi2531Library
:microg-ui-tools:prepareComAndroidSupportSupportCoreUtils2531Library
:microg-ui-tools:prepareComAndroidSupportSupportFragment2531Library
:microg-ui-tools:prepareComAndroidSupportSupportMediaCompat2531Library
:microg-ui-tools:prepareComAndroidSupportSupportV42531Library
:microg-ui-tools:prepareComAndroidSupportSupportVectorDrawable2531Library
:microg-ui-tools:prepareComTakisoftFixPreferenceV725310Library
:microg-ui-tools:prepareDebugDependencies
:microg-ui-tools:compileDebugAidl UP-TO-DATE
:microg-ui-tools:compileDebugNdk UP-TO-DATE
:microg-ui-tools:compileLint UP-TO-DATE
:microg-ui-tools:copyDebugLint UP-TO-DATE
:microg-ui-tools:compileDebugRenderscript UP-TO-DATE
:microg-ui-tools:generateDebugBuildConfig UP-TO-DATE
:microg-ui-tools:generateDebugResValues UP-TO-DATE
:microg-ui-tools:generateDebugResources UP-TO-DATE
:microg-ui-tools:mergeDebugResources
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
:microg-ui-tools:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':microg-ui-tools:mergeDebugResources'.
> java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2.932 secs
这是在一个无头服务器上进行的,甚至没有安装X服务器!除了mergeReleaseResources
之外,发行版也会出现这种情况。我尝试使用--info
和--debug
运行,但它并没有给我任何有用的信息。我还尝试切换到使用Oracle的JDK而不是OpenJDK,并在构建机器上安装本地X服务器,但这也没有改变任何东西。这是从存储库中新克隆的副本,尽管我认为错误不特定于microG。
这里是我的运行结果:./gradlew build --stacktrace
:https://gist.github.com/milkey-mouse/cb6b75b5116cf369603dec46e214e914
java.awt.headless=true
添加到不同的配置文件和环境变量中,最终将它添加到gradle.properties
中才奏效!谢谢! - MilkeyMouse