I am following the book Practical Android by Mark Wickham. I am trying to open the source code from the Connections app here, but am running into many problems as it's an older project(2018).
Problems
- Stuck on the loading screen devices; cannot run project
What I've tried
- Invalidating cache/restarting from this link Android Studio device list stuck on loading
- https://medium.com/updating-old-android-studio-projects-to-work-in/updating-old-android-studio-projects-to-work-in-android-studio-3-0-195eec3a9b33 Following this link, but I cannot find any gradle-wrapper in my project.
In this app specifically, my screen looks like this:
If you look at the very top, I am unable to choose any device. Please note this does not happen with any other project(tried creating blank project, problem didn't occur).
How can I run this project?
Thanks!
App build.grade:
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
defaultConfig {
applicationId "com.wickham.android.connections"
minSdkVersion 19
targetSdkVersion 30
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def project = "Connections"
def SEP = "_"
def buildType = variant.variantData.variantConfiguration.buildType.name
def version = variant.versionName
def date = new Date();
def formattedDate = date.format('ddMMyy_HHmm')
def newApkName = project + SEP + version + SEP + formattedDate + ".apk"
output.outputFile = new File(output.outputFile.parent, newApkName)
}
}
}
Project build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
I have just minorly edited the build.gradle from the connections app here: https://github.com/Apress/practical-android