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

Allow build on system without fonts #201

Open
mtrakal opened this issue Aug 6, 2021 · 13 comments
Open

Allow build on system without fonts #201

mtrakal opened this issue Aug 6, 2021 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@mtrakal
Copy link

mtrakal commented Aug 6, 2021

I try to use version 4.0.0 with docker image without preinstalled fonts / font support in JDK.
In this case it's not possible to build app.

More info in: alvr/alpine-android#12

It would be nice when EasyLauncher could use some bundled font if it's possible.

@mateuszkwiecinski
Copy link
Member

Hey @mtrakal 👋

It would be nice when EasyLauncher could use some bundled font if it's possible.

Version 4.0 actually comes with bundled Roboto font as a fallback, so it should work in an environment without preinstalled fonts.

Matching your stacktrace with the source code the result points at a method responsible for finding proper text size, which relies on having the a font loaded, but clearly in your setup loading the default font also failed :/
I would guess it's enough to install fontconfig on a docker image, but as far as I can see you already did it and it didn't help 🤔 I won't have time to debug the issue this week, but I'll let you know as soon as I have any updates

@mateuszkwiecinski mateuszkwiecinski added the help wanted Extra attention is needed label Aug 9, 2021
@mtrakal
Copy link
Author

mtrakal commented Aug 10, 2021

Hi, it looks, that I provided wrong font name, when I now checking names for ttf-dejavu (I used: font: "DejaVu" but it looks should be font: "DejaVu Sans") so it looks as related to NPE that I provided name, but system didn't found font for this name. But I tried with this name too and result is same. NPE on getFont

GraphicsEnvironment.getLocalGraphicsEnvironment().availableFontFamilyNames.forEach {
    println(it)
}

output on my Windows machine

DejaVu Math TeX Gyre
DejaVu Sans
DejaVu Sans Condensed
DejaVu Sans Light
DejaVu Sans Mono
DejaVu Serif
DejaVu Serif Condensed

When I try this:
image: alvrme/alpine-android-liberica:android-30-jdk8
apk add --no-cache freetype fontconfig ttf-dejavu
and use it without dejavu font (but install fontconfig)

filters = chromeLike(label: "staging")
it failed on:

