Android Android Lists and Adapters Adapters and ViewHolders Activity

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 81,659 Points

ActivityHourlyForecastBinding not working in Android 3.1.2

I know I'm not the only one to have found some issues with this.

I've just spend the last few hours in Android Studio 3.1.2 trying to get this import statement to work.

import uk.co.jonniegrieve.stormy.databinding.ActivityHourlyForecastBinding;

I use the package uk.co.jonniegrieve.stormy for this project.

I had tried the fixes suggested in this video but they don't seem to have any effect on the Java Class file.

Then, just as suddenly the code just seemed to work without showing up any errors in Android studio and I followed the video right up to compilation of the app. But this was clearly some sort of cruel trick by AS because when I ran the app, this error came up in the console.

error: duplicate attribute

Also at this point the R class isn't showing up correctly on the imports. I've given this my best shot but I'm out of ideas. HELP :)

https://github.com/jg-digital-media/stormy_list

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 81,659 Points

If I don#t hear soon I'll probably delete and restore the Repo to a working state and try again. I just wish I knew what I've done wrong so I can try and fix it.

2 Answers

I'm also having the same issue, have you fixed it?

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 81,659 Points

Just to confirm I've deleted the repo for this project and started the project again from scratch. and to avoid confusion will be removing this thread shortly.

I've not yet been able to find a fix for this issue.

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 81,659 Points

Hi Ken Alger

Are you able to suggest a solution to this if you have the time?

I've restarted my version of the project, this time starting from the project files in Video 1 of section 2 so I'm using the Treehouse package this time. I'm still unable to get the ActivityHourlyForecastBinding import whether by quick fix or typing the import directly in.

The error is cannot resolve symbol: 'ActivityHourlyForecastBinding

Here's my latest repo. https://github.com/jg-digital-media/stormy_list_tth

Anyone else managed to solve this?