2

I'm using FirebaseUI Database to retrieve a list of Objects from Firebase Database Reference in ListView (on ListFragment) using FirebaseListAdapter. I put a dependency for firebase-ui-database in build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "vkalashnykov.org.busapplication"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.android.support:support-v4:25.4.0'
    implementation 'com.android.support:recyclerview-v7:25.4.0'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.4.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:25.4.0'
    compile 'com.google.firebase:firebase-auth:11.6.2'
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.gms:play-services-maps:11.6.2'
    compile 'com.google.android.gms:play-services-places:11.6.2'
    compile 'com.google.android.gms:play-services:11.6.2'
    compile 'com.google.android.gms:play-services-location:11.6.2'
    implementation 'com.firebaseui:firebase-ui-database:4.1.0'
}

apply plugin: 'com.google.gms.google-services'

After that I needed to change my minSdkVersion (I used 15) to 16, because FirebaseUI requires it. After that I started to receive errors when build Gradle:

../../.gradle/caches/transforms-1/files-1.1/appcompat-v7-25.4.0.aa/3b2c926192deabbc1b0a0696bfdc1100/res/values/values.xml error: resource android:attr/fontStyle not found.
error: resource android:attr/font not found.
error: resource android:attr/fontWeight not found.

What is the matter and what can I do? Thanks in advance, Viktor

CEO tech4lifeapps
  • 885
  • 1
  • 12
  • 31

2 Answers2

0

Font support was added in oreo version, also it is available in support library, just use a support library greater or equals to 26 version. Also check this answer https://stackoverflow.com/a/45208134/6193843

Link182
  • 733
  • 6
  • 15
0

To solve this, please change the following line of code:

compile 'com.google.firebase:firebase-auth:11.6.2'

to

implementation 'com.google.firebase:firebase-auth:16.0.3'

And add the following line of code:

implementation 'com.google.firebase:firebase-core:16.0.1'

Which is now mandatory. From the official documentation:

Your app gradle file now has to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.

Regarding Google Play Services, please change the following lines of code:

compile 'com.google.android.gms:play-services-maps:11.6.2'
compile 'com.google.android.gms:play-services-places:11.6.2'
compile 'com.google.android.gms:play-services-location:11.6.2'

to

compile 'com.google.android.gms:play-services-maps:15.0.1'
compile 'com.google.android.gms:play-services-places:15.0.1'
compile 'com.google.android.gms:play-services-location:15.0.1'

And according to this, please remove this line of code:

    compile 'com.google.android.gms:play-services:11.6.2'

Don't also forget to add in your top level build.gradle file the following Google Service plugin:

classpath 'com.google.gms:google-services:4.0.2'
Alex Mamo
  • 130,605
  • 17
  • 163
  • 193