Crashlytics not working with Instant Apps - firebase

I am migrating my project to an instant apps structure and I have had to disable Crashlytics to continue my development.
I have setup Crashlytics in the base module and applied all suugestions in this thread:
How do I integrate Crashlytics with Android Instant Apps?
However, this thread doesn't have any update in 2018.
This is the error that I get:
:base:fabricGenerateResourcesDebugFeature
ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Crashlytics found an invalid API key: null.
Check the Crashlytics plugin to make sure that the application has been added successfully!
Contact support#fabric.io for assistance.
at com.crashlytics.tools.android.DeveloperTools.processApiKey(DeveloperTools.java:375)
at com.crashlytics.tools.android.DeveloperTools.processProperties(DeveloperTools.java:517)
at com.crashlytics.tools.android.DeveloperTools.processArgsInternal(DeveloperTools.java:348)
at com.crashlytics.tools.android.DeveloperTools.gradleMain(DeveloperTools.java:292)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:46)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:91)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at com.crashlytics.tools.gradle.tasks.FabricTaskBuilder.callDevtoolsWrappingRuntimeExceptions(FabricTaskBuilder.groovy:367)
at com.crashlytics.tools.gradle.tasks.FabricTaskBuilder.this$2$callDevtoolsWrappingRuntimeExceptions(FabricTaskBuilder.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
at com.crashlytics.tools.gradle.tasks.FabricTaskBuilder$_pluginGenerateResources_closure4.doCall(FabricTaskBuilder.groovy:133)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:726)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:699)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
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:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
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:256)
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:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
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:55)
at java.lang.Thread.run(Thread.java:745)
:base:fabricGenerateResourcesDebugFeature FAILED
My root project gradle file:
buildscript {
project.ext.compileSdkVersion = 27
project.ext.buildToolsVersion = "27.0.1"
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'io.fabric.tools:gradle:1.26.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url 'https://maven.google.com'
}
jcenter()
}
}
My base module gradle file:
apply plugin: 'com.android.feature'
apply plugin: 'io.fabric'
android {
buildToolsVersion '27.0.1'
compileSdkVersion 27
baseFeature true
dataBinding {
enabled = true
}
defaultConfig {
minSdkVersion 21
targetSdkVersion 27
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled true
}
}
packagingOptions {
exclude 'LICENSE.txt'
}
}
ext {
supportLibVersion = "27.0.1"
espressoVersion = "2.2.2"
androidTestVersion = "0.5"
hamcrestVersion = "1.3"
junitVersion = "4.12"
}
crashlytics {
instantAppSupport true
}
dependencies {
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7'
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:cardview-v7:${supportLibVersion}"
compile "com.android.support:design:${supportLibVersion}"
compile "com.android.support:recyclerview-v7:${supportLibVersion}"
compile "com.android.support.test.espresso:espresso-idling-resource:${espressoVersion}"
testCompile "junit:junit:${junitVersion}"
androidTestCompile("com.android.support.test.espresso:espresso-core:${espressoVersion}") {
exclude module: "espresso-idling-resource"
exclude group: "com.android.support"
}
androidTestCompile("com.android.support.test.espresso:espresso-contrib:${espressoVersion}") {
exclude module: "espresso-core"
exclude module: "recyclerview-v7"
exclude group: "com.android.support"
}
androidTestCompile("com.android.support.test:rules:${androidTestVersion}") {
exclude group: "com.android.support"
}
androidTestCompile("com.android.support.test:runner:${androidTestVersion}") {
exclude group: "com.android.support"
}
androidTestCompile "org.hamcrest:hamcrest-core:${hamcrestVersion}"
}

Related

Flutter app crashes on start when applying fire base ( java.lang.RuntimeException: Unable to instantiate activity)

