0

I want to use onesignal with firebase-ui-database

I get this issue when I build my project

I think onesignal and firebase-ui-database not work together.

my build gradle(app):

plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.android.application'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.test.app"

        // TODO: Please update the OneSignal ID below to yours!
        manifestPlaceholders = [onesignal_app_id: "c4fc2f8a-cb3d-4779-8b97-3d605fcd1034",
                                // Project number pulled from dashboard, local value is ignored.
                                onesignal_google_project_number: 'REMOTE']

        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"

    }
    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:27.1.1'
    implementation 'com.android.support:design:27.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'

    implementation 'com.google.firebase:firebase-database:11.8.0'
    implementation 'com.google.firebase:firebase-storage:11.8.0'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'com.google.firebase:firebase-ads:11.8.0'

    implementation 'com.firebaseui:firebase-ui-database:3.2.1'

    implementation 'com.onesignal:OneSignal:[3.8.1, 3.99.99)'
}
apply plugin: 'com.google.gms.google-services'

build gradle (project)

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:4.0.1'

        // 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
}

How can I solve this problem,

how can i use these two together?

I looked at some old similar issues but I could not solve the problem.

EagleH
  • 107
  • 2
  • 8
  • Check this post https://stackoverflow.com/questions/49056723/errorprogram-type-already-present-android-arch-lifecycle-livedata. I think you have the same problem with the `OneSignal` and `firebase-ui`. – Crammeur Jul 25 '18 at 01:01
  • I've seen that post before but not work for me – EagleH Jul 25 '18 at 02:07

1 Answers1

-1

This is as a results of duplicate binary dependencies. Library A already have binary for library B. Remove library B and rebuild.