Facing issues while building AntennaPod in Android Studio

Hello, I plan to contribute to AntennaPod, and while I do have experience with Java, this would be my first stint with Android app development. I have been trying to build AntennaPod in Android Studio but have faced couple of issues:

  1. Error: Extension not initialized yet, couldn't access compileSdkVersion
    This error was coming during the build, with some browsing and similar question on SO, I updated the dependency 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:1.0.2' to 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:2.0.0' in the build.gradle file and didn’t get the error again.

  2. Error:
    Configurations for main.xml must agree on the root element's ID.
    Missing ID:
    - layout-sw720dp
    @+id/drawer_layout:
    - layout
    This error is coming after above one got resolved, it seems the two sw720dp\main.xml and layout\main.xml files have different root IDs and that is resulting in error. But what should I exactly modify to fix this issue? And are these files used to decide layout on different phones?

If anyone has faced these issues and can help me and get me up and running swiftly, I would appreciate that. I will also further use this thread for any build related or such issues which may help other contributors too.

Thanks.

You shouldn’t need to change anything. I have not seen this error before

What version of Android Studio are you using?

Make sure to not upgrade gradle and use the version that is specified.

What branch are you using?

1 Like

Android Studio 4.1.2

Gradle version on my system is 5.1.2. I see that in the build.gradle file it is mentioned 'com.android.tools.build:gradle:4.1.2'. Could this be causing an issue? Shall I downgrade the Gradle on my system?

Branch I cloned is develop.

Android Studio should automatically use a matching gradle version.

I just tried to import a new copy of the project into Android Studio 4.1.2 and it worked immediately.

  • File » New » Project from version control
  • Wait for a loong time until all progress bars go away
  • Press the Play button
1 Like

Using these steps, I was able to get it all up and running directly. Only thing I have done differently earlier was that I imported from an already cloned repository, instead of using the get project from version control option. I don’t understand how doing that would have caused those errors to occur.
Appreciate the help, I was able to get the app running in the emulator once the build and other things were done. I also managed to try out some of the changes for one of the issues I have been trying to work on.
I will keep working on them and if I do face any further issue, I will reply back here. Thanks!

3 Likes

Nice! Maybe you can update the Contribution.md as well. If not, I can send a smaller PR for that

1 Like

Would be great if you could do it :slight_smile:

1 Like