Gradle command line build exception


(zhaomingnpu@gmail.com) #1

when i use gradle command line to build a android project, i got this error

  • What went wrong:
    A problem occurred evaluating project ‘’.

org/bouncycastle/jce/provider/BouncyCastleProvider

this is stacktrace

Caused by: java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
at com.android.build.gradle.internal.dsl.SigningConfigFactory.create(SigningConfigFactory.java:47)
at com.android.build.gradle.internal.dsl.SigningConfigFactory.create(SigningConfigFactory.java:32)
at org.gradle.api.internal.FactoryNamedDomainObjectContainer.doCreate(FactoryNamedDomainObjectContainer.java:100)
at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:67)
at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:50)
at com.android.build.gradle.internal.variant.LibraryVariantFactory.createDefaultComponents(LibraryVariantFactory.java:156)
at com.android.build.gradle.BasePlugin.configureExtension(BasePlugin.java:496)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
at com.android.build.gradle.BasePlugin.apply(BasePlugin.java:271)
at com.android.build.gradle.LibraryPlugin.apply(LibraryPlugin.java:136)
at com.android.build.gradle.LibraryPlugin.apply(LibraryPlugin.java:47)
at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:42)
at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:50)
at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:163)
at org.gradle.api.internal.plugins.DefaultPluginManager.access$200(DefaultPluginManager.java:46)
at org.gradle.api.internal.plugins.DefaultPluginManager$AddPluginBuildOperation.run(DefaultPluginManager.java:251)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:143)
at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:124)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyType(DefaultObjectConfigurationAction.java:120)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:38)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:86)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:143)
at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:46)
at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.java:34)
at org.gradle.api.Script$apply.callCurrent(Unknown Source)
at build_738plxtpbxz7s84gfir5eon4g.run(/var/lib/jenkins/workspace/SmartHome-DB/SmartHome/aftercrashprocessor/build.gradle:1)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:90)


(zhaomingnpu@gmail.com) #2

gradle version is 4.8