Transitive dependencies of CordApp doesn't get updated - corda

original question. How do I update the transitive dependency of cordApp to use Artemis 2.5.0. I'm following this corda-ftp demo. Updated the build.gradle as shown below. when I do gradle dependencies I see Artemis 2.5.0 wins but somehow the nodes pick up 2.2.0 as I can see in classpath in nodes logs.
buildscript {
ext.corda_release_version = '3.1-corda'
ext.corda_gradle_plugins_version = '3.1.0'
ext.quasar_version = '0.7.9'
ext.junit_version = '4.12'
ext.spring_boot_version = '2.0.2.RELEASE'
ext.corda_release_group = 'net.corda'
ext.kotlin_version = '1.1.60'
ext.username = "corda"
ext.password = "corda_initial_password"
ext.client_port = 10009
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 "io.spring.gradle:dependency-management-plugin:1.0.5.RELEASE"
}
}
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' }
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-dev/' }
}
apply plugin: 'kotlin'
apply plugin: "io.spring.dependency-management"
apply plugin: 'net.corda.plugins.cordapp'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'net.corda.plugins.quasar-utils'
dependencyManagement {
dependencies {
dependencySet(group: 'org.apache.activemq', version: '2.5.0') {
entry 'artemis-amqp-protocol'
entry 'artemis-commons'
entry 'artemis-core-client'
entry 'artemis-jdbc-store'
entry 'artemis-jms-client'
entry 'artemis-journal'
entry 'artemis-native'
entry 'artemis-selector'
entry 'artemis-server'
}
}
}
sourceSets {
main {
resources {
srcDir "config/dev"
}
}
test {
resources {
srcDir "config/test"
}
}
}
dependencies {
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_group:corda-core:$corda_release_version"
cordaCompile "$corda_release_group:corda-finance:$corda_release_version"
cordaCompile "$corda_release_group:corda-jackson:$corda_release_version"
cordaCompile "$corda_release_group:corda-rpc:$corda_release_version"
cordaCompile "$corda_release_group:corda-node-api:$corda_release_version"
cordaCompile "$corda_release_group:corda-webserver-impl:$corda_release_version"
cordaRuntime "$corda_release_group:corda:$corda_release_version"
cordaRuntime "$corda_release_group:corda-webserver:$corda_release_version"
testCompile "$corda_release_group:corda-test-utils:$corda_release_version"
testCompile "$corda_release_group:corda-node-driver:$corda_release_version"
// GraphStream: For visualisation (required by TemplateClientRPC app)
compile "org.graphstream:gs-core:1.3"
compile("org.graphstream:gs-ui:1.3") {
exclude group: "bouncycastle"
}
// CorDapp dependencies
// Specify your cordapp's dependencies below, including dependent cordapps
compile "io.reactivex:rxjava:1.2.4"
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
languageVersion = "1.1"
apiVersion = "1.1"
jvmTarget = "1.8"
javaParameters = true // Useful for reflection.
}
}
def copyConfigTask(nodeName) {
return tasks.create("copy${nodeName}", Copy) {
from "${nodeName}.json"
into "./build/nodes/${nodeName}/"
rename {
"cordaftp.json"
}
}
}
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar', copyConfigTask("CorpA"), copyConfigTask("CorpB")]) {
directory "./build/nodes"
node {
name "O=R3Corp,OU=corda,L=London,C=GB"
notary = [validating : false]
p2pPort 10002
rpcSettings {
address("localhost:10003")
adminAddress("localhost:10043")
}
cordapps = []
}
node {
name "O=CorpA,L=Paris,C=FR"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
extraConfig = [
jvmArgs : [ "-Xmx1g"],
attachmentContentCacheSizeMegaBytes: 100
]
cordapps = []
// TODO: Replace username / password with vars such that we can DRY the username, password
rpcUsers = [[ "user": "corda", "password": "corda_initial_password", "permissions": ["ALL"]]]
}
node {
name "O=CorpB,L=Rome,C=IT"
p2pPort 10008
rpcSettings {
address("localhost:10009")
adminAddress("localhost:10049")
}
extraConfig = [
jvmArgs : [ "-Xmx1g"],
attachmentContentCacheSizeMegaBytes: 100
]
cordapps = []
// TODO: Ditto
rpcUsers = [[ "user": "corda", "password": "corda_initial_password", "permissions": ["ALL"]]]
}
}
task(runClientB, dependsOn: 'classes', type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'net.corda.cordaftp.SenderKt'
args "localhost:$client_port", "$username", "$password", "build/nodes/CorpB/cordaftp.json"
}

