didi / booster

🚀Optimizer for mobile applications
https://booster.johnsonlee.io
Apache License 2.0
4.89k stars 580 forks source link

Could not initialize class com.didiglobal.booster.command.CommandService #191

Closed yueban closed 2 years ago

yueban commented 4 years ago

Please provide the following informations.

FAILURE: Build failed with an exception.

CONFIGURE FAILED in 724ms



The same build.gradle config works fine on other macOS system, but show error above on all windows system.
johnsonlee commented 4 years ago

Could you please provide the content of build.gradle ?

yueban commented 4 years ago

build.gralde in project level

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext {
        debug = gradle.startParameter.taskNames.any { it.contains('debug') || it.contains('Debug') }

        //Application
        compileSdkVersion = 28
        minSdkVersion = 21
        targetSdkVersion = 26
        versionName = '5.1.0.1'

        //Library
        constraintLayoutVersion = '1.1.2'
        supportCoreVersion = '1.3.1'
        supportV4Version = '1.0.0'
        supportVersion = '26.1.0'
        supportV7Version = '1.1.0'
        recyclerViewVersion = '1.1.0'
        materialVersion = '1.0.0'
        skechVersion = '2.7.1-rc01'
        youzanyunVersion = '6.4.25'
        facelibVersion = '0.4.4'
        glideVersion = '4.7.1'
        smartRefreshLayoutVersion = '1.1.0-alpha-14'
        skechVersion = '2.7.1-rc01'
        photoViewVersion = '2.1.4'
        logutilsVersion = '1.7.5'
        baseRecyclerViewAdapterHelperVersion = '2.9.46'
        loggerVersion = '2.2.0'
        shortcutBadgerVersion = '1.1.22@aar'
        gsonVersion = '2.8.1'
        android_extendVersion = '1.0.5'
        multidexVersion = '2.0.1'
        walleVersion = '1.1.6'
        SpEditToolVersion = '0.2.3'
        roomVersion = "2.2.5"
        wcdbVersion = "1.0.8"
        eventBusVersion = '3.1.1'
        sqlcipherVersion = '4.4.0'
        sqlcipherXVersion = '2.0.1'
        mmkvVersion = '1.1.1'
        androidwmVersion = '0.1.5'
        easyFloatVersion = '1.0.16'
        squirrelVersion = '0.3.8'
        sentryVersion = '2.1.0'
        flipperVersion = '0.39.0'
        soloaderVersion = '0.9.0'
        flipperPluginMmkv = '1.0.0'
        flipperSqlcipherPluginVersion = '1.0.1'
        smVersion = '1.0.5'
        retrofitVersion = '2.6.2'
        okhttpVersion = '4.2.0'
        rxjavaVersion = '2.2.7'
        rxandroidVersion = '2.1.1'
        supportEmojiVersion = '26.0.0'
        booster_version = '2.3.1'

        //Test
        espressoVersion = '2.2.2'
        junitVersion = '4.12'
        androidxTestJunit = '1.1.1'
        debugDbVersion = '1.0.6'
    }

    repositories {
        //阿里镜像
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'http://developer.huawei.com/repo/' }
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath 'com.huawei.agconnect:agcp:1.2.1.301'
        classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.17'

        // booster 质量优化框架
        classpath "com.didiglobal.booster:booster-gradle-plugin:$booster_version"
        if (!debug) {
            // 线程池配置优化
            classpath "com.didiglobal.booster:booster-transform-thread:$booster_version"
            // sp apply 操作优化
            classpath "com.didiglobal.booster:booster-transform-shared-preferences:$booster_version"
            // 使用 pngquant 压缩 png 图片
            classpath "com.didiglobal.booster:booster-task-compression-pngquant:$booster_version"
            classpath "io.johnsonlee.booster:booster-pngquant-provider:1.6.0"
            // 使用 cwebp 压缩 webp 图片
            classpath "com.didiglobal.booster:booster-task-compression-cwebp:$booster_version"
            // R 文件压缩
            classpath "com.didiglobal.booster:booster-transform-r-inline:$booster_version"
            // 去冗余资源
            classpath "com.didiglobal.booster:booster-task-resource-deredundancy:$booster_version"
            // 修复 Finalizer 导致的 TimeoutException
            classpath "com.didiglobal.booster:booster-transform-finalizer-watchdog-daemon:$booster_version"
            // 修复 Android 系统 bug 导致升级后加载了旧的 APK 无法获取资源的问题
            classpath "com.didiglobal.booster:booster-transform-res-check:$booster_version"
            // 修复 Android 7.1 Toast 崩溃
            classpath "com.didiglobal.booster:booster-transform-toast:$booster_version"
        }
    }
}