I had started a new project in flutter and i was applying fire store to it.
On following the steps to add my app to fire base it started to give error.
The error found in log cat when started app was
04-04 14:54:56.061 24084-24084/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.firestoreflutterchat, PID: 24084
java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.example.firestoreflutterchat-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.firestoreflutterchat-2, /vendor/lib, /system/lib]]
at android.app.ActivityThread.installProvider(ActivityThread.java:4869)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4461)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4401)
at android.app.ActivityThread.access$1500(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5097)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.example.firestoreflutterchat-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.firestoreflutterchat-2, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.ActivityThread.installProvider(ActivityThread.java:4854)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4461)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4401)
at android.app.ActivityThread.access$1500(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5097)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method
The app i am running on kit kat version device Xt1030
to remove this error i did some things in gradle and mostly described by others was multidex
so this is my gradle files :
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
mavenCentral()
// maven { url 'https://github.com/yongjhih/android-gradle-plugin.m2/raw/master/' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// Add this line
// classpath 'com.google.gms:google-services:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
//com.google.android.gms to 11.4.2.
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and gradle app:
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
// Add this line
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
// compileOptions {
// sourceCompatibility JavaVersion.VERSION
// targetCompatibility JavaVersion.VERSION 8
// }
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.firestoreflutterchat"
minSdkVersion 18
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// ndk {
// abiFilters 'armeabi-v7a'
// }
multiDexEnabled true
// productFlavors {
// dev {
// // Enable pre-dexing to produce an APK that can be tested on
// // Android 5.0+ without the time-consuming DEX build processes.
// minSdkVersion 21
// flavorDimensions "versionCode"
// }
// prod {
// // The actual minSdkVersion for the production version.
// minSdkVersion 18
// flavorDimensions "versionCode"
// }
// }
}
buildTypes {
release {
multiDexKeepFile file('multidex-config.txt')
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
// add the Firebase SDK for Google Analytics
implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'androidx.multidex:multidex:2.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
And in manifest file it was told to change name :
android:name="io.flutter.app.FlutterApplication"
to
android:name="androidx.multidex.MultiDexApplication"
or on another way of doing this
To add a class that extends flutter application
which on performing
package com.example.firestoreflutterchat
import android.content.Context
import androidx.multidex.MultiDex
import io.flutter.app.FlutterApplication
class App : FlutterApplication() {
override fun attachBaseContext(base: Context?) {
super.attachBaseContext(base)
MultiDex.install(this)
}
}
and then changing Android manifest from
android:name="io.flutter.app.FlutterApplication"
to
android:name=".App"
Now after doing all these still my app crash but with different error
04-05 18:22:18.266 10645-10645/com.example.firestoreflutterchat E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.firestoreflutterchat, PID: 10645
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.firestoreflutterchat/com.example.firestoreflutterchat.MainActivity}: java.lang.ClassCastException: com.example.firestoreflutterchat.MainActivity cannot be cast to android.app.Activity
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2124)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
at android.app.ActivityThread.access$800(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5097)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: com.example.firestoreflutterchat.MainActivity cannot be cast to android.app.Activity
at android.app.Instrumentation.newActivity(Instrumentation.java:1084)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2115)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257) 
at android.app.ActivityThread.access$800(ActivityThread.java:139) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5097) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
at dalvik.system.NativeStart.main(Native Method) 

Android App - using multidex and firebase - app crashes

In my app I'm using a barcode reader from play-services-vision. Because of added firebase messages dependencies, I had to add multidex suppport. But as soon as I add the firebase dependencies, the app crashes on my Galaxy S8 (Andriod 9). When I run the app and like to start the barcode functionality, the ap crashes with a class not found exception:
I did the steps to add multidex and firebase dependency adding step by step, as soon as I add firebase dependency - the crash occurs in the app.
exception:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: info....app, PID: 15574
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzsb;
at com.google.android.gms.vision.barcode.internal.client.zzd.zzchw(Unknown Source:13)
at com.google.android.gms.vision.barcode.internal.client.zzd.<init>(Unknown Source:20)
at com.google.android.gms.vision.barcode.BarcodeDetector$Builder.build(Unknown Source:6)
at com.google.android.gms.samples.vision.barcodereader.BarcodeCaptureActivity.createCameraSource(BarcodeCaptureActivity.java:184)
at com.google.android.gms.samples.vision.barcodereader.BarcodeCaptureActivity.onCreate(BarcodeCaptureActivity.java:105)
at android.app.Activity.performCreate(Activity.java:7327)
at android.app.Activity.performCreate(Activity.java:7318)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3094)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3257)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7050)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.internal.zzsb" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/info....app-wZywn7WMb4zo51Qz3E_qpg==/base.apk"],nativeLibraryDirectories=[/data/app/info....app-wZywn7WMb4zo51Qz3E_qpg==/lib/arm64, /system/lib64, /system/vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.google.android.gms.vision.barcode.internal.client.zzd.zzchw(Unknown Source:13)
at com.google.android.gms.vision.barcode.internal.client.zzd.<init>(Unknown Source:20)
at com.google.android.gms.vision.barcode.BarcodeDetector$Builder.build(Unknown Source:6)
at com.google.android.gms.samples.vision.barcodereader.BarcodeCaptureActivity.createCameraSource(BarcodeCaptureActivity.java:184)
at com.google.android.gms.samples.vision.barcodereader.BarcodeCaptureActivity.onCreate(BarcodeCaptureActivity.java:105)
at android.app.Activity.performCreate(Activity.java:7327)
at android.app.Activity.performCreate(Activity.java:7318)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3094)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3257)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7050)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
build.gradle excerpt:
compileSdkVersion 27
defaultConfig {
applicationId "info....app"
minSdkVersion 16
targetSdkVersion 27
versionCode 101
versionName "1.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.configrelease
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-compat:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// Important - the CameraSource implementation in this project requires version 8.1 or higher.
implementation 'com.google.android.gms:play-services-vision:9.4.0+'
implementation 'com.android.support:design:27.1.1'
// firebase
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.4'
}

Corda with springboot build JAR

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

Error running ./gradlew clean deployNodes

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.

java.lang.NoSuchFieldError: No static field zzakj of type Lcom/google/android/gms/common/ConnectionResult

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.

Resources