Flutter : Project Files Missing From IDE - android-studio

I'm having this issue across all my Flutter projects, thinking it was something wrong I did I opened the Flutter Gallery project but it turns out this problem is present on that project as well. I can't figure out what's wrong because the files for all the projects are there on my File Explorer yet do not display on my IDE. How do I go about correcting this because I do not have an idea at the moment. I've attached images for some visuals
On another post I saw that you need to change this
<?xml version="1.0" encoding="UTF-8"?>
To this
<?xml version="1.0" encoding="UTF-16"?>
But then this happens
And this
Something to note is that changing the UTF from 8 to 16 is inconsistent across projects. For my one project it worked but for this particular one it didn't because not only is it displaying the wrong class in my main.dart it also only shows half of that entire class. The HomePage is unreadable. Some very weird behavior. Because of these inconsistencies I found that this 'solution' isn't the best hence I'm looking for an alternative.

Related

Exception when trying to use icons from Asset Catalog in iOS project with Xamarin TabbedPage

I create a Xamarin Forms project in VS 2017 and started by adding a TabbedPage with three tabs. I then added the icons to the Android (in Resources/drawable) and iOS (Asset Catalogs/Icons) projects.
When I start the project on Android it works fine, but on iOS I get an exception that the UIImage cannot be loaded because initWithCOntentsOfFile returned nil. Which is actually correct, because that's not the correct method to use to access Assets. But it's the TabbedPage calling the method, so I cannot do anything about it.
The TabbetPage looks pretty basic.
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:GreenThumb"
x:Class="GreenThumb.MainPage">
<NavigationPage Title="Today" Icon="current.png">
<x:Arguments>
<local:Current />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Overview" Icon="overview.png">
<x:Arguments>
<local:Overview />
</x:Arguments>
</NavigationPage>
<NavigationPage Title="Settings" Icon="settings.png">
<x:Arguments>
<local:Settings />
</x:Arguments>
</NavigationPage>
</TabbedPage>
And the Asset Catalog looks like this:
This problem seems to be pretty old, but I haven't found any solutions aside some very dirty hacks.
Is there a clean solution out there? Or do I just have to add all my images in the Resources folder instead of Asset Catalogs?
I struggled in the past on this issue. It seems that icons for tabbed pages are not working in iOS if placed in the .xcassets.
I moved those .png files inside the Resources folder and that made the magic.
I suppose it's a kind of bug on Xamarin.
The same error was occurring to me, and I was putting the images on the .xcassets on iOS.
When I placed the images on the Resources folder, they appeared normally on my TabbedPage.
In the official Xamarin documentation about images, they say to put the images in the Resources folder.
iOS - Place images in the Resources folder with Build Action:
BundleResource. Retina versions of the image should also be supplied -
two and three times the resolution with a #2x or #3x suffixes on the
filename before the file extension (eg. myimage#2x.png).
I place all my images in the .xcassets folder, they apparently work well, but it seems not to work on every case.

Why does my Sharepoint WebPart deploy (nominally), but is still not available for adding to a page/form?

I've created and "deployed" my latest Web Part (Visual Studio grins from ear-to-ear, and tells me, "Deploy succeeded").
But when I go to our Sharepoint site, and my "sandbox" page, and Edit it, I do not see the WebPart. As the Elements file shows, it should be available from the "Financial Affairs Forms" category:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="PostTravelExpenseWebPart" List="113" Url="_catalogs/wp">
<File Path="PostTravelExpenseWebPart\PostTravelExpenseWebPart.webpart" Url="PostTravelExpenseWebPart.webpart" Type="GhostableInLibrary" >
<Property Name="Group" Value="Financial Affairs Forms" />
</File>
</Module>
</Elements>
However, that category is devoid of the "PostTravelExpenseWebPart" I expect (or at least hope) to see there:
What might I be omitting?
UPDATE
I even went so far as to, while in Edit mode on the Web Page, expand the "Upload a Web Part" section below "Categories" after selecting one of the "Add a Web Part" links. I didn't know exactly what to upload (when browsing for a file, the File Dialog doesn't clue you in on what file extension it expects), so I, on a flayer, tried uploading PostTravelExpense.ascx
It accepted it without balking, but I do not see it anywhere (nor do I know why just the *.ascx file would be enough, but again, which file does it expect?) It doesn't allow me to upload the entire project folder.
UPDATE 2
In response to the comment below, note that The project's Assembly Deployment Target" property is set to GlobalAssembyCache
By comparing a working project with this one, I was finally able to get it to deploy without the "A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe." add-time error msg.
What I had to do was check every place in the working project where the primary namespace was referenced, and make sure that the corresponding namespace in the previously-unworking project was referenced in those same places
This required not only changing some of the files visible in Visual Studio's Solution Explorer treeview, but also two that I only was able to load into the editor by searching for strings they contained, specifically:
The ***.spdata** file, which I loaded up by searching for "SafeControl"
**Assembly.Info**, which I loaded up by searching for "AssemblyTitle"
That sure was a lot of hand-wringing and head-banging and pitiful whin[g]ing for something that one would think would automatically be taken care of by the IDE - when a namespace changes, make all the necessary changes, or at least notify the coder and offer to do so! Or, barring that, at the very least give him a better clue than "A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe." when the WebPart to be plopped onto the page proves unploppable.