allprojects {
    repositories {
        //阿里镜像
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
        // 有赞
        maven {
            url "https://dl.bintray.com/youzanyun/maven/"
            content {
                includeGroupByRegex "com\\.youzan.*"
            }
        }
        maven {
            url "https://jitpack.io"
            content {
                includeGroupByRegex "com\\.github\\.\\w*"
            }
        }
        maven {
            url 'http://developer.huawei.com/repo/'
            content {
                includeGroupByRegex "com\\.huawei\\.\\w*"
            }
        }
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle in module level

apply plugin: 'com.android.application'
apply plugin: 'com.didiglobal.booster'
apply from: '../gradlescripts/buildsystem.gradle'
apply plugin: 'com.huawei.agconnect'
apply plugin: 'AndResGuard'

def static dateTime() {
    return new Date().format("yyyyMMdd", TimeZone.getTimeZone("GMT+8"))
}

android {
    compileSdkVersion rootProject.compileSdkVersion
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        minSdkVersion rootProject.minSdkVersion
        targetSdkVersion rootProject.targetSdkVersion
        versionCode Integer.valueOf(dateTime())
        versionName rootProject.versionName
        multiDexEnabled true
        ndk {
            abiFilters "armeabi-v7a"
        }

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [
                    'room.schemaLocation': "$projectDir/room_schema".toString(),
                    'room.incremental'   : 'true',
                ]
            }
        }
    }

...
johnsonlee commented 4 years ago

Have you tried this?

classpath "io.johnsonlee.booster:booster-pngquant-provider:2.2.0"
yueban commented 4 years ago

Have you tried this?

classpath "io.johnsonlee.booster:booster-pngquant-provider:2.2.0"

still not work, same error

johnsonlee commented 4 years ago

Could you please provide the output of the following cmdline?

./gradlew :app:buildEnv
yueban commented 4 years ago
D:\workspace\NewShieldSafeHouse>.\gradlew :app:buildEnv

Welcome to Gradle 5.6.4!

Here are the highlights of this release:
 - Incremental Groovy compilation
 - Groovy compile avoidance
 - Test fixtures for Java projects
 - Manage plugin versions via settings script

For more details see https://docs.gradle.org/5.6.4/release-notes.html

Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

> Configure project :app
WARNING: BuildType(alpha): buildConfigField 'IS_DEBUG' value is being replaced: true -> false
WARNING: BuildType(alpha): buildConfigField 'IS_ALPHA_VERSION' value is being replaced: false -> true
WARNING: BuildType(alpha): buildConfigField 'LOG_DEBUG' value is being replaced: true -> true
WARNING: BuildType(alpha): buildConfigField 'IS_OPEN_SENTRY' value is being replaced: false -> true
WARNING: BuildType(alpha): buildConfigField 'RONG_YUN_IS_PUBLIC' value is being replaced: true -> true
--W- The variant: nsshDebug, Use the json file: D:\workspace\NewShieldSafeHouse\app\agconnect-services.json
--W- The variant: nsshRelease, Use the json file: D:\workspace\NewShieldSafeHouse\app\agconnect-services.json
--W- The variant: nsshAlpha, Use the json file: D:\workspace\NewShieldSafeHouse\app\agconnect-services.json

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > java.lang.ExceptionInInitializerError (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.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
johnsonlee commented 4 years ago

It seems your project doesn't configured correctly, please add -S options and run task :app:buildEnv again

yueban commented 4 years ago
D:\workspace\NewShieldSafeHouse>.\gradlew :app:buildEnv -S
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

> Configure project :app
WARNING: BuildType(alpha): buildConfigField 'IS_DEBUG' value is being replaced: true -> false
WARNING: BuildType(alpha): buildConfigField 'IS_ALPHA_VERSION' value is being replaced: false -> true
WARNING: BuildType(alpha): buildConfigField 'LOG_DEBUG' value is being replaced: true -> true
WARNING: BuildType(alpha): buildConfigField 'IS_OPEN_SENTRY' value is being replaced: false -> true
WARNING: BuildType(alpha): buildConfigField 'RONG_YUN_IS_PUBLIC' value is being replaced: true -> true
--W- The variant: nsshDebug, Use the json file: D:\workspace\NewShieldSafeHouse\app\agconnect-services.json
--W- The variant: nsshRelease, Use the json file: D:\workspace\NewShieldSafeHouse\app\agconnect-services.json
--W- The variant: nsshAlpha, Use the json file: D:\workspace\NewShieldSafeHouse\app\agconnect-services.json

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > java.lang.ExceptionInInitializerError (no error message)

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
        at org.gradle.configuration.project.LifecycleProjectEvaluator.wrapException(LifecycleProjectEvaluator.java:80)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:73)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.access$600(LifecycleProjectEvaluator.java:53)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate.run(LifecycleProjectEvaluator.java:199)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject$1.run(LifecycleProjectEvaluator.java:112)
        at org.gradle.internal.Factories$1.create(Factories.java:26)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
        at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withProjectLock(DefaultProjectStateRegistry.java:227)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:221)
        at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.withMutableState(DefaultProjectStateRegistry.java:187)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:96)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:68)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:693)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:141)
        at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:36)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:64)
        at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:55)
        at org.gradle.configuration.BuildOperatingFiringProjectsPreparer$ConfigureBuild.run(BuildOperatingFiringProjectsPreparer.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.configuration.BuildOperatingFiringProjectsPreparer.prepareProjects(BuildOperatingFiringProjectsPreparer.java:40)
        at org.gradle.initialization.DefaultGradleLauncher.prepareProjects(DefaultGradleLauncher.java:198)
        at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:138)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:126)
        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:106)
        at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:60)
        at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:57)
        at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:85)
        at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:78)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:189)
        at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:78)
        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:57)
        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:63)
        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
        at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)
        at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:78)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
        at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:68)
        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:27)
        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:82)
        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 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:86)
        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:325)
        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:235)
        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:141)
        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
        at com.sun.proxy.$Proxy26.afterEvaluate(Unknown Source)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate$1.execute(LifecycleProjectEvaluator.java:191)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate$1.execute(LifecycleProjectEvaluator.java:188)
        at org.gradle.api.internal.project.DefaultProject.stepEvaluationListener(DefaultProject.java:1420)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$NotifyAfterEvaluate.run(LifecycleProjectEvaluator.java:197)
        ... 117 more