You cannot control which versions of dependencies the nodes use internally. You can only control the dependencies used by your CorDapp.

Related

Trying to write simple hello world to firebase database

I'm trying to write to my firebase Realtime database but I cannot figure why I cant. I'm just starting to implement it but I cant figure out why my .setValue()in my onCreate is not working. I've brought in my google-servies doc and i've followed the code in the tutorial in android studio but still no luck. I also dont think its an error with dependences but it still could be for all i know. I'm not getting any errors so im really at a lost. Has anybody any suggestions. Here is the relevant code:
class CreateAPostFragment : Fragment() {
var post = PostModel()
val database = FirebaseDatabase.getInstance("HERE IS MY URL TO THE DATABASE")
val myRef = database.getReference("test")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
myRef.setValue("Hello World")
println("added")
println(myRef)
}
Build.gradle(Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.32"
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(module)
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id "kotlin-kapt"
id 'com.google.gms.google-services'
}
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "ie.wit.savvytutor"
minSdkVersion 29
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:29.0.4')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation('com.google.firebase:firebase-database-ktx')
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.0.0'
//noinspection GradleCompatible
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation "androidx.drawerlayout:drawerlayout:1.1.1"
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
apply plugin: 'com.google.gms.google-services'
androidTestImplementation("com.android.support.test.espresso:espresso-contrib:2.2.2") {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'support-v7'
exclude group: 'com.android.support', module: 'design'
exclude module: 'support-annotations'
exclude module: 'recyclerview-v7'
}
}

Failed to resolve: com.google.firebase:firebase-firestore:11.0.4 in Android Studio 3.0.1

I am using Android Studio version (3.0.1) and I installed Google Play Services and Google Repository
I tried using
maven {
url 'https://maven.google.com'
}
in project gradle
this is my project grandle:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and this is my app build grandle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.congdong85.hn.hoangnguyen.doanungdungcast"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-database:11.0.4'
implementation 'com.google.firebase:firebase-core:11.0.4'
implementation 'com.google.firebase:firebase-auth:11.0.4'
implementation 'com.google.firebase:firebase-storage:11.0.4'
implementation 'com.google.firebase:firebase-firestore:11.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
implementation 'com.android.support:cardview-v7:26.1.0'
}
apply plugin: 'com.google.gms.google-services'
and I still get message when sync
Error:(27, 20) Failed to resolve:
com.google.firebase:firebase-firestore:11.0.4
I can't sync com.google.firebase:firebase-firestore:11.0.4 plase help me.
change this:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
into this:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
You need to add the google() repo in the top level gradle file, as specified in the firebase docs and also it should be before jcenter()

Building cordapp jar and deploy in new node

