C
C#7mo ago
Sal

Maui issues after changing namespace

yesterday I had the briliant idea of changing the name of my app because i made it open source and previously was just a "personal" name, but anyway the issue is that visual studio now says that doesnt recognise "Maui" "Application" "MainPage" etc this part mostly started to appear when i changed the namespace on the xaml files "x:Class" but before there were issues mainly this
Error NU1105 Unable to read project information for 'Invasion1DGame': Sequence contains more than one element Invasion1DGame
Error NU1105 Unable to read project information for 'Invasion1DGame': Sequence contains more than one element Invasion1DGame
I currently reversed the project to a commit ago but the issue persists, I am not sure why because i just changed the name after committing. I tried AI to help but it repeats itself and nothing worked, i search for all instances of the previous name and and i had changed all, i cant clean and rebuild because it fails, i deleted .vs folder but i couldnt open the solution after had to open the project, but nothing made a difference. another error i got was regarding the manifest for android but i dont really know what to do in there. any help would be appreciated for reference https://github.com/Saleca/Invasion1DGame I didnt clone from the site so i hope the main branch is working fine, but that main should be the one i am currently having issues after reversing the commit, the problem with the new name is on the branch "ChangeRootNamespace" thanks either way
38 Replies
SpReeD
SpReeD7mo ago
You know, MAUI is a diva. looking at your csproj I see two problems. Resources\AppIcon\Icon.svg should be lowercase -> Resources\AppIcon\icon.svg Next up, DO NOT use the same file for the appicon and the splash, even if it's meant to be the same svg, copy it and save it accordingly to it's designated folder, AppIcon for appicon and Splash for splash icons, using the same file will likely result in an error - believe me, it cost me 2 hours of my life.
Sal
SalOP7mo ago
by the way, i tried at first to change the name of the folder where the project was and I couldnt because it was beeing used by some application, at the time i thought was vs but now i try to delete the project folder to clone it but i cant because some program is using it, although now vs is closed. i will try that, the lowercase, is it a rule?
SpReeD
SpReeD7mo ago
Yes, a rule without an error-code.
No description
Sal
SalOP7mo ago
I will have that in mind but currently i dont have the "Icon.svg" because i reversed to the main, but the issue persisted for some reason. didnt notice that, thanks were you able to run the project?
SpReeD
SpReeD7mo ago
yes
No description
Sal
SalOP7mo ago
i guess i currupted my project folder, i will try to clone again , for you you clone the branched "change name" and made the changes on the icon name and copied the file for the splash?
SpReeD
SpReeD7mo ago
Also make sure your AndroidManifest stays correct, sometimes the auto generation messes things up, check if it like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.saleca.invasion1d">
<application android:allowBackup="true" android:icon="@mipmap/icon" android:supportsRtl="true" android:label="Invasion 1D"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk />
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.saleca.invasion1d">
<application android:allowBackup="true" android:icon="@mipmap/icon" android:supportsRtl="true" android:label="Invasion 1D"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk />
</manifest>
Especiall the android:icon I wasted a lot of time finding errors like this, the error messages aren't helpful either ^^
Sal
SalOP7mo ago
thanks i will just restart to try to delete the folder because it keeps saying that is in use. i'll be right back
SpReeD
SpReeD7mo ago
To clean it, delete the .vs, and all bin & obj folders
Sal
SalOP7mo ago
I tried but i still have the same issue, i had android:icon="@mipmap/appicon" i deleted the "app" i changed the name of the svg file and copied for the splash and changed in the project file accordingly, i deleted the bin and obj folders and tried to clean but it fails and the same errors pop up as originaly, this after i deleted the project and cloned. even with the main that should not have the issue.. I think
SpReeD
SpReeD7mo ago
Well, well, I could fork it and make a pr, so you see exactly the changes made
Sal
SalOP7mo ago
this is what i have when i clean now, i also changed the name of the project, in the manifest was with a space and on the project was without
No description
Sal
SalOP7mo ago
if you dont mind, i am completely confused, i didnt mess with the targets, i dont know why would i have issues with them, yesterday i did run the restore but nothing changed
SpReeD
SpReeD7mo ago
Just for the sake of it, comment out the windows target framework, repoen the solution and give it another try.
Sal
SalOP7mo ago
less errors but still
Severity Code Description Project File Line Suppression State Error XA1018 Specified AndroidManifest file does not exist: C:\Users\salgl\Documents\Code\VS\Invasion1DGame\Invasion1D\AndroidManifest.xml. Invasion1D C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.43\tools\Xamarin.Android.Common.targets 596
SpReeD
SpReeD7mo ago
Make it look like this: https://pastebin.com/0Yqapb50
Pastebin
net8. - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Sal
SalOP7mo ago
looking at the properties other change i did was enabling R8 code shrinker ok so thats for the main i was on the other branch just now but i can go back again ive done it, and failed. . i try restarting but its very odd. once i had similar issue but opening a project from .net7 to .net8 i basically end up copying all files one by one to a new project -.-
SpReeD
SpReeD7mo ago
I forked you main and set the proj as described previously, it does build.
Sal
SalOP7mo ago
its not working... i did comment out the windows portion, i have less errors but the manifest "is missing" although i never saw the manifest at that location (main folder) thanks. i am clueless to what the issue is.
SpReeD
SpReeD7mo ago
Have you open the manifest file with the texteditor or the built-in vs editor?
SpReeD
SpReeD7mo ago
I hate to say "it does work", but it does
No description
SpReeD
SpReeD7mo ago
https://pastebin.com/mpQq5mLM Here's the manifest I built from
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Sal
SalOP7mo ago
i opened the manifest with xml in vs xD
Sal
SalOP7mo ago
No description
SpReeD
SpReeD7mo ago
That's correct
No description
Sal
SalOP7mo ago
i tried to build with windows because it should work, before did, but it still doesnt work even with your fork, what the hell did i do with my computer
Sal
SalOP7mo ago
i mean says to ensure i target and run restore, i do but it fails and loops back, but the android manifest i also dont understand it says it doesnt exist on that location but thats not the location that is suposed to be, is it? and i am building for windows right now so why complaining about android manifest
No description
SpReeD
SpReeD7mo ago
God damn, change the line 15 on the csproj to <ApplicationTitle>Invasion1DGame</ApplicationTitle>
Sal
SalOP7mo ago
btw is the android:icon still suposed to be icon rather than appicon? i tried both ways now, but the confusion arises due to the name of the icon svg file
SpReeD
SpReeD7mo ago
That's fine, as in my pastebin Sir, you have a PR
Sal
SalOP7mo ago
No description
Sal
SalOP7mo ago
for me is the same yet, i even cloned your branch to a new folder but the issues are the same. what buggs me is that my main should not have any issue as i commited with it working. this must be unrelated to the project itself, maybe i changed something while tryng to fix the change name branch and that changed something on VS or something similar i have no idea
SpReeD
SpReeD7mo ago
I'm looking into it It's a needle in a haystack
Sal
SalOP7mo ago
if this is the case maybe the project is not the way to fix this. i am considering re iinstaling VS but i have limited internet lol
Sal
SalOP7mo ago
this built!! thanks man, what you did in this last commit other thank changing the name? i see you change th names as i had on the branch changerootnamespace but you did branch of the main right? in one sweep you did what i tried and fixed the issue
Sal
SalOP7mo ago
seems to me that difference is the manifests for android tisen and the windows, but specially the android has major changes, comparing it to my failed branch (root namespace change) well again, thanks for saving my ass here
Want results from more Discord servers?
Add your server