Caused by: java.lang.ExceptionInInitializerError
        at com.didiglobal.booster.task.compression.pngquant.Pngquant.<init>(Pngquant.kt:16)
        at com.didiglobal.booster.task.compression.pngquant.Pngquant$Companion.get(Pngquant.kt:27)
        at com.didiglobal.booster.task.compression.pngquant.PngquantCompressionVariantProcessor.process(PngquantCompressionVariantProcessor.kt:32)
        at com.didiglobal.booster.gradle.BoosterPlugin$apply$$inlined$let$lambda$1.execute(BoosterPlugin.kt:25)
        at com.didiglobal.booster.gradle.BoosterPlugin$apply$$inlined$let$lambda$1.execute(BoosterPlugin.kt:13)
        at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction$1$1.run(DefaultListenerBuildOperationDecorator.java:154)
        at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.reapply(DefaultUserCodeApplicationContext.java:60)
        at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction$1.run(DefaultListenerBuildOperationDecorator.java:151)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingAction.execute(DefaultListenerBuildOperationDecorator.java:148)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:92)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:80)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:231)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:150)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
        ... 127 more
Caused by: kotlin.KotlinNullPointerException
        at io.johnsonlee.booster.command.pngquant.PngquantProvider.get(PngquantProvider.kt:17)
        at com.didiglobal.booster.command.CommandService.<clinit>(CommandService.kt:14)
        ... 148 more

* Get more help at https://help.gradle.org

BUILD FAILED in 8s
johnsonlee commented 4 years ago

It seems the OS architecture doesn't match, could you provide the result of running the following Java code?

public class Main {
    public static void main(String[] args) {
        System.out.println(System.getProperty("os.arch"));
    }
}
yueban commented 4 years ago

the result is amd64.

johnsonlee commented 4 years ago

The latest version io.johnsonlee.booster:booster-pngquant-provider:2.3.0 has been released, please have a try.

yueban commented 4 years ago

No more errors on sync gradle task, but failed to rebuild project, check build logs below.

Obviously the task app:compressNsshDebugResourcesWithPngquant failed.

Executing tasks: [clean, :app:assembleNsshDebug] in project E:\AndroidWorkSpace\SafeHouse

> Configure project :app
WARNING: BuildType(alpha): buildConfigField 'IS_DEBUG' value is being replaced: true -> false
WARNING: BuildType(alpha): buildConfigField 'IS_ALPHA_VERSION' value is being replaced: false -> true
WARNING: BuildType(alpha): buildConfigField 'LOG_DEBUG' value is being replaced: true -> true
WARNING: BuildType(alpha): buildConfigField 'IS_OPEN_SENTRY' value is being replaced: false -> true
WARNING: BuildType(alpha): buildConfigField 'RONG_YUN_IS_PUBLIC' value is being replaced: true -> true
--W- The variant: nsshDebug, Use the json file: E:\AndroidWorkSpace\SafeHouse\app\agconnect-services.json
--W- The variant: nsshRelease, Use the json file: E:\AndroidWorkSpace\SafeHouse\app\agconnect-services.json
--W- The variant: nsshAlpha, Use the json file: E:\AndroidWorkSpace\SafeHouse\app\agconnect-services.json

