I have recently moved an enterprise CorDapp to a different machine running Ubuntu. I have install all the correct dependencies as described in the docs. When I initially run ./gradlew clean deployNodes, everything builds fine. However, when I do subsequent builds, I keep getting the error:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':cordapp-source:deployNodes'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
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.IllegalStateException: Error while generating node info file. Please check the logs in /home/ubuntu/cordapp/cordapp-source/build/nodes/Node1/logs.
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion.generateNodeInfo(NetworkBootstrapper.kt:112)
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion.access$generateNodeInfo(NetworkBootstrapper.kt:71)
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion$generateNodeInfos$1$1.invoke(NetworkBootstrapper.kt:95)
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion$generateNodeInfos$1$1.invoke(NetworkBootstrapper.kt:71)
at net.corda.core.internal.concurrent.ValueOrException$DefaultImpls.capture(CordaFutureImpl.kt:140)
at net.corda.core.internal.concurrent.OpenFuture$DefaultImpls.capture(CordaFutureImpl.kt)
at net.corda.core.internal.concurrent.CordaFutureImpl.capture(CordaFutureImpl.kt:152)
at net.corda.core.internal.concurrent.CordaFutureImplKt$fork$$inlined$also$lambda$1.run(CordaFutureImpl.kt:32)
Suppressed: java.lang.IllegalStateException: Error while generating node info file. Please check the logs in /home/ubuntu/cordapp/cordapp-source/build/nodes/Node2/logs.
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion.generateNodeInfo(NetworkBootstrapper.kt:112)
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion.access$generateNodeInfo(NetworkBootstrapper.kt:71)
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion$generateNodeInfos$1$1.invoke(NetworkBootstrapper.kt:95)
at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion$generateNodeInfos$1$1.invoke(NetworkBootstrapper.kt:71)
at net.corda.core.internal.concurrent.ValueOrException$DefaultImpls.capture(CordaFutureImpl.kt:140)
at net.corda.core.internal.concurrent.OpenFuture$DefaultImpls.capture(CordaFutureImpl.kt)
at net.corda.core.internal.concurrent.CordaFutureImpl.capture(CordaFutureImpl.kt:152)
at net.corda.core.internal.concurrent.CordaFutureImplKt$fork$$inlined$also$lambda$1.run(CordaFutureImpl.kt:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Furthermore, the log files for the nodes are mostly empty and don't give any clue as to what is going on. Initially I thought it may be to do with heap size as this new machine has 8 cores but I don't get any 'out of memory' errors. Any suggestions as to where to look would be greatly appreciated!
Below are the build.gradle files I am using:
In build.gradle:
buildscript {
ext.corda_release_distribution = 'com.r3.corda'
ext.corda_release_version = '3.1'
ext.corda_gradle_plugins_version = '4.0.25'
ext.kotlin_version = '1.2.50'
ext.junit_version = '4.12'
ext.okhttp_version = '3.5.0'
ext.commons_validator_version = '1.4.1'
ext.joda_version = '2.9.9'
ext.aws_java_sdk_version = '1.11.228'
ext.apache_tika_version = '1.11'
ext.postgresql_version = '42.2.2'
ext.rabbitmq_amqp_version = '3.3.4'
ext.spring_boot_version = '2.0.2.RELEASE'
ext.spring_boot_gradle_plugin_version = '2.0.2.RELEASE'
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "net.corda.plugins:cordapp:$corda_gradle_plugins_version"
classpath "net.corda.plugins:cordformation:$corda_gradle_plugins_version"
classpath "net.corda.plugins:quasar-utils:$corda_gradle_plugins_version"
classpath "org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_gradle_plugin_version"
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://dl.bintray.com/kotlin/exposed' }
maven { url 'https://jitpack.io' }
}
}
In src/build.grade:
apply plugin: 'kotlin'
apply plugin: 'net.corda.plugins.cordapp'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'net.corda.plugins.quasar-utils'
jar.baseName = "test-ledger"
sourceSets {
main {
resources {
srcDir "../config/dev"
}
}
test {
resources {
srcDir "../config/test"
}
}
integrationTest {
kotlin {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/kotlin')
}
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
dependencies {
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testCompile "junit:junit:$junit_version"
// Corda integration dependencies
cordaCompile "$corda_release_distribution:corda-core:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-finance:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-jackson:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-rpc:$corda_release_version"
cordaRuntime "$corda_release_distribution:corda:$corda_release_version"
testCompile "$corda_release_distribution:corda-node-driver:$corda_release_version"
// CorDapp dependencies
cordapp "$corda_release_distribution:corda-finance:$corda_release_version"
compile "org.postgresql:postgresql:$postgresql_version"
compile "commons-validator:commons-validator:$commons_validator_version"
compile "com.squareup.okhttp3:okhttp:$okhttp_version"
compile "joda-time:joda-time:$joda_version"
compile "com.amazonaws:aws-java-sdk-s3:$aws_java_sdk_version"
compile "org.apache.tika:tika-core:$apache_tika_version"
compile "com.rabbitmq:amqp-client:$rabbitmq_amqp_version"
}
task integrationTest(type: Test, dependsOn: []) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
languageVersion = "1.1"
apiVersion = "1.1"
jvmTarget = "1.8"
javaParameters = true // Useful for reflection.
}
}
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
directory "./build/nodes"
node {
name "O=Notary,L=Sydney,C=AU"
notary = [validating : false]
p2pPort 10002
rpcSettings {
address("localhost:10003")
adminAddress("localhost:10043")
}
cordapps = ["$corda_release_distribution:corda-finance:$corda_release_version"]
}
node {
name "O=Node1,L=Sydney,C=AU"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
cordapps = ["$corda_release_distribution:corda-finance:$corda_release_version"]
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
}
node {
name "O=Node2,L=Sydney,C=AU"
p2pPort 10008
rpcSettings {
address("localhost:10009")
adminAddress("localhost:10049")
}
cordapps = ["$corda_release_distribution:corda-finance:$corda_release_version"]
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
}
}
Below is the only change that I make to the build.gradle file to shift from Enterprise to Open Source which runs as expected (I can keep running ./gradlew clean deployNodes).
ext.corda_release_distribution = 'net.corda'
ext.corda_release_version = '3.2-corda'
ext.corda_gradle_plugins_version = '3.1.0'
ext.kotlin_version = '1.1.60'
ext.junit_version = '4.12'
ext.quasar_version = '0.7.9'
Try removing the the "clean" task from ./gradlew clean build
What version of Gradle are you using? We have noticed that unless you are using 4.8 or 4.9 the build fails. You may try to see what your Gradle wrapper is specifying.
Related
I've tried using this with the following constants:
cordaReleaseGroup=net.corda
cordaCoreReleaseGroup=net.corda
cordaVersion=4.5.1
cordaCoreVersion=4.5.1
gradlePluginsVersion=5.0.9
kotlinVersion=1.2.71
junitVersion=4.12
quasarVersion=0.7.10
log4jVersion=2.11.2
platformVersion=5
slf4jVersion=1.7.25
... with the following deployNodes
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
nodeDefaults {
projectCordapp {
deploy = false
}
cordapp project(':contracts')
cordapp project(':workflows')
quasarExcludePackages = ["io.cordite.braid.libs**"]
}
Gradle throws an error for unknown property for quasarExcludePackages.
You need to add it via extra config like so:
nodeDefaults {
projectCordapp {
deploy = false
}
cordapp project(':contracts')
cordapp project(':workflows')
extraConfig = ["quasarExcludePackages": ["io.cordite.braid.libs**"]]
}
I am trying for corda integration with spring boot.
I have found few example over internet.
I have followed example "joeldudleyr3/spring-observable-stream" at enter link description here.
I have tried to make fat jar using corda sample irs-demo with above mentioned example. but it gives runtime error as:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rpcClient' defined in class path resource [net/corda/server/serviceExample.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [net.corda.core.messaging.CordaRPCOps]: Factory method 'rpcClient' threw exception; nested exception is java.lang.NoClassDefFoundError: org/apache/activemq/artemis/api/core/RoutingType
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[classes!/:?]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) ~[classes!/:?]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) ~[classes!/:?]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[classes!/:?]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[classes!/:?]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[classes!/:?]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[classes!/:?]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[classes!/:?]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[classes!/:?]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[classes!/:?]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) ~[classes!/:?]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[classes!/:?]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[classes!/:?]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [classes!/:?]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [classes!/:?]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [classes!/:?]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [classes!/:?]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [classes!/:?]
at net.corda.server.Server$Companion.main(Server.kt:35) [classes!/:?]
at net.corda.server.Server.main(Server.kt) [classes!/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [webserver-0.1.jar:?]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [webserver-0.1.jar:?]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [webserver-0.1.jar:?]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [webserver-0.1.jar:?]
... 27 more
Edit:
Parent Gradle file:
buildscript {
ext.corda_release_version = '3.2-corda'
ext.corda_release_group = 'net.corda'
ext.corda_release_distribution = 'net.corda'
ext.corda_gradle_plugins_version = '3.0.9'
ext.kotlin_version = '1.1.60'
ext.junit_version = '4.12'
ext.quasar_version = '0.7.9'
ext.jolokia_version = '1.3.7'
ext.spring_boot_version = '1.5.7.RELEASE'
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "net.corda.plugins:cordapp:$corda_gradle_plugins_version"
classpath "net.corda.plugins:publish-utils:$corda_gradle_plugins_version"
classpath "net.corda.plugins:cordformation:$corda_gradle_plugins_version"
classpath "net.corda.plugins:quasar-utils:$corda_gradle_plugins_version"
classpath "org.springframework.boot:spring-boot-gradle-plugin:$spring_boot_version"
classpath "io.spring.gradle:dependency-management-plugin:1.0.4.RELEASE"
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
}
}
apply plugin: 'kotlin'
apply plugin: 'idea'
apply plugin: 'application'
Gradle file for spring boot server is:
buildscript {
ext.spring_boot_version = '1.5.7.RELEASE'
ext.spring_version = '4.3.11.RELEASE'
}
plugins {
id 'com.craigburke.client-dependencies' version '1.4.0'
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url 'https://dl.bintray.com/kotlin/exposed' }
maven { url 'https://jitpack.io' }
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases' }
}
apply plugin: 'kotlin'
apply plugin: 'net.corda.plugins.cordapp'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'org.springframework.boot'
apply plugin: 'kotlin-spring'
apply plugin: 'application'
sourceSets {
main {
resources {
srcDir "../config/dev"
}
}
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-web') {
exclude module: "spring-boot-starter-logging"
exclude module: "logback-classic"
}
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testCompile "junit:junit:$junit_version"
// Corda integration dependencies
cordaCompile "$corda_release_distribution:corda-core:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-finance:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-jackson:$corda_release_version"
cordaCompile "$corda_release_distribution:corda-rpc:$corda_release_version"
cordaRuntime "$corda_release_distribution:corda:$corda_release_version"
testCompile "$corda_release_distribution:corda-node-driver:$corda_release_version"
// testCompile "$corda_release_distribution:corda-node-driver:$corda_release_version"
compile("org.springframework.boot:spring-boot-starter-websocket:$spring_boot_version") {
exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
}
compile "org.springframework.boot:spring-boot-starter-log4j2:$spring_boot_version"
compile "org.apache.logging.log4j:log4j-web:2.7"
cordapp project(":cordapp")
}
bootRepackage {
enabled = true
}
jar {
from sourceSets.test.output
dependsOn clientInstall
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
languageVersion = "1.1"
apiVersion = "1.1"
jvmTarget = "1.8"
javaParameters = true // Useful for reflection.
}
}
task runBank1WebServer(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'net.corda.server.ServerKt'
environment "server.port", "8080"
environment "config.rpc.port", "10008"
}
task runBank2WebServer(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'net.corda.server.ServerKt'
environment "server.port", "8081"
environment "config.rpc.port", "10011"
}
task runObserverWebServer(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'net.corda.server.ServerKt'
environment "server.port", "8082"
environment "config.rpc.port", "10014"
}
task deployWebapps(type: Copy, dependsOn: ['jar', 'bootRepackage']) {
ext.webappDir = file("build/webapps")
from(jar.outputs)
from("src/test/resources/scripts/") {
filter { it
.replace('#JAR_PATH#', jar.archiveName)
.replace('#DIR#', ext.webappDir.getAbsolutePath())
}
}
into ext.webappDir
}
Typically, if you want to simply build a fat jar for the Spring Server Client instead of using the gradle tasks, you can use ./gradlew assemble to build the jar for the client. It will be at the /clients/build/lib/ folder.
Then you can run the client with command line args:
java -jar clients-0.1.jar --server.port=8080 --config.rpc.host=localhost --config.rpc.port=10006 --config.rpc.username=user1 --config.rpc.password=test
The above is based on the assumption that you had followed the structure offered in the cordapp-templates at here: https://github.com/corda/cordapp-template-kotlin/tree/release-V4/clients/src/main/kotlin/com/template
I keep getting the following error when I am trying to run the build after completing all the RNFIREBASE steps to install Firebase for my react-native project.
RN version: 0.55.3
Using appcenter for builds
The build was working fine on appcenter when I did not add firebase. The build on iOS is working on the phone and appcenter.
Error
> - Trying to run build on Appcenter. Using configuration: release
>
> Resolved com.facebook.react:react-native:0.55.3 in :react-native-firebase:releaseCompileClasspath
Resolved com.android.support:support-v4:27.0.2 in :react-native-firebase:releaseCompileClasspath
Resolved com.crashlytics.sdk.android:crashlytics:2.9.3 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.android.gms:play-services-base:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-ads:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-auth:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-config:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-core:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-crash:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-database:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-firestore:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-invites:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-storage:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-messaging:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved com.google.firebase:firebase-perf:11.6.0 in :react-native-firebase:releaseCompileClasspath
Resolved me.leolin:ShortcutBadger:1.1.21 in :react-native-firebase:releaseCompileClasspath
Resolved com.android.support:multidex:1.0.2 in :react-native-firebase:releaseCompileClasspath
:react-native-firebase:compileReleaseAidl FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':react-native-firebase:releaseCompileClasspath'.
> Could not find com.google.firebase:firebase-functions:11.6.0.
Searched in the following locations:
file:/Users/vsts/Library/Android/sdk/extras/m2repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
file:/Users/vsts/Library/Android/sdk/extras/m2repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
file:/Users/vsts/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
file:/Users/vsts/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
file:/Users/vsts/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
file:/Users/vsts/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
file:/Users/vsts/.m2/repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
file:/Users/vsts/.m2/repository/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
https://jcenter.bintray.com/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
https://jcenter.bintray.com/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
file:/Users/vsts/agent/2.140.0/work/1/s/node_modules/react-native/android/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
file:/Users/vsts/agent/2.140.0/work/1/s/node_modules/react-native/android/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
https://maven.google.com/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.pom
https://maven.google.com/com/google/firebase/firebase-functions/11.6.0/firebase-functions-11.6.0.jar
Required by:
project :react-native-firebase
android/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'
classpath 'io.fabric.tools:gradle:1.25.4'
classpath 'com.google.firebase:firebase-plugins:1.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.google.android.gms') {
details.useVersion '11.6.0'
}
if (requested.group == 'com.google.firebase') {
details.useVersion '11.6.0'
}
}
}
}
}
ext {
compileSdkVersion = 27
buildToolsVersion = '27.0.3'
}
subprojects { subproject ->
afterEvaluate{
if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
// buildToolsVersion rootProject.ext.buildToolsVersion
lintOptions {
checkReleaseBuilds false
}
}
}
}
}
app/build.gradle
apply plugin: "com.android.application"
apply plugin: "io.fabric"
apply plugin: "com.google.firebase.firebase-perf"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
project.ext.envConfigFiles = [
debug : ".env",
staging: ".env",
release: ".env",
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
// buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
resValue "string", "build_config_package", "in.app"
applicationId "in.app"
minSdkVersion 19
targetSdkVersion 27
versionCode 5
versionName "2.1.5"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
if (project.hasProperty('RELEASE_STORE_FILE')) {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
debug {
buildConfigField "String", "CODE_PUSH_KEY", '""'
applicationIdSuffix ".debug"
versionNameSuffix '-DEBUG'
}
releaseStaging {
// initWith(buildTypes.release)
buildConfigField "String", "CODE_PUSH_KEY", ''
signingConfig signingConfigs.release
applicationIdSuffix ".staging"
}
release {
buildConfigField "String", "CODE_PUSH_KEY", ''
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def versionCodes = ["armeabi-v7a": 1, "x86": 2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation project(':react-native-firebase')
implementation 'com.google.firebase:firebase-functions:16.0.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4#aar') { transitive = true }
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4#aar') { transitive = true }
implementation 'com.google.android.gms:play-services-base:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-crash:11.8.0'
implementation 'com.google.firebase:firebase-perf:16.0.0'
api project(':react-native-vector-icons')
api project(':react-native-svg')
api project(':react-native-paytm')
api project(':react-native-image-resizer')
api project(':react-native-image-picker')
api project(':react-native-google-fit')
api project(':react-native-device-info')
api project(':react-native-config')
api project(':react-native-code-push')
api project(':react-native-razorpay')
api fileTree(include: ['*.jar'], dir: 'libs')
api 'com.android.support:appcompat-v7:26.0.1'
api 'com.facebook.react:react-native:+'
// From node_modules
}
// Run this once to be able to run the application with BUCK
// puts all api dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.api
into 'libs'
}
apply plugin: 'com.google.gms.google-services'
I follow the steps in the google developers, and I can run the sign-in demo.
Add the dependency to your project-level build.gradle
classpath 'com.google.gms:google-services:3.0.0'
Add the plugin to your app-level build.gradle:
apply plugin: 'com.google.gms.google-services'
In your app-level build.gradle file, declare Google Play Services as a dependency:
apply plugin: 'com.android.application'
...
dependencies {
compile 'com.google.android.gms:play-services-auth:9.8.0'
}
Here's my project build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here's my app build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "net.kdapp.partygor"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
jniDebuggable false
//signingConfig signingConfigs.cic
renderscriptDebuggable false
}
debug {
debuggable true
jniDebuggable true
renderscriptDebuggable true
//signingConfig signingConfigs.cic
minifyEnabled true
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// 日曆視圖自定義 view
// 雙向 seekBar
// 輪播圖
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.ashokvarma.android:bottom-navigation-bar:1.3.0'
compile 'com.daimajia.slider:library:1.1.5#aar'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.zhy:okhttputils:2.6.2'
compile 'com.prolificinteractive:material-calendarview:1.4.3'
compile 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
compile 'com.youth.banner:banner:1.4.9'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
// Dependency for Google Sign-In
compile 'com.google.android.gms:play-services-auth:11.0.1'
testCompile 'junit:junit:4.12'
compile project(':redpacketlibrary')
compile project(':easeui')
compile project(path: ':pickerview')
compile files('libs/parse-android-1.13.0.jar')
compile files('libs/android-support-multidex.jar')
}
apply plugin: 'com.google.gms.google-services'
But when I run my project, I get this error.
08-04 09:34:45.420 22456-22456/net.kdapp.partygor E/AndroidRuntime: FATAL EXCEPTION: main
Process: net.kdapp.partygor, PID: 22456
java.lang.NoSuchFieldError: No static field zzazX of type Lcom/google/android/gms/common/ConnectionResult; in class Lcom/google/android/gms/common/ConnectionResult; or its superclasses (declaration of 'com.google.android.gms.common.ConnectionResult' appears in /data/data/net.kdapp.partygor/files/instant-run/dex/slice-google-play-services_78c2c5fe145c1c95c9696f0679d986433b0c2b89-classes.dex)
at com.google.android.gms.common.internal.zzo.zzrj(Unknown Source)
at com.google.android.gms.common.internal.zze.zzs(Unknown Source)
at com.google.android.gms.common.internal.zzi.zzrk(Unknown Source)
at com.google.android.gms.common.internal.zzh.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5877)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1019)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:814)
I search in google many times and change the google-services api version, but it still didn't work.
The problem:
I have a jar in some repository.
I want to run the jar and do something with it during gradle task.
The attempt:
apply plugin: 'java'
repositories {
maven {
url "<<<valid repo url>>>"
}
mavenCentral()
}
dependencies {
compile(group: 'com.google.developers', name: 'compiler', version: 'v20150315', ext: 'pom')
}
task doTheJar {
dependsOn configurations.compile
exec {
executable "sh"
args "-c","java -jar <<the-artifact>> smoething something"
}
}
Is there a way to do it?
Is there a way to do it without java plugin?
Thanks.
It will be better to do it in the following way:
apply plugin: 'java'
repositories {
maven {
url "<<<valid repo url>>>"
}
mavenCentral()
}
configurations {
runjar
}
dependencies {
runjar 'some:artifact:1.0'
}
task runTheJar(type: JavaExec) {
main 'main.class.to.be.run'
classpath configurations.runjar
args 's1', 's2', 's3'
}