Can someone help me with this please I keep gettin...
# announcements
s
Can someone help me with this please I keep getting failed to compiled values files every time I run the app. I have invalidated the cache and restarted the project but still getting the same error. I also added this dependency nothing worked implementation ‘androidx.corecore ktx1.3.2’
v
please refrain from cross-posting. you just waste peoples time that need to read your message twice and split discussions
s
I wont do that again
c
Is your code on github @SanbosayDev?
s
c
Are you still having the issue?
s
Yes :-( @Colton Idle
c
Ok. I will check it in a bit
s
Thanks a lot :-)
@Colton Idle don’t forget about me :-)
c
I didn't! Just got busy. Probably need another 30 minutes.
Got it working! 1. I'm using AS 4.2 beta 1 (you may not need this) but because of this I had to
Copy code
-        classpath 'com.android.tools.build:gradle:4.2.0-alpha16'
+        classpath 'com.android.tools.build:gradle:4.2.0-beta01'
2. The main issue is that you're referencing colors that don't exist in your colors.xml. Look at themes.xml (both regular and dark) and look at activity_main.xml. You should see red in those files because of missing color declarations in your colors.xml. To quick fix it, just add this to the bottom of your colors.xml
Copy code
<color name="purple_500">#ff0000/</color>
    <color name="purple_200">#ff0000/</color>
    <color name="purple_700">#ff0000/</color>
    <color name="teal_200">#ff0000/</color>
    <color name="teal_700">#ff0000/</color>
    <color name="gray">#ff0000/</color>
s
@Colton Idle thanks a lot, really appreciate it the errors in the theme and color xml clear up
But
I’m still getting this little error
Failed to compile values file
c
What if you just go to themes.xml (both regular and dark) and activity_main.xml and delete the lines that have colors missing
Delete this
android:background="@color/gray"
and this
Copy code
-        <item name="colorPrimary">@color/purple_200</item>
-        <item name="colorPrimaryVariant">@color/purple_700</item>
-        <item name="colorOnPrimary">@color/black</item>
-        <!-- Secondary brand color. -->
-        <item name="colorSecondary">@color/teal_200</item>
-        <item name="colorSecondaryVariant">@color/teal_200</item>
-        <item name="colorOnSecondary">@color/black</item>
s
@Colton Idle thanks a lot and a lot; really appreciate it dude, that error about resource file no linking went away but another one shows up about [Dagger/MissingBinding] but I will try to figure this out on my own l; unless you want to show some more of your generosity which will be greatly appreciated X10 - enthusiastically Jamil
And then this file automatically opens up
@Colton Idle
c
@SanbosayDev did you push all of your new code to github?
@SanbosayDev just as a note. I actually dont know why those colors were acting all funky. It seems like you maybe did some copy pasting there, but the internals of gradle or aapt didn't like them. first ive seen that lol and ive been doing dev for a long time.
s
@Colton Idle yea are right haha
Let me push to github right now
How long have you been doing dev @Colton Idle
c
android for about 5 years.
I will have to take a look later tonight 👍
s
@Colton Idle sounds good
c
Did you write this code? None of these errors you're getting make any sense.
There's just like more and more errors when I fix one error. Has this project ever worked?
Anyway, if you want to figure out whats going on, just comment out the annotation in your application class, and you'll see different parts of your code failing.
s
I was going following some dude vid on udemy lol
Turns out he doesnt know what hes doing
c
Interesting. Yeah. There's something here just really off. Like this project looks like a mashup of like 10 other projects. Btw I was able to get around the hilt issue by removing the MyApplication field being injected into your ViewModel, and then I changed your ViewModel from extending AndroidViewModel to just a plain old ViewModel. I had to comment out a block of code for checking network detection, but then it at least compiled with hilt. Mind you, theres a chance that the person on udemy does know what they're doing, but something maybe got lost in translation. Good luck. If you're just starting tho... everything you have now is like crazy complex. I don't even work in production apps that have all of that stuff yet. Don't feel bad about just starting with a super simple app and adding things as you need them. not just because someone told you to do it.
s
Thanks a lot man!
I abandoned that project thou starting a new
You will be my mentor on Slack haha
Do you know about Udacity?
c
I can definitely point you in some direction, but can't make any promises 😄 Udacity typically has good content as well.
It's very easy to encounter tutorials on all of those platforms that is out of date though, but the fundamentals stay the same.
s
I am study Android Kotlin Dev with Udacity under a Scholarship
Their content is not well taught in my opinion thats why I go on Udemy
c
My advice. Skip tutorials and stuff. File > New project, and build an idea of yours. It can be simple. It can be a todo app, or something else you care about, but make the app for you. After the app grows to 5 files in size, you'll start seeing what things dont work and you'll refactor inevitably. Then you'll go to 10, 20 files, and refactory. And then 100 files and then you'll say "hey it would be nice to know dagger so that this is easier". You have to grow somewhat.
Teaching this stuff is really hard. Its hard to keep someones attention without having extremely trivial or convoluded examples.
That's why I'll always say to just build your own project. As you need a new tool in your toolbox, that's when you learn it.
s
You are right
Are in San Francisco ?
you**
c
nope
s
Why do think I may getting that error when try to run a simple hello world
@Colton Idle
c
could be a billion different things
try running in the terminal in android studio
./gradlew assemble
s
lol
c
And see if that gives you a more specific error
s
I think its in the gradle
I fixed it 😁
🦜 1