Retrofit: Difference between revisions
Jump to navigation
Jump to search
Line 16: | Line 16: | ||
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 | export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==Gradle 3.3 to 4. | ==Gradle 3.3 to 4.10== | ||
To achieve this I change the build.gradle to update the plugin and specify the maven and google repositories. | To achieve this I change the build.gradle to update the plugin and specify the maven and google repositories. | ||
<syntaxhighlight lang="groovy"> | <syntaxhighlight lang="groovy"> | ||
Line 43: | Line 43: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip | ||
</syntaxhighlight> | |||
From there I could use the standard update to 4.10 | |||
<syntaxhighlight lang="bash"> | |||
./gradlew wrapper --gradle-version 4.10 | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 03:20, 24 January 2021
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.10
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 and also updated the gradle.warapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
From there I could use the standard update to 4.10
./gradlew wrapper --gradle-version 4.10