> Task :clean UP-TO-DATE
> Task :app:clean
> Task :app:preBuild UP-TO-DATE
> Task :app:preNsshDebugBuild UP-TO-DATE
> Task :app:compileNsshDebugAidl NO-SOURCE
> Task :app:checkNsshDebugManifest
> Task :app:compileNsshDebugRenderscript NO-SOURCE
> Task :app:generateNsshDebugBuildConfig FROM-CACHE
> Task :app:javaPreCompileNsshDebug FROM-CACHE
> Task :app:generateNsshDebugResValues FROM-CACHE
> Task :app:generateNsshDebugResources UP-TO-DATE
> Task :app:processNsshDebugAGCPlugin
> Task :app:mainApkListPersistenceNsshDebug FROM-CACHE
> Task :app:createNsshDebugCompatibleScreenManifests FROM-CACHE

> Task :app:processNsshDebugManifest
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:555:9-557:64 Warning:
    Element meta-data#info_stat_appid at AndroidManifest.xml:555:9-557:64 duplicated with element declared at AndroidManifest.xml:442:9-444:64
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:579:9-584:20 Warning:
    Element receiver#com.security.receiver.PhoneBroadcastReceiver at AndroidManifest.xml:579:9-584:20 duplicated with element declared at AndroidManifest.xml:354:9-359:20
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:585:9-593:20 Warning:
    Element receiver#com.xiaomi.push.service.receivers.NetworkStatusReceiver at AndroidManifest.xml:585:9-593:20 duplicated with element declared at AndroidManifest.xml:360:9-368:20
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:594:9-601:20 Warning:
    Element receiver#com.xiaomi.push.service.receivers.PingReceiver at AndroidManifest.xml:594:9-601:20 duplicated with element declared at AndroidManifest.xml:369:9-376:20
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:602:9-611:20 Warning:
    Element receiver#com.justalk.cloud.juspush.MiPushMessageReceiver at AndroidManifest.xml:602:9-611:20 duplicated with element declared at AndroidManifest.xml:377:9-386:20
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:638:9-67 Warning:
    Element service#com.security.service.NewShieldIntentService at AndroidManifest.xml:638:9-67 duplicated with element declared at AndroidManifest.xml:344:9-67
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:651:9-72 Warning:
    Element service#com.justalk.cloud.juspush.MtcService at AndroidManifest.xml:651:9-72 duplicated with element declared at AndroidManifest.xml:346:9-72
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:652:9-657:46 Warning:
    Element service#com.xiaomi.push.service.XMJobService at AndroidManifest.xml:652:9-657:46 duplicated with element declared at AndroidManifest.xml:347:9-352:46
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:748:9-751:46 Warning:
    Element service#com.xiaomi.push.service.XMPushService at AndroidManifest.xml:748:9-751:46 duplicated with element declared at AndroidManifest.xml:658:9-661:46
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:752:9-755:39 Warning:
    Element service#com.xiaomi.mipush.sdk.PushMessageHandler at AndroidManifest.xml:752:9-755:39 duplicated with element declared at AndroidManifest.xml:662:9-665:39
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:756:9-758:38 Warning:
    Element service#com.xiaomi.mipush.sdk.MessageHandleService at AndroidManifest.xml:756:9-758:38 duplicated with element declared at AndroidManifest.xml:666:9-668:38
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:759:9-761:66 Warning:
    Element service#com.statistics.service.UpLoadCrashLogsService at AndroidManifest.xml:759:9-761:66 duplicated with element declared at AndroidManifest.xml:669:9-671:66
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:775:9-782:20 Warning:
    Element receiver#com.security.receiver.LanguageReceiver at AndroidManifest.xml:775:9-782:20 duplicated with element declared at AndroidManifest.xml:612:9-619:20
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:885:5-68 Warning:
    Element uses-permission#android.permission.WAKE_LOCK at AndroidManifest.xml:885:5-68 duplicated with element declared at AndroidManifest.xml:866:5-68
E:\AndroidWorkSpace\SafeHouse\app\src\main\AndroidManifest.xml:891:5-68 Warning:
    Element uses-permission#android.permission.GET_TASKS at AndroidManifest.xml:891:5-68 duplicated with element declared at AndroidManifest.xml:877:5-68
