C
C#ā€¢12mo ago
Red Legion

i am stuck

i have these two errors and i need help cause i am heavily stuck same error for both errors
No description
No description
No description
84 Replies
mohamedhammudeh
mohamedhammudehā€¢12mo ago
Is this Windows forms?
Red Legion
Red LegionOPā€¢12mo ago
no it is not it is an android program idk if that will make it harder for help
mohamedhammudeh
mohamedhammudehā€¢12mo ago
Okey im really sorry, I thought it was forms because Iā€™m studying at a university and having a little problem with it thought maybe you could help me But if your not using it then I apologize
Red Legion
Red LegionOPā€¢12mo ago
naw its fine im just starting to learn like c# and shit
Keswiik
Keswiikā€¢12mo ago
If you are having problems then make your own help thread, don't try to hijack someone else's.
Angius
Angiusā€¢12mo ago
"Android program"... meaning Xamarin? Maui? UNO? Avalonia?
mohamedhammudeh
mohamedhammudehā€¢12mo ago
Im not hijacking I was asking a question, you know when u are new in thing like I am in this group and on discord you need to make mistakes to learn
Red Legion
Red LegionOPā€¢12mo ago
idk how would i check
Angius
Angiusā€¢12mo ago
Uh, well, when you were creating the project you probably picked one of the options, so
Keswiik
Keswiikā€¢12mo ago
Looks like Xamarin to me, but I'm not entirely sure.
Angius
Angiusā€¢12mo ago
Safe to assume not Uno or Avalonia So either Xamarin or Maui I guess check the namespaces and installed packages in the csproj? If there's no mentions of Maui, then it'd be Xamarin ig
Red Legion
Red LegionOPā€¢12mo ago
its cs but idk what yall talking about im new to this
Angius
Angiusā€¢12mo ago
Yes, I can see it's C# What we're trying to figure out is what Android UI framework are you using There is a few
Keswiik
Keswiikā€¢12mo ago
Xamarin, MAUI, and the others listed are mobile frameworks for c#. @DarkAngel Are you following a tutorial or something? Coursework? Kinda curious how you got to this point with no idea of what framework you're using. Also, try looking through your project references or nuget files to see if any of those libraries above show up.
Keswiik
Keswiikā€¢12mo ago
Assuming this is Xamarin, you might want to take a look at this: https://github.com/xamarin/xamarin-android/issues/2850#issuecomment-475003004
GitHub
'Resource' does not exist in the current context throughout the pro...
I am getting above error across the project where ever I am using word Resource to get the Ids of controls. 1>------ Rebuild All started: Project: SISAPP.PCL, Configuration: Debug Any CPU ------...
Keswiik
Keswiikā€¢12mo ago
Sounds similar to the problem you're having
Red Legion
Red LegionOPā€¢12mo ago
ill look at that and also no im not following a tutorial i had an idea for a cool app that would just overlay the lyrics to the spotify long your listening to and i was working at it to trey and figurout how to get the spotify api and al this shit working but i couldnt so i had to resort to getting the code generated by this cool website that is really helpful and i got this but i was having trouble with these errors
Keswiik
Keswiikā€¢12mo ago
You're gonna have a rough time if you're relying on content generated from a website without knowing how anything actually works. I'd really recommend spending some time learning the framework you're working with.
Red Legion
Red LegionOPā€¢12mo ago
well i fixed the error buti have a new error it is with layout and id
Angius
Angiusā€¢12mo ago
And that error is...? Don't keep us in suspense
Red Legion
Red LegionOPā€¢12mo ago
one sec
Red Legion
Red LegionOPā€¢12mo ago
No description
Red Legion
Red LegionOPā€¢12mo ago
No description
Auger
Augerā€¢12mo ago
Looks like Xamarin to me
Red Legion
Red LegionOPā€¢12mo ago
yeah but can soemone help like i am so confused
Auger
Augerā€¢12mo ago
If you comment out your erroring code, does your project build?
Red Legion
Red LegionOPā€¢12mo ago
like the whole line or just the part that is highlited by the red?
Auger
Augerā€¢12mo ago
It'd have to be the lines that have any red errors šŸ™‚
Red Legion
Red LegionOPā€¢12mo ago
No description
Red Legion
Red LegionOPā€¢12mo ago
just makes another error
Auger
Augerā€¢12mo ago
same for that next line
Red Legion
Red LegionOPā€¢12mo ago
and the linme at the top of the squiggly brackets ?
Auger
Augerā€¢12mo ago
Green lines are fine The red ones are errors thought and prevent building the project
Red Legion
Red LegionOPā€¢12mo ago
okay
Auger
Augerā€¢12mo ago
Resources is a static class is that is auto-generated when your code builds successfully. If you can't find it, I'm suggesting temporarily commenting our lines with errors so that when you build, the Resources class is created. Then we can try uncommenting the lines and see if you can find Resources then
Red Legion
Red LegionOPā€¢12mo ago
i know how to fix the first error butidk about the second one
Auger
Augerā€¢12mo ago
Which error?
Red Legion
Red LegionOPā€¢12mo ago
No description
Red Legion
Red LegionOPā€¢12mo ago
image wouldnt paste nvm idk where the icon folder/file is i may have to create it but idk
Auger
Augerā€¢12mo ago
So typically the icon is located in a few folders called Resources/mipmap-...dpi
Red Legion
Red LegionOPā€¢12mo ago
it is Xamarin
No description
Auger
Augerā€¢12mo ago
Yeah, I figured it was
Red Legion
Red LegionOPā€¢12mo ago
\there are alot of those
No description
Auger
Augerā€¢12mo ago
Yup Do you have your icon file in those?
Red Legion
Red LegionOPā€¢12mo ago
idk all of them execpt for the first one have png files
Auger
Augerā€¢12mo ago
What's the icon's file name?
Red Legion
Red LegionOPā€¢12mo ago
idk
No description
Auger
Augerā€¢12mo ago
Hmm, that looks correct Can you try doing a clean and rebuilding the project
Red Legion
Red LegionOPā€¢12mo ago
okay
Auger
Augerā€¢12mo ago
Can you show me your AndroidManifest.xml if that doesn't work
Red Legion
Red LegionOPā€¢12mo ago
what do you mean by clean?
Auger
Augerā€¢12mo ago
Top left, Click "Build" then select Clean Solution, then Rebuild Solution
No description
Red Legion
Red LegionOPā€¢12mo ago
oklay ill tell you what happened happens* same thing
Red Legion
Red LegionOPā€¢12mo ago
No description
No description
Red Legion
Red LegionOPā€¢12mo ago
xml file
Auger
Augerā€¢12mo ago
that looks pretty default, so I assume you haven't changed anything in there
Red Legion
Red LegionOPā€¢12mo ago
no i havnmt i have only like just started this solution
Auger
Augerā€¢12mo ago
Did you change the app's icon any either or is that default too?
Red Legion
Red LegionOPā€¢12mo ago
default aswell
Auger
Augerā€¢12mo ago
Alright If that clean and rebuild doesn't work, I think it would be a good idea to try doing a deeper clean by deleting the bin/ and obj/ folders. They are typically generated when you build the app. Sometimes that can contain outdated stuff that can cause a build to fail.
Red Legion
Red LegionOPā€¢12mo ago
adn where are those files/folders at? nvkm
Auger
Augerā€¢12mo ago
Same folder your csproj file is at
Red Legion
Red LegionOPā€¢12mo ago
Same problems
Auger
Augerā€¢12mo ago
What are all the errors currently?
Red Legion
Red LegionOPā€¢12mo ago
The same tei Two As before
Auger
Augerā€¢12mo ago
Only two? No syntax errors anywhere else?
Red Legion
Red LegionOPā€¢12mo ago
Nope Just those two
Auger
Augerā€¢12mo ago
can you show me your csproj file? You'll have to Right-Click and click "Edit Project File" to see the actual text
Red Legion
Red LegionOPā€¢12mo ago
No description
Auger
Augerā€¢12mo ago
Can you show the AndroidManifest.xml, but as text?
Red Legion
Red LegionOPā€¢12mo ago
How?
Auger
Augerā€¢12mo ago
Usually you can right-click and do Open With, and pick XML editor Or just open it in notepad or something
Red Legion
Red LegionOPā€¢12mo ago
Nvm
Auger
Augerā€¢12mo ago
Also WIN+Shift+S takes a screenshot in Windows
Red Legion
Red LegionOPā€¢12mo ago
No description
Red Legion
Red LegionOPā€¢12mo ago
Yeah
Auger
Augerā€¢12mo ago
I can't read that šŸ˜„
Red Legion
Red LegionOPā€¢12mo ago
But ny pc internet turns off at a certain time cause im got school tommorrow so i cant use disocrd on my pc
Red Legion
Red LegionOPā€¢12mo ago
There
No description
Auger
Augerā€¢12mo ago
Hm, that looks correct too So what that defines is the mipmap folder and appicon(.png) for the android app we were looking for earlier
Red Legion
Red LegionOPā€¢12mo ago
Yeah
Auger
Augerā€¢12mo ago
Honestly man, I've run into this before and I can't recall what I did to fix it I'd recommend creating a new project, make sure it builds, then copy over the code you were working on and make sure it still builds Also, if you want a "save point" for your code, so you like a version you know used to work, look into how to use GIT, which is essentially save points for code. Even lets you compare what changes you made since the last "save point" (commit) then
Red Legion
Red LegionOPā€¢12mo ago
Yeah im probably going to give up on this but i jave a nother project i wanna work on that i may nees help on but i may not cause it dose t need like all thos typa shit oike apis and all that so i think ill be fine but idk
Auger
Augerā€¢12mo ago
Keep it up! Sometimes mobile app projects can be weird. Albeit that is a rather ambitious project šŸ˜„ You'll definitely learn a lot by trying to implement it, no matter how far you get @ZZZZZZZZZZZZZZZZZZZZZZZZZ, idk if you had any suggestions. I don't remember how to fix that icon build issue

Did you find this page helpful?