Retrofit: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 6: | Line 6: | ||
https://github.com/alex-wolf-ps/AndroidGlobomanticsApp | https://github.com/alex-wolf-ps/AndroidGlobomanticsApp | ||
<br> | <br> | ||
=Old Projects= | |||
==Use Java 8== | |||
Sometimes when using older projects with gradle you might see | |||
<syntaxhighlight lang="bash"> | |||
Couldn't determine java version from '11.0.1' | |||
</syntaxhighlight> | |||
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. | |||
<syntaxhighlight lang="bash"> | |||
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 | |||
</syntaxhighlight> | |||
==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. | |||
<syntaxhighlight lang="groovey"> | |||
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() | |||
} | |||
} | |||
</syntaxhighlight> | |||
And ran gradlew '''not''' gradle |
Revision as of 03:13, 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.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