E:\AndroidWorkSpace\SafeHouse\app\src\nssh\AndroidManifest.xml:5:5-20:19 Warning:
    application@android:theme was tagged at AndroidManifest.xml:5 to replace other declarations but no other declaration present
E:\AndroidWorkSpace\SafeHouse\app\src\nssh\AndroidManifest.xml:5:5-20:19 Warning:
    application@android:icon was tagged at AndroidManifest.xml:5 to replace other declarations but no other declaration present
E:\AndroidWorkSpace\SafeHouse\app\src\nssh\AndroidManifest.xml:5:5-20:19 Warning:
    application@android:label was tagged at AndroidManifest.xml:5 to replace other declarations but no other declaration present

> Task :app:mergeNsshDebugResources
> Task :app:installCwebp FROM-CACHE

> Task :app:removeNsshDebugRedundantResources
Cannot delete file `E:\AndroidWorkSpace\SafeHouse\app\build\intermediates\res\merged\nssh\debug\drawable-ldrtl-xhdpi-v17_abc_ic_menu_cut_mtrl_alpha.png.flat`
Cannot delete file `E:\AndroidWorkSpace\SafeHouse\app\build\intermediates\res\merged\nssh\debug\drawable-ldrtl-mdpi-v17_abc_ic_menu_cut_mtrl_alpha.png.flat`

> Task :app:compressNsshDebugResourcesWithCwebp
> Task :app:installPngquant FROM-CACHE
mipmap-xxhdpi-v4_sdk_voice_settings_wait_time_start_en.png.flat: error: failed to open file.

> Task :app:compressNsshDebugResourcesWithPngquant FAILED
Command `E:\AndroidWorkSpace\SafeHouse\app\build\bin\pngquant.exe --strip --skip-if-larger -f -o E:\AndroidWorkSpace\SafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi\ic_title_back.png -s 3 -Q 80-100 E:\AndroidWorkSpace\SafeHouse\app\src\main\res\mipmap-xxxhdpi\ic_title_back.png` exited with non-zero value 98
mipmap-xxxhdpi-v4_sdk_icon_ime_setting_reset.png.flat: error: failed to open file.
Command `D:\Android_Sdk\build-tools\28.0.3\aapt2.exe compile -o E:\AndroidWorkSpace\SafeHouse\app\build\intermediates\res\merged\nssh\debug E:\AndroidWorkSpace\SafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\sdk_icon_ime_setting_reset.png` exited with non-zero value 0
mipmap-xxxhdpi-v4_sdk_btn_qwerty_space.png.flat: error: failed to open file.
Command `D:\Android_Sdk\build-tools\28.0.3\aapt2.exe compile -o E:\AndroidWorkSpace\SafeHouse\app\build\intermediates\res\merged\nssh\debug E:\AndroidWorkSpace\SafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxhdpi-v4\sdk_voice_settings_wait_time_start_en.png` exited with non-zero value 0
Command `D:\Android_Sdk\build-tools\28.0.3\aapt2.exe compile -o E:\AndroidWorkSpace\SafeHouse\app\build\intermediates\res\merged\nssh\debug E:\AndroidWorkSpace\SafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\sdk_btn_qwerty_space.png` exited with non-zero value 0

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compressNsshDebugResourcesWithPngquant'.
> Process 'command 'D:\Android_Sdk\build-tools\28.0.3\aapt2.exe'' finished with non-zero exit value 1
johnsonlee commented 4 years ago

The error above might be caused by build cache, try to clean it and rebuild the project

yueban commented 4 years ago

well I did a rebuild which contains clean task. It already delete the build folder. What else could I do to clean the build cache.

johnsonlee commented 4 years ago

try this one:

rm -rvf $ROOT_PROJECT_PATH/.gradle
yueban commented 4 years ago

same error after I do:

  1. delete folder $ROOT_PROJECT_PATH/.gradle
  2. rebuild project
johnsonlee commented 4 years ago

What about running ./gradlew manually in terminal ?

yueban commented 4 years ago

do following steps:

  1. delete folder $ROOT_PROJECT_PATH/.gradle
  2. run .\gradlew clean :app:assembleNsshDebug --info in terminal

Still same error, you can check the output log below (only after app:compressNsshDebugResourcesWithCwebp):

