sleep-timer
sleep-timer copied to clipboard
Build errors on Android Studio 4.1
I'm learning kotlin and trying to find a few examples. I'm having problems building your app and making an APK. This is what I'm getting.
Executing tasks: [clean, :app:assembleDebug] in project D:\Users\mts\AndroidStudioProjects\sleep-timer
> Task :clean UP-TO-DATE
> Task :app:clean UP-TO-DATE
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:generateDebugBuildConfig
> Task :app:checkDebugAarMetadata
> Task :app:checkDebugAarMetadata FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jre7:1.3.72.
Required by:
project :app
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jre7:1.3.72.
> Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.3.72/kotlin-stdlib-jre7-1.3.72.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.3.72/kotlin-stdlib-jre7-1.3.72.pom'.
> Read timed out
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 34s
4 actionable tasks: 2 executed, 2 up-to-date
Same with the other URL. Can you assist me on how to get round this problem? I can see me running into this some time in the future.
.... fiddling with Android Studio to resolve the errors. I'm expending too much time troubleshooting while I'm learning. :-(
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find org.jetbrains.kotlin:kotlin-stdlib-jre7:1.4.31.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.4.31/kotlin-stdlib-jre7-1.4.31.pom
- https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.4.31/kotlin-stdlib-jre7-1.4.31.pom
Required by:
project :app
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Managed to resolve the build errors mentioned above. Remember, I'm a newbie to Android Programming. By chance spotted that for later builds jre is not used anymore, and this has been changed to jdk. Got past that issue.
Now I'm stuck on this.
I'm trying to build the app for API 29. What I'm practicing is upgrading code from a lower API to a more recent API. I know doing this will limit the audience for an app. This is what I'm not getting.