Caused by: java.io.IOException: Problem reading font data.
	at com.project.starter.easylauncher.filter.DefaultFontKt$DEFAULT_EASYLAUNCHER_FONT$2.invoke(DefaultFont.kt:8)
	at com.project.starter.easylauncher.filter.DefaultFontKt$DEFAULT_EASYLAUNCHER_FONT$2.invoke(DefaultFont.kt:5)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
	at org.gradle.initialization.BuildOperationFiringTaskExecutionPreparer.prepareForTaskExecution(BuildOperationFiringTaskExecutionPreparer.java:56)
	at org.gradle.initialization.DefaultGradleLauncher.prepareTaskExecution(DefaultGradleLauncher.java:233)
	at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:168)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
	at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:125)
	at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:71)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:213)
	at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
	at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
	at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:31)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:66)
	at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
	at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:90)
	at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:49)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:44)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.lambda$execute$0(InProcessBuildActionExecuter.java:59)
	at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:86)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:58)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
	at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.lambda$execute$0(BuildTreeScopeLifecycleBuildActionExecuter.java:34)
	at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:53)
	at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:33)
	at org.gradle.launcher.exec.BuildTreeScopeLifecycleBuildActionExecuter.execute(BuildTreeScopeLifecycleBuildActionExecuter.java:28)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:104)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:55)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:64)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:37)
	at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.lambda$execute$0(SessionScopeLifecycleBuildActionExecuter.java:54)
	at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:67)
	at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:50)
	at org.gradle.tooling.internal.provider.SessionScopeLifecycleBuildActionExecuter.execute(SessionScopeLifecycleBuildActionExecuter.java:36)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:58)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31)
	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
	at org.gradle.util.Swapper.swap(Swapper.java:38)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: java.io.IOException: Problem reading font data.
	at com.project.starter.easylauncher.filter.DefaultFontKt$DEFAULT_EASYLAUNCHER_FONT$2.invoke(DefaultFont.kt:8)
	at com.project.starter.easylauncher.filter.DefaultFontKt$DEFAULT_EASYLAUNCHER_FONT$2.invoke(DefaultFont.kt:5)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	at com.project.starter.easylauncher.filter.DefaultFontKt.getDEFAULT_EASYLAUNCHER_FONT(DefaultFont.kt:5)
	at com.project.starter.easylauncher.filter.ChromeLikeFilter.<init>(ChromeLikeFilter.kt:35)
	at com.project.starter.easylauncher.plugin.EasyLauncherConfig.chromeLike(EasyLauncherConfig.kt:173)
	at com.project.starter.easylauncher.plugin.EasyLauncherConfig.chromeLike(EasyLauncherConfig.kt:213)
	at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:484)
	at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:196)
	at org.gradle.internal.metaobject.CompositeDynamicObject.tryInvokeMethod(CompositeDynamicObject.java:98)
	at org.gradle.internal.extensibility.MixInClosurePropertiesAsMethodsDynamicObject.tryInvokeMethod(MixInClosurePropertiesAsMethodsDynamicObject.java:34)
	at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:56)
	at build_ecjpf23u0g1s7wa0ztc7ci11c$_run_closure3$_closure34$_closure37.doCall(/opt/atlassian/pipelines/agent/build/app/build.gradle:266)
	at org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:71)
	at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154)
	at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:105)
	at org.gradle.util.ConfigureUtil$WrappedConfigureAction.execute(ConfigureUtil.java:166)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:80)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:71)
	at org.gradle.api.internal.NamedDomainObjectContainerConfigureDelegate._configure(NamedDomainObjectContainerConfigureDelegate.java:39)
	at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:65)
	at build_ecjpf23u0g1s7wa0ztc7ci11c$_run_closure3$_closure34.doCall(/opt/atlassian/pipelines/agent/build/app/build.gradle:265)
	at org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:71)
	at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154)
	at org.gradle.util.ConfigureUtil.configureSelf(ConfigureUtil.java:142)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.configure(AbstractNamedDomainObjectContainer.java:91)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.configure(AbstractNamedDomainObjectContainer.java:38)
	at org.gradle.internal.extensibility.MixInClosurePropertiesAsMethodsDynamicObject.tryInvokeMethod(MixInClosurePropertiesAsMethodsDynamicObject.java:53)
	at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:56)
	at build_ecjpf23u0g1s7wa0ztc7ci11c$_run_closure3.doCall(/opt/atlassian/pipelines/agent/build/app/build.gradle:264)
	at org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:71)
	at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154)
	at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:105)
	at org.gradle.util.ConfigureUtil$WrappedConfigureAction.execute(ConfigureUtil.java:166)
	at org.gradle.internal.extensibility.ExtensionsStorage$ExtensionHolder.configure(ExtensionsStorage.java:173)
	at org.gradle.internal.extensibility.ExtensionsStorage.configureExtension(ExtensionsStorage.java:64)
	at org.gradle.internal.extensibility.DefaultConvention.configureExtension(DefaultConvention.java:364)
	at org.gradle.internal.extensibility.DefaultConvention.access$500(DefaultConvention.java:45)
	at org.gradle.internal.extensibility.DefaultConvention$ExtensionsDynamicObject.tryInvokeMethod(DefaultConvention.java:301)
	at org.gradle.internal.metaobject.CompositeDynamicObject.tryInvokeMethod(CompositeDynamicObject.java:98)
	at org.gradle.internal.extensibility.MixInClosurePropertiesAsMethodsDynamicObject.tryInvokeMethod(MixInClosurePropertiesAsMethodsDynamicObject.java:34)
	at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.tryInvokeMethod(BasicScript.java:135)
	at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:163)
	at org.gradle.groovy.scripts.BasicScript.invokeMethod(BasicScript.java:84)
	at build_ecjpf23u0g1s7wa0ztc7ci11c.run(/opt/atlassian/pipelines/agent/build/app/build.gradle:262)
	at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
	... 154 more

@mateuszkwiecinski
Copy link
Member