> Task :app:compressNsshDebugResourcesWithCwebp
Stored cache entry for task ':app:compressNsshDebugResourcesWithCwebp' with cache key 63d9dd0efab3b630e1f783b2dd95a2f4
Task :app:compressNsshDebugResourcesWithCwebp in app Finished
:app:compressNsshDebugResourcesWithCwebp (Thread[Execution worker for ':',5,main]) completed. Took 1 mins 20.982 secs.
:app:installPngquant (Thread[Execution worker for ':',5,main]) started.

> Task :app:installPngquant FROM-CACHE
Task :app:installPngquant in app Starting
Build cache key for task ':app:installPngquant' is 9af63478a1b4824b5d1f84f521bbf82a
Task ':app:installPngquant' is not up-to-date because:
  No history is available.
Loaded cache entry for task ':app:installPngquant' with cache key 9af63478a1b4824b5d1f84f521bbf82a
Task :app:installPngquant in app Finished
:app:installPngquant (Thread[Execution worker for ':',5,main]) completed. Took 0.017 secs.
:app:compressNsshDebugResourcesWithPngquant (Thread[Execution worker for ':',5,main]) started.
Starting process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''. Working directory: D:\workspace\NewShieldSafeHouse\app Command: D:\workspace\NewShieldSafeHouse\app\build\bin\png
quant.exe --strip --skip-if-larger -f -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\sdk_btn_qwert
y_space.png -s 3 -Q 80-100 C:\Users\lenovo\.gradle\caches\transforms-2\files-2.1\a91d4d079f55c50421e9276081e792d6\jetified-imesdk\res\mipmap-xxxhdpi-v4\sdk_btn_qwerty_space.png
Starting process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''. Working directory: D:\workspace\NewShieldSafeHouse\app Command: D:\workspace\NewShieldSafeHouse\app\build\bin\png
quant.exe --strip --skip-if-larger -f -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxhdpi-v4\sdk_wode.png -
s 3 -Q 80-100 C:\Users\lenovo\.gradle\caches\transforms-2\files-2.1\a91d4d079f55c50421e9276081e792d6\jetified-imesdk\res\mipmap-xxhdpi-v4\sdk_wode.png
Starting process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''. Working directory: D:\workspace\NewShieldSafeHouse\app Command: D:\workspace\NewShieldSafeHouse\app\build\bin\png
quant.exe --strip --skip-if-larger -f -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi\ic_title_back.pn
g -s 3 -Q 80-100 D:\workspace\NewShieldSafeHouse\app\src\main\res\mipmap-xxxhdpi\ic_title_back.png
Successfully started process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''
Successfully started process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''
Successfully started process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''
Starting process 'command 'D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe''. Working directory: D:\workspace\NewShieldSafeHouse\app Command: D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe comp
ile -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\res\merged\nssh\debug D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResources
WithPngquant\mipmap-xxhdpi-v4\sdk_wode.png
Starting process 'command 'D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe''. Working directory: D:\workspace\NewShieldSafeHouse\app Command: D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe comp
ile -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\res\merged\nssh\debug D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResources
WithPngquant\mipmap-xxxhdpi-v4\sdk_btn_qwerty_space.png
Starting process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''. Working directory: D:\workspace\NewShieldSafeHouse\app Command: D:\workspace\NewShieldSafeHouse\app\build\bin\png
quant.exe --strip --skip-if-larger -f -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi\icon_discovery_g
uide.png -s 3 -Q 80-100 D:\workspace\NewShieldSafeHouse\app\src\main\res\mipmap-xxxhdpi\icon_discovery_guide.png
Successfully started process 'command 'D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe''
Successfully started process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''
Successfully started process 'command 'D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe''
mipmap-xxhdpi-v4_sdk_wode.png.flat: error: failed to open file.
mipmap-xxxhdpi-v4_sdk_btn_qwerty_space.png.flat: error: failed to open file.
Starting process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''. Working directory: D:\workspace\NewShieldSafeHouse\app Command: D:\workspace\NewShieldSafeHouse\app\build\bin\png
quant.exe --strip --skip-if-larger -f -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xhdpi-v4\sdk_shift_on_po
pup_icon.png -s 3 -Q 80-100 C:\Users\lenovo\.gradle\caches\transforms-2\files-2.1\a91d4d079f55c50421e9276081e792d6\jetified-imesdk\res\mipmap-xhdpi-v4\sdk_shift_on_popup_icon.png
Starting process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''. Working directory: D:\workspace\NewShieldSafeHouse\app Command: D:\workspace\NewShieldSafeHouse\app\build\bin\png
quant.exe --strip --skip-if-larger -f -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\dialog_encrye
d_clock.png -s 3 -Q 80-100 C:\Users\lenovo\.gradle\caches\transforms-2\files-2.1\a91d4d079f55c50421e9276081e792d6\jetified-imesdk\res\mipmap-xxxhdpi-v4\dialog_encryed_clock.png
Starting process 'command 'D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe''. Working directory: D:\workspace\NewShieldSafeHouse\app Command: D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe comp
ile -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\res\merged\nssh\debug D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResources
WithPngquant\mipmap-xxxhdpi\icon_discovery_guide.png

