Xarzu Thompson wrote:This example code was taken straight from github. I am confident that this code is supposed to build but I suspect something in the compiler of Android Studio has changed, updated, or with a newer version of the Android operating system something needs to be updated in the source code of an app. This is because a build and/or gradle sync has this error immediately. Nothing major has changed in the code. I suspect this might be a common thing and I suspect someone must know something about this and how to fix it. Please advise.
My best advise is to study thoroughly how gradle works. Gradle is a dependency management tool based on a succession of `tasks`
to solve your issue i suggest you before to read this
link
I am telling you that for 2 reasons really important if you want to have a career in Android
1) recently changed the way to use gradle in Android
2) when you will update to gradle 7.3 is really likely that you will find other issues, so is necessary to have a grasp of how gradle works, and how to debug issues
3) Gradle needs to receive instructions in Groovy/Kotlin so is really important to invest time and follow tutorials, it will be a great investment
Please be aware that your Android studio version the gradle plugin and the gradle version need to follow a specific order, the link i sent you explains a lot,
I really suggest you to not get frustrated if you lose some hours and cannot run the project, is something we android dev need to face on daily basis, and when we work gradle problems are never counted in the sprints in an agile framework, because cannot be foreseen, so learning it is worthy. Android Studio gives you a lot of help, read with attention what the stacktrace says because they try to simplify a lot what is happening under the hood.