Hey @mtrakal 👋
Could you provide a sample repository that fails with the same error? I tried to reproduce it locally without a success, so I created a sample repository with a simplest setup I understood should fail, but again, it produced valid artifacts: https://github.com/mateuszkwiecinski/easylauncher_on_docker/actions/runs/1153036551 👀 Did I miss something?

@stefanoberdoerfer
Copy link

stefanoberdoerfer commented Aug 26, 2021

I've had the same "Problem reading font data" issue when building a project via Gitlab-CI and alvr/alpine-android docker image.
Adding the fonts before executing the build fixed it for me:

before_script:
  - apk add --no-cache freetype fontconfig ttf-dejavu

Maybe adding an embedded fallback font to this plugin would save some users from having to dig for the cause of their failing CI build and finding out it is caused only by a gradle plugin.

@mtrakal
Copy link
Author

mtrakal commented Aug 26, 2021

@mateuszkwiecinski I uses java8 images, but expect, that it will not affect result.
as I wrote:

When I try this:
image: alvrme/alpine-android-liberica:android-30-jdk8
apk add --no-cache freetype fontconfig ttf-dejavu
and use it without dejavu font (but install fontconfig)
filters = chromeLike(label: "staging")

Image: alvrme/alpine-android-liberica:android-30-jdk8
apk add --no-cache freetype fontconfig ttf-dejavu (you use in sample)
filters = chromeLike(label: "staging") (you use in sample)

So maybe image make difference (it uses different Java JDK).

Or I experimented before with:
filters = chromeLike(label: "staging", font: "DejaVu") this maybe failed? Because name of font is wrong...

Expect, that correct name should be: filters = chromeLike(label: "staging", font: "DejaVuSans")

@mateuszkwiecinski
Copy link
Member

Maybe adding an embedded fallback font to this plugin would save some users from having to dig for the cause of their failing CI build and finding out it is caused only by a gradle plugin.

@stefanoberdoerfer As far as I understand the issue is not the default font (because the plugins is shipped with default Roboto font (related code linked in my first comment here)), but the lack of Font support in general. I read the stacktrace as it can't load the bundled font for some reason 👀

I uses java8 images,

@mtrakal I used Java 11 because AGP 7 started requiring such. I modified the repro project to use java 8 (with older AGP version) and it still works as expected: https://github.com/mateuszkwiecinski/easylauncher_on_docker/runs/3433226377?check_suite_focus=true