> Task :app:compressNsshDebugResourcesWithPngquant FAILED
Task :app:compressNsshDebugResourcesWithPngquant in app Starting
Custom actions are attached to task ':app:compressNsshDebugResourcesWithPngquant'.
Build cache key for task ':app:compressNsshDebugResourcesWithPngquant' is ff9b328a54cd2f833126e114a80d8eaf
Task ':app:compressNsshDebugResourcesWithPngquant' is not up-to-date because:
  No history is available.
Starting process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''. Working directory: D:\workspace\NewShieldSafeHouse\app Command: D:\workspace\NewShieldSafeHouse\app\build\bin\png
quant.exe --strip --skip-if-larger -f -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\sdk_icon_ime_
setting_reset.png -s 3 -Q 80-100 C:\Users\lenovo\.gradle\caches\transforms-2\files-2.1\a91d4d079f55c50421e9276081e792d6\jetified-imesdk\res\mipmap-xxxhdpi-v4\sdk_icon_ime_setting_reset.png
Successfully started process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''
Starting process 'command 'D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe''. Working directory: D:\workspace\NewShieldSafeHouse\app Command: D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe comp
ile -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\res\merged\nssh\debug D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResources
WithPngquant\mipmap-xxxhdpi-v4\sdk_icon_ime_setting_reset.png
Command `D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe --strip --skip-if-larger -f -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNssh
DebugResourcesWithPngquant\mipmap-xxxhdpi\ic_title_back.png -s 3 -Q 80-100 D:\workspace\NewShieldSafeHouse\app\src\main\res\mipmap-xxxhdpi\ic_title_back.png` exited with non-zero value 98
Successfully started process 'command 'D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe''
mipmap-xxxhdpi-v4_sdk_icon_ime_setting_reset.png.flat: error: failed to open file.
Command `D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe compile -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\res\merged\nssh\debug D:\workspace\NewShieldSafeHouse\app\build\intermedia
tes\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxhdpi-v4\sdk_wode.png` exited with non-zero value 0
Command `D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe compile -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\res\merged\nssh\debug D:\workspace\NewShieldSafeHouse\app\build\intermedia
tes\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\sdk_btn_qwerty_space.png` exited with non-zero value 0
Command `D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe compile -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\res\merged\nssh\debug D:\workspace\NewShieldSafeHouse\app\build\intermedia
tes\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\sdk_icon_ime_setting_reset.png` exited with non-zero value 0
Task :app:compressNsshDebugResourcesWithPngquant in app Finished
:app:compressNsshDebugResourcesWithPngquant (Thread[Execution worker for ':',5,main]) completed. Took 0.82 secs.
Successfully started process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compressNsshDebugResourcesWithPngquant'.
> Process 'command 'D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe'' finished with non-zero exit value 1

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

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 37s
72 actionable tasks: 23 executed, 47 from cache, 2 up-to-date
Successfully started process 'command 'D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe''
Successfully started process 'command 'D:\workspace\NewShieldSafeHouse\app\build\bin\pngquant.exe''
johnsonlee commented 4 years ago

Please run .\gradlew clean :app:assembleNsshDebug --info again and paste the output in this issue.

yueban commented 4 years ago

the full output content is too long (20k lines) to make this issue unreadable, so I upload it to a gist.

johnsonlee commented 4 years ago

the full output content is too long (20k lines) to make this issue unreadable, so I upload it to a gist.

Please run .\gradlew :app:assembleNsshDebug --info without clean and paste the output in this issue.

johnsonlee commented 4 years ago

Then, try to run the following command and see what happens:

D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe compile -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\res\merged\nssh\debug D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\sdk_gangbi.png
yueban commented 4 years ago

Please run .\gradlew :app:assembleNsshDebug --info without clean and paste the output in this issue.

the full output is [assembleNsshDebug.txt](). (the log is too long to paste it in a commnet because github has a limitation that maximum comment characters is 65536)


Then, try to run the following command and see what happens:

D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe compile -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\res\merged\nssh\debug D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\sdk_gangbi.png

As you can see, this time the error file is not sdk_gangbi.png but sdk_icon_ime_setting_dict.png, so I run (I add a -v param to see detail log):

