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

Build failed on the latest gradle plugin, getFont suddenly caused NPE #37

Open
bopbi opened this issue May 26, 2019 · 12 comments
Open

Build failed on the latest gradle plugin, getFont suddenly caused NPE #37

bopbi opened this issue May 26, 2019 · 12 comments

Comments

@bopbi
Copy link

bopbi commented May 26, 2019

suddenly the easylauncher is failed when using android plugin 3.4.1

error log: >

Task :common:bundleLibCompileGlobalRelease
Task :common:bundleLibResGlobalRelease
Task :app:easylauncherGlobalRc FAILED
Task :common:bundleLibRuntimeGlobalRelease
Task :testing:compileGlobalReleaseKotlin
Task :schema:kaptGenerateStubsGlobalDebugKotlin

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:easylauncherGlobalRc'.
    java.lang.NullPointerException (no error message)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

probably this plugin need to be updated with the latest android gradle plugin

update:

full log

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:easylauncherGlobalRc'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:95)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:91)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:119)
    at org.gradle.api.internal.tasks.execution.ResolvePreviousStateExecuter.execute(ResolvePreviousStateExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:93)
    at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:45)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:94)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:56)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:67)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
    at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)
    at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
    at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    Caused by: java.lang.NullPointerException
    at com.akaita.android.easylauncher.filter.ColorRibbonFilter.getFont(ColorRibbonFilter.java:173)
    at com.akaita.android.easylauncher.filter.ColorRibbonFilter.apply(ColorRibbonFilter.java:90)
    at com.akaita.android.easylauncher.plugin.EasyLauncher.lambda$process$0(EasyLauncher.java:34)
    at com.akaita.android.easylauncher.plugin.EasyLauncher.process(EasyLauncher.java:34)
    at com.akaita.android.easylauncher.plugin.EasyLauncher$process.call(Unknown Source)
    at com.akaita.android.easylauncher.plugin.EasyLauncherTask$_run_closure1$_closure6$_closure8.doCall(EasyLauncherTask.groovy:67)
    at com.sun.proxy.$Proxy87.accept(Unknown Source)
    at com.akaita.android.easylauncher.plugin.EasyLauncherTask$_run_closure1$_closure6.doCall(EasyLauncherTask.groovy:56)
    at com.sun.proxy.$Proxy87.accept(Unknown Source)
    at com.akaita.android.easylauncher.plugin.EasyLauncherTask$_run_closure1.doCall(EasyLauncherTask.groovy:53)
    at com.sun.proxy.$Proxy87.accept(Unknown Source)
    at com.akaita.android.easylauncher.plugin.EasyLauncherTask.run(EasyLauncherTask.groovy:43)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:704)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:671)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:284)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
    at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:273)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:258)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:67)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:145)
    at org.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.java:49)
    at org.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.java:34)
    at org.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:69)
    at org.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.java:49)
    at org.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.java:33)
    at org.gradle.internal.execution.impl.steps.CreateOutputsStep.execute(CreateOutputsStep.java:50)
    at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:43)
    at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:29)
    at org.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.java:134)
    at org.gradle.internal.execution.impl.steps.CacheStep.lambda$execute$3(CacheStep.java:83)
    at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:82)
    at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:36)
    at org.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.java:33)
    at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:38)
    at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:23)
    at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
    at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
    at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)
    at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
    at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:34)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:91)
    ... 32 more
@bopbi
Copy link
Author

bopbi commented May 26, 2019

the cause probably on

Caused by: java.lang.NullPointerException
at com.akaita.android.easylauncher.filter.ColorRibbonFilter.getFont(ColorRibbonFilter.java:173)

@bopbi bopbi changed the title Build failed on the latest gradle plugin Build failed on the latest gradle plugin, getFont suddenly caused NPE May 26, 2019
@amccaleb
Copy link

I can repro the NPE using CircleCI and using Android Gradle Plugin 3.4.0, so this doesn't seem entirely tied to the Gradle plugin version.

@amccaleb
Copy link

amccaleb commented Jun 20, 2019

Tried to work around the issue by using the customColorRibbons and specifying the textRatio myself. This just moved the NPE to a different area:

https://github.com/akaita/easylauncher-gradle-plugin/blob/master/plugin/src/main/groovy/com/akaita/android/easylauncher/filter/ColorRibbonFilter.java#L92

Caused by: java.lang.NullPointerException
at com.akaita.android.easylauncher.filter.ColorRibbonFilter.apply(ColorRibbonFilter.java:92)
at com.akaita.android.easylauncher.plugin.EasyLauncher.lambda$process$0(EasyLauncher.java:34)
at com.akaita.android.easylauncher.plugin.EasyLauncher.process(EasyLauncher.java:34)
at com.akaita.android.easylauncher.plugin.EasyLauncher$process.call(Unknown Source)
at com.akaita.android.easylauncher.plugin.EasyLauncherTask$_run_closure1$_closure6$_closure8.doCall(EasyLauncherTask.groovy:67)
at com.sun.proxy.$Proxy89.accept(Unknown Source)
at com.akaita.android.easylauncher.plugin.EasyLauncherTask$_run_closure1$_closure6.doCall(EasyLauncherTask.groovy:56)
at com.sun.proxy.$Proxy89.accept(Unknown Source)
at com.akaita.android.easylauncher.plugin.EasyLauncherTask$_run_closure1.doCall(EasyLauncherTask.groovy:53)
at com.sun.proxy.$Proxy89.accept(Unknown Source)
at com.akaita.android.easylauncher.plugin.EasyLauncherTask.run(EasyLauncherTask.groovy:43)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)

@lksnmnn
Copy link

lksnmnn commented Jun 20, 2019

This is basically the same issue I am seeing on the "original" ribbonizer project:
maskarade/gradle-android-ribbonizer-plugin#31

Some change in the Circle CI base image triggered this.

I'll remove ribbons alltogether for now...

@Alqasrawi
Copy link

Any updates on this issue ? I have the same problem with the latest Android gradle plugin and CircleCi

@bartsidee
Copy link

encountering the same issue, it seems related to openjdk installation on alpine docker images:
docker-library/openjdk#73

I was able to solve it by installing fontconfig to the docker image used:
RUN apk --update add fontconfig ttf-dejavu

@bopbi
Copy link
Author

bopbi commented Oct 22, 2019

thanks for sharing @bartsidee will try it

@anujmiddha
Copy link

@bartsidee Thanks for sharing. Can you also share where in the circleci config file this goes?

@lksnmnn
Copy link

lksnmnn commented Oct 31, 2019

I believe he is using a custom docker image based on alpine. So the line he posted is added to his Dockerfile. You can then refer to your custom image in the CircleCI config.

@anujmiddha
Copy link

Ah got it. Thanks @lksnmnn

@adrinieto
Copy link

I'm having the same problem. Any updates on this?

@tlb-miyagiyuki
Copy link

I solved this problem in the CircleCI config. thanks to #37 (comment).
I added the following command to job.

  steps:
    - run:
        name: add fontconfig for easylauncher
        command: sudo apt-get update && sudo apt-get install -y fontconfig ttf-dejavu

I'm using circleci/android:api-29 docker image.

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

8 participants