I tried without installing ttf-dejavu font (which shouldn't be needed) which finally reproduced the issue you both encountered GA run 🎉

It seems like installing any font allows the plugin to read bundled font resource, which is a behavior I don't understand, at all 🤔

@headsvk
Copy link

headsvk commented Dec 10, 2021

Did you get this to run with JDK 11? I'm using alvrme/alpine-android:android-30-jdk11-v2021.12.05 docker image.

I'm getting java.lang.reflect.InvocationTargetException even when just trying to print available fonts with GraphicsEnvironment.
I ran the apk command before running Gradle and it did install fonts so I'm not sure what is the problem.

12:15:43  [Pipeline] sh
12:15:43  + apk add --no-cache freetype fontconfig ttf-dejavu
12:15:43  fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
12:15:43  fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
12:15:43  (1/9) Installing libbz2 (1.0.8-r1)
12:15:43  (2/9) Installing libpng (1.6.37-r1)
12:15:43  (3/9) Installing freetype (2.10.4-r1)
12:15:43  (4/9) Installing libuuid (2.37.2-r0)
12:15:43  (5/9) Installing fontconfig (2.13.1-r4)
12:15:43  (6/9) Installing encodings (1.0.5-r0)
12:15:43  (7/9) Installing libfontenc (1.1.4-r0)
12:15:43  (8/9) Installing mkfontscale (1.2.1-r1)
12:15:43  (9/9) Installing ttf-dejavu (2.37-r1)
12:15:44  Executing busybox-1.33.1-r6.trigger
12:15:44  Executing fontconfig-2.13.1-r4.trigger
12:15:46  Executing mkfontscale-1.2.1-r1.trigger
12:15:46  OK: 44 MiB in 39 packages
...
12:15:46  [Pipeline] sh
12:15:47  + ./gradlew app:printAvailableFonts --stacktrace
...
12:18:49  > Task :app:printAvailableFonts FAILED
12:18:49  
12:18:49  FAILURE: Build failed with an exception.
12:18:49  
12:18:49  * What went wrong:
12:18:49  Execution failed for task ':app:printAvailableFonts'.
12:18:49  > java.lang.reflect.InvocationTargetException
...
12:18:49  Caused by: java.lang.reflect.InvocationTargetException
12:18:49  	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
12:18:49  	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
12:18:49  	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
12:18:49  	... 228 more
12:18:49  Caused by: java.lang.NullPointerException
12:18:49  	... 231 more

Similar error with using fontName = "DejaVu Sans" with Easylauncher.

12:01:54  Caused by: java.lang.InternalError: java.lang.reflect.InvocationTargetException
12:01:54  	at com.project.starter.easylauncher.filter.ColorRibbonFilter.getFont(ColorRibbonFilter.kt:129)
12:01:54  	at com.project.starter.easylauncher.filter.ColorRibbonFilter.apply(ColorRibbonFilter.kt:67)
12:01:54  	at com.project.starter.easylauncher.plugin.IconTransformerKt.transformImage(IconTransformer.kt:14)
12:01:54  	at com.project.starter.easylauncher.plugin.EasyLauncherTask.run(EasyLauncherTask.kt:55)
...
12:01:54  Caused by: java.lang.reflect.InvocationTargetException
12:01:54  	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
12:01:54  	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
12:01:54  	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
12:01:54  	... 240 more
12:01:54  Caused by: java.lang.NullPointerException
12:01:54  	... 243 more

@mtrakal
Copy link
Author

mtrakal commented Dec 13, 2021

alvrme/alpine-android:android-31-jdk11-v2021.08.01

I run this in pipeline before run easylauncher: - apk add --no-cache freetype fontconfig ttf-dejavu

my easylauncher looks like:

debug {
            filters = customRibbon(font: "DejaVuSans", ribbonColor: "#99606060")
        }

@headsvk
Copy link

headsvk commented Dec 13, 2021

I have KTS build scripts and file is type of File, not just a string.
From Easylauncher code:

val fontName: String?
val font: File?

@mateuszkwiecinski
Copy link
Member

mateuszkwiecinski commented Dec 13, 2021

Calling customRibbon(font: "...") passes the string as fontName - source (and the reson why it works that way is when called from Groovy the plugin receives arguments as Map<String, Any> so the type information is lost and I aimed to make the plugin configuration as convenient as possible )

If you're configuring the plugin from kts file then customRibbon(fontName = "DejaVuSans") should be equivalent of Groovy's customRibbon(font: "DejaVuSans")

@mtrakal
Copy link
Author

mtrakal commented Dec 15, 2021

Hmm, image: alvrme/alpine-android:android-31-jdk11 crash on log below, but old version image: alvrme/alpine-android:android-31-jdk11-v2021.08.01 works as expected. Looks like some changes in https://github.com/alvr/alpine-android caused this bug.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:easylauncherStagingRelease'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:145)
	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:143)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:131)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:402)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:389)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:382)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:368)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:61)
Caused by: java.lang.InternalError: java.lang.reflect.InvocationTargetException
	at com.project.starter.easylauncher.filter.ChromeLikeFilter.getFont(ChromeLikeFilter.kt:105)
	at com.project.starter.easylauncher.filter.ChromeLikeFilter.apply(ChromeLikeFilter.kt:54)
	at com.project.starter.easylauncher.plugin.IconTransformerKt.transformImage(IconTransformer.kt:14)
	at com.project.starter.easylauncher.plugin.EasyLauncherTask.run(EasyLauncherTask.kt:55)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
	at org.gradle.api.internal.tasks.execution.TaskExecution$2.run(TaskExecution.java:239)

@RahulSDeshpande
Copy link

Guys if anyone is using CircleCI, then everything will work with cimg/android:2022.06-node Docker image.
💃🏼 💯

@emartynov
Copy link

People, did you find a solution? I tried everything above and I'm getting

Execution failed for task ':app:easylauncherDebug'.
> Fontconfig head is null, check your fonts or fonts configuration

I'm trying JSDK 21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Development

No branches or pull requests

6 participants