D:\android_develop\sdk\build-tools\28.0.3\aapt2.exe compile -o D:\workspace\NewShieldSafeHouse\app\build\intermediates\res\merged\nssh\debug D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\sdk_icon_ime_setting_dict.png -v

and the output is:

D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\sdk_icon_ime_setting_dict.png: note: compiling PNG.
note:  paletteSize=114 alphaPaletteSize=112 maxGrayDeviation=185 grayScale=false.
note: encoding PNG PALETTE.
D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\sdk_icon_ime_setting_dict.png: note: original PNG is s
maller than crunched PNG, using original.
D:\workspace\NewShieldSafeHouse\app\build\intermediates\compressed_res_pngquant\nssh\debug\compressNsshDebugResourcesWithPngquant\mipmap-xxxhdpi-v4\sdk_icon_ime_setting_dict.png: note: legacy=970 new=96
2.
mipmap-xxxhdpi-v4_sdk_icon_ime_setting_dict.png.flat: error: failed to open file.
tanranran commented 3 years ago

What went wrong: Execution failed for task ':app:compressNatappvipReleaseResourcesWithPngquant'.

A problem occurred starting process 'command '\app\build\bin\pngquant.exe''

CreateProcess error=193, %1 不是有效的 Win32 应用程序。

查看 pngquant.exe大小为0

johnsonlee commented 3 years ago

What went wrong: Execution failed for task ':app:compressNatappvipReleaseResourcesWithPngquant'.

A problem occurred starting process 'command '\app\build\bin\pngquant.exe''

CreateProcess error=193, %1 不是有效的 Win32 应用程序。

查看 pngquant.exe大小为0

Windows 什么版本?

tanranran commented 3 years ago

@johnsonlee

版本 Windows 10 专业版 版本号 20H2 操作系统版本 19042.746

Android Studio 4.1.2 Build #AI-201.8743.12.41.7042882, built on December 20, 2020 Runtime version: 1.8.0_242-release-1644-b01 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0 GC: ParNew, ConcurrentMarkSweep Memory: 1237M Cores: 8 Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true

booster_version:3.1.0 gradle:6.5

1982582704 commented 2 years ago

win10 也遇到了。 CreateProcess error=193, %1 不是有效的 Win32 应用程序。

johnsonlee commented 2 years ago

目前没有 Windows 环境测试 🥺

1982582704 commented 2 years ago

因项目原因 项目中使用了阿里云仓库 maven { url 'https://maven.aliyun.com/repository/jcenter' } maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/public/' } maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' } maven { url 'https://maven.aliyun.com/repository/releases/' } 但是在项目中buildscript 中repositories中添加以上仓库 就会出现如图所示

下载失败, 但是如图所示

就可以下载成功。 请问这是因为什么呢?

demo 已上传

------------------ 原始邮件 ------------------ 发件人: "didi/booster" @.>; 发送时间: 2022年1月9日(星期天) 晚上11:39 @.>; 抄送: "bad @.**@.>; 主题: Re: [didi/booster] Could not initialize class com.didiglobal.booster.command.CommandService (#191)

目前没有 Windows 环境测试 🥺

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you commented.Message ID: @.***>

从QQ邮箱发来的超大附件

BoosterDemo.rar (43.95M, 无限期)进入下载页面:http://mail.qq.com/cgi-bin/ftnExs_download?k=76373166adf274cc82f81a104539061e06510750005a57071f5557565714005504001c5f575d571c560f0553050a565004045257633634735d584212064b70545f581f14024b340c&t=exs_ftn_download&code=271fc941

U201714642-GuiChunBai commented 2 years ago

求解决方案 M1存在同样的问题

johnsonlee commented 2 years ago

待我升级 M1 🤣

U201714642-GuiChunBai commented 2 years ago

大佬 请问M1已经适配好了吗?

johnsonlee commented 2 years ago

Not yet, everything is ready except the M1 machine, LOL

U201714642-GuiChunBai commented 2 years ago

you are the best!

JonathanKranz commented 2 years ago

大佬 请问M1已经适配好了吗?搞定了没有

JonathanKranz commented 2 years ago

// classpath "com.didiglobal.booster:booster-task-compression-pngquant:$booster_version" // classpath "io.johnsonlee.booster:booster-pngquant-provider:2.3.0"

MAC M1 arm64 这两个依赖无法编译

johnsonlee commented 2 years ago

替代方案:

去掉 classpath "io.johnsonlee.booster:booster-pngquant-provider:2.3.0" 在机器上直接安装 pngquant

johnsonlee commented 2 years ago

io.johnsonlee.booster:booster-pngquant-provider:2.4.0 released