I am trying to integrate the two examples (Corda java template: https://github.com/corda/cordapp-template-java and Oracle example: https://github.com/corda/oracle-example ) so as to integrate Oracle node in the template.
I changed build.gradle, settings.gradle and copied base and service package to template folder. Though, the project is not logically linked as Oracle corresponds to different service, it does compiles and create classes under build folder successfully. After re-syncing gradle project, the gradle tasks were successfully updated and I am able to run deployNodes successfully.
However, no jar is present in build/nodes/Oracle/cordapp folder.
Kindly advise if additional changes needs to be done.
Git url for changes made: https://github.com/ashubisht/cordapp-template-java/tree/OracleIntegration_IOURelV3_0307
Here's the updated gradle file
buildscript {
ext.corda_release_group = 'net.corda'
ext.corda_release_version = '3.1-corda'
ext.corda_gradle_plugins_version = '3.1.0'
ext.junit_version = '4.12'
ext.quasar_version = '0.7.9'
ext.kotlin_version = '1.1.60'
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"
}
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://ci-artifactory.corda.r3cev.com/artifactory/corda-releases' }
}
apply plugin: 'kotlin'
apply plugin: 'java'
apply plugin: 'net.corda.plugins.cordapp'
apply plugin: 'net.corda.plugins.cordformation'
apply plugin: 'net.corda.plugins.quasar-utils'
sourceSets {
main {
resources {
srcDir "config/dev"
}
}
test {
resources {
srcDir "config/test"
}
}
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
}
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
dependencies {
testCompile "junit:junit:$junit_version"
// Corda integration dependencies
cordaCompile "$corda_release_group:corda-core:$corda_release_version"
cordaCompile "$corda_release_group:corda-finance:$corda_release_version"
cordaCompile "$corda_release_group:corda-jackson:$corda_release_version"
cordaCompile "$corda_release_group:corda-rpc:$corda_release_version"
cordaCompile "$corda_release_group:corda-node-api:$corda_release_version"
cordaCompile "$corda_release_group:corda-webserver-impl:$corda_release_version"
cordaRuntime "$corda_release_group:corda:$corda_release_version"
cordaRuntime "$corda_release_group:corda-webserver:$corda_release_version"
testCompile "$corda_release_group:corda-node-driver:$corda_release_version"
// CorDapp dependencies
// Specify your CorDapp's dependencies below, including dependent CorDapps.
// We've defined Cash as a dependent CorDapp as an example.
cordapp project(":cordapp")
cordapp project(":cordapp-contracts-states")
//Added oracle support to template for testing/ experimenting configs
cordapp project(":base")
cordapp project(":service")
//Oracle changes end here
cordapp "$corda_release_group:corda-finance:$corda_release_version"
}
task integrationTest(type: Test, dependsOn: []) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-parameters" // Required for passing named arguments to your flow via the shell.
}
task deployNodes(type: net.corda.plugins.Cordform, dependsOn: ['jar']) {
directory "./build/nodes"
node {
name "O=Notary,L=London,C=GB"
notary = [validating : true]
p2pPort 10002
cordapps = [
"$project.group:cordapp-contracts-states:$project.version",
"$project.group:cordapp:$project.version",
"$corda_release_group:corda-finance:$corda_release_version"
]
}
node {
name "O=PartyA,L=London,C=GB"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
webPort 10007
cordapps = [
"$project.group:cordapp-contracts-states:$project.version",
"$project.group:cordapp:$project.version",
"$corda_release_group:corda-finance:$corda_release_version"
]
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}
node {
name "O=PartyB,L=New York,C=US"
p2pPort 10008
rpcSettings {
address("localhost:10009")
adminAddress("localhost:10049")
}
webPort 10010
cordapps = [
"$project.group:cordapp-contracts-states:$project.version",
"$project.group:cordapp:$project.version",
"$corda_release_group:corda-finance:$corda_release_version"
]
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}
node {
name "O=Oracle,L=New York,C=US"
p2pPort 10011
rpcSettings {
address("localhost:10012")
adminAddress("localhost:10052")
}
webPort 10013
//The below cordapps will be deployed to oracle.
//Create below packages named base and service and add to dependency
cordapps = [
"$project.group:cordapp-contracts-states:$project.version",
"net.corda.examples.oracle:base:1.0",
"net.corda.examples.oracle:service:1.0"
]
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
}
}
task runTemplateClient(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'com.template.TemplateClient'
args 'localhost:10006'
}
When defining your oracle node in deployNodes, you have provided the following cordapps block:
cordapps = [
"$project.group:cordapp-contracts-states:$project.version",
"net.corda.examples.oracle:base:1.0",
"net.corda.examples.oracle:service:1.0"
]
However, your project's group, as given in your project's gradle.properties file, is com.template. Therefore you need to specify your CorDapps as follows:
cordapps = [
"$project.group:cordapp-contracts-states:$project.version",
"com.template:base:0.1",
"com.template:service:0.1"
]
Alternatively, you can use the following shorthand:
cordapps = [
"$project.group:cordapp-contracts-states:$project.version",
"$project.group:base:0.1",
"$project.group:service:0.1"
]

Can't send Firebase crash report