When did <?xml> layout tag become unnecessary?

I see that Android Studio creates all XML layout files without the starting
<?xml version="1.0" encoding="utf-8"?>
When did this become unnecessary? I remember that previously it would have generated compile-time error.
If it did not become unnecessary, but the compiler simply ignores it, is it a good practice not to use it?

Change Touch Menu Items in Compass Sample

Just getting the Google Glass GDK (19) running with Eclipse Java and its all up and running fine. ADB etc all good.
And now experimenting with the Compass Sample code. One thing I would like to try and pin down is basically customising whats there - a simple thing being the Touch Menu text which is "Show A Compass".
Can that be changed? That's all I want to do! However, strings.xml alters app_name only and the XML Trigger def of SHOW_A_COMPASS seems locked down somewhere. I guess that's what I am trying to discover.
Any pointers appreciated.
Thanks
Doug
You specify the trigger command in an XML file in your resources. In compass this is res/xml/compass_show.xml. In there, you will see a <trigger> tag, which you should change to one of the constants in VoiceTriggers.Command. So if you wanted to use the voice command "Find a product" you could use something like
<?xml version="1.0" encoding="utf-8"?>
<trigger command="FIND_A_PRODUCT" />
You can use your own voice commands... but only for testing purposes. Glassware that is reviewed and distributed through MyGlass must use a defined command. (You can, however, request a voice command be included in a future Glass update. If you plan to do this, you should request it as early as possible.)
See https://developers.google.com/glass/develop/gdk/voice for the full details.

HELP ME my dataset xsd content HAS GONE

I'm working in an erp project using Visual Studio 2008 Sp1, I've a typed dataset it was containg alot of datatable and alot of table adapter the .Designer.cs file was 8 MB, suddenly when i was trying to openit using visual studio designer the following code comes to me
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="erpDataSet" targetNamespace="http://tempuri.org/erpDataSet1.xsd" xmlns:mstns="http://tempuri.org/erpDataSet1.xsd" xmlns="http://tempuri.org/erpDataSet1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:annotation>
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<Connections>
<Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="erpConnectionString" IsAppSettingsProperty="true" Modifier="Assembly" Name="erpConnectionString (Settings)" ParameterPrefix="#" PropertyReference="ApplicationSettings.Sbic.Pro
My XSD file content has gone, :( :( :(
I don't understand why, and how can i recover it.
i mad something but i don't know if it is the reason for that or not, My connectionstring was in the settings "app.config" i removed it and add it to the resources of another project that is refernced by the main project.
what can i do, pleaze help me.
If I understand your problem, you were adding code to the ".Designer.cs". That file is an auto-generated file. Every time you re-save the XSD file, the designer.cs file will be regenerated. You should never add content to a designer.cs file. If you need to add functionality to the dataset, you can extend the dataset by making a "partial" class in a different file using the same namespace that you find in the generated file.

Resources