0

I'm using Firebase UI and when I try to run the app, the above error is displayed.
I've tried using multiple emulator with different configurations and also different versions of Play Services in my gradle. I haven't not been able to fix this error.

This is my app/build.gradle:

apply plugin: 'com.android.application'

repositories {
    mavenLocal()
    flatDir {
        dirs 'libs'
    }
}

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.1'

    defaultConfig {
        applicationId "com.google.firebase.udacity.friendlychat"
        minSdkVersion 16
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}



dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:design:25.2.0'
    compile 'com.android.support:appcompat-v7:26.0.1'
    compile 'com.google.android.gms:play-services:11.4.0'

    // Displaying images
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.google.firebase:firebase-auth:11.4.0'
    compile 'com.google.firebase:firebase-core:11.4.0'
    compile 'com.google.firebase:firebase-database:11.4.0'
    compile 'com.firebaseui:firebase-ui-auth:2.4.0'
    compile 'com.android.support:support-annotations:25.3.1'
}
apply plugin: 'com.google.gms.google-services'

The Emulator config is Nexus 5x Api 25 X86_64

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • 2
    Possible duplicate of [Using java.net.URLConnection to fire and handle HTTP requests](http://stackoverflow.com/questions/2793150/using-java-net-urlconnection-to-fire-and-handle-http-requests) – AxelH Jan 03 '17 at 10:35
  • 1
    And you forgot to tell what is wrong here – AxelH Jan 03 '17 at 10:41
  • I want to set content type to json because the server I am trying to post only accepts json data and also do i add it as a Json object or a string? –  Jan 03 '17 at 10:45
  • Well, read the post I flag as duplicated. This will show you how to add data since you already have the ouputstream here. Then how to send the request and check the result. Everything is in the really complete post about UrlConnection – AxelH Jan 03 '17 at 10:52

0 Answers0