I have configured Firebase Crash Reporting. The log is showing that the initialization is successful, but when I send report exception by invoking test exception:
FirebaseCrash.report(new Exception("Oppss!!!"));
I get this exception:
E/FirebaseCrash: Error sending crash report
bmk: Server did not receive report: Origin Error message: The caller does not have permission
my build.gradle is
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply plugin: 'com.google.firebase.firebase-crash'
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
repositories {
mavenCentral()
}
defaultConfig {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
applicationId "My_APP_ID"
minSdkVersion 17
targetSdkVersion 23
versionCode 8
versionName "2.4"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
testCompile 'org.json:json:20140107'
androidTestCompile 'com.android.support:support-annotations:24.0.0'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test.uiautomator:uiautomator- 18:2.1.2'
apt 'com.jakewharton:butterknife-compiler:8.2.1'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'me.relex:circleindicator:1.1.5#aar'
compile 'com.android.support:support-v4:24.0.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup:otto:1.3.8'
compile 'com.jakewharton:butterknife:8.2.1'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.github.satyan:sugar:1.4'
compile 'com.daimajia.swipelayout:library:1.2.0#aar'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
compile 'com.google.firebase:firebase-crash:10.2.0'
compile 'com.pixplicity.easyprefs:library:1.8.1#aar'
compile 'com.google.android.gms:play-services-tagmanager:10.2.0'
}
apply plugin: 'com.google.gms.google-services'
google-services.json content is:
{
"project_info": {
"project_number": "216634835644",
"firebase_url": "https://my_firebase_url.firebaseio.com",
"project_id": "project_id",
"storage_bucket": "project_id.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:216634835644:android:ac839bfe454896ad",
"android_client_info": {
"package_name": "my package name"
}
},
"oauth_client": [
{
"client_id": "my_client_id",
"client_type": 3
}
],
"api_key": [
{
"current_key": "My_api_key"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}

TransformException: java.util.zip.ZipException: duplicate entry: io/realm/annotations/Ignore.class

This is my build.gradle like this:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'realm-android'
buildscript {
ext.kotlin_version = '1.0.0'
ext.anko_version = '0.8.2'
ext.okhttp_version = '2.4.0'
ext.butterknife_version = '7.0.1'
ext.realm_version = '0.88.0-SNAPSHOT'
repositories {
jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap/' }
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
classpath "io.realm:realm-gradle-plugin:$realm_version"
}
}
repositories {
jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap/' }
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
}
kapt {
generateStubs = true
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "cn.com.xxxx.xxxxx"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
incremental false
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
sourceSets {
main.java.srcDirs += 'src/main/java'
}
}
//configurations { all*.exclude group: 'com.android.support', module: 'support-v4' }
dependencies {
compile 'com.android.support:multidex:1.0.1'
androidTestCompile 'com.android.support:multidex-instrumentation:1.0.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
// testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'de.hdodenhof:circleimageview:1.2.2'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.anko:anko-sdk15:$anko_version"
compile "org.jetbrains.anko:anko-support-v4:$anko_version"
compile "org.jetbrains.anko:anko-appcompat-v7:$anko_version"
compile "org.jetbrains.anko:anko-design:$anko_version"
compile "org.jetbrains.anko:anko-recyclerview-v7:$anko_version"
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'de.greenrobot:eventbus:2.4.0'
compile "com.squareup.okhttp:okhttp:$okhttp_version"
compile "com.squareup.okhttp:okhttp-urlconnection:$okhttp_version"
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.code.ksoap2-android:ksoap2-android:3.5.0'
compile("io.realm:realm-android:$realm_version"){
exclude group: 'com.android.support', module: 'multidex'
}
compile "org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}"
compile 'com.github.KeepSafe:ReLinker:1.1'
compile 'com.github.jjobes:slideDateTimePicker:1.0.2'
kapt "io.realm:realm-android:$realm_version"
}
but When I run my project following error occure :
Error:Gradle: Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: io/realm/annotations/Ignore.class
I tried this solution and some of questions in StackOverflow like this, but cannot solve it.
With 0.88 you no longer have to configure Realm yourself to work with Kotlin. That is all done inside the plugin. So you should remove kapt "io.realm:realm-android:$realm_version
We have a working example with Kotlin here:
https://github.com/realm/realm-java/blob/master/examples/kotlinExample/build.gradle
https://github.com/realm/realm-java/blob/master/examples/build.gradle

Resources