Retrofit

From bibbleWiki
Jump to navigation Jump to search

Resource

During the course there were demo server APIs
https://github.com/alex-wolf-ps/RetrofitAPINode
https://github.com/alex-wolf-ps/RetrofitAPIDotnet
https://github.com/alex-wolf-ps/AndroidGlobomanticsApp

Old Projects

Use Java 8

Sometimes when using older projects with gradle you might see

Couldn't determine java version from '11.0.1'

This is because of an old version of gradle. The easiest way to solve it is to go to the command line and change your JAVA_HOME is 8 e.g.

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

Gradle 3.3 to 4.4

To achieve this I change the build.gradle to update the plugin and specify the maven and google repositories.

buildscript {
    repositories {
        google()
        jcenter()
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

And ran gradlew not gradle