Message Could not add Telerik.UI.for.Maui

1 Answer 1028 Views
General Discussions
Mario
Top achievements
Rank 1
Mario asked on 13 Nov 2022, 09:02 AM | edited on 13 Nov 2022, 09:13 AM

Hello,

Question,

While trying to add the Telerik .net for MAUI nuget package I got following error:

 GET https://api.nuget.org/v3-flatcontainer/telerik.ui.for.maui/index.json
  NotFound https://api.nuget.org/v3-flatcontainer/telerik.ui.for.maui/index.json 564ms
Resolving conflicts for .NETStandard,Version=v2.0...
Unable to find package Telerik.UI.for.Maui. No packages exist with this id in source(s): nuget.org
Package restore failed. Rolling back package changes for 'mobapp'.

 

I am running Visual Studio 2022 v17.4 for MACOS and this are my Nuget Sources:

 

Any support is welcome.

Thx,

/m

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 14 Nov 2022, 07:31 AM

Hi Mario,

From the error message, the Telerik NuGet server is searched in the wrong NuGet server. It searches the package in nuget.org but it should be in the https://nuget.telerik.com/v3/index.json  

I had the same issue and did the following: 

Remove the Telerik NuGet server. Restart the visual studio, the mac machine. Then add the Telerik NuGet server again and enter the credentials you use for the license. 

If these suggestions do not help, create a nuget.config file in the project and manually reference the NuGet packages. An example can be found here: https://github.com/telerik/maui-samples/blob/main/Samples/NuGet.Config 

I hope this will be of help.

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Mario
Top achievements
Rank 1
commented on 14 Nov 2022, 05:22 PM

Hello Didi,

I got it finally working.

Thx for your feedback.

/Mario

 

Akhilesh K
Top achievements
Rank 1
commented on 15 Mar 2023, 06:09 AM

Hi Didi,

I followed all the steps and also downloaded this repo(https://github.com/telerik/maui-samples/blob/main/Samples/NuGet.Config ) as well. Telerik.UI.for.Maui is not loading in your repo as well.

Could you please let me know asap?

Because I am facing this issue from past two days.

 

Thanks

Akhilesh

Didi
Telerik team
commented on 15 Mar 2023, 06:54 AM

Hi Akhilesh, 

I have shared the steps needed to restore the Telerik NuGet package. The steps are working and I can confirm this. This behavior is not related to the Telerik NuGet server, it is an issue in Visual Studio for Mac - the NuGet packages cannot be restored from the correct NuGet server.

Try the steps described above, make sure the Telerik NuGet server is added in the Visual Studio for Mac. 

Then add a nuget.config file inside the folder where the project is located. Make sure the following: The Telerik NuGet name in the config file is the same as in the Visual Studio. 
Here is an extended version of the nuget.config file you can try: 

<?xml version="1.0" encoding="utf-8"?>
<!-- Helpful docs https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file -->
<configuration>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <packageManagement>
    <add key="format" value="0" />
    <add key="disabled" value="False" />
  </packageManagement>
  <!-- Learn how to set a package source https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file#packagesources -->
  <packageSources>
    <clear/>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="Telerik" value="https://nuget.telerik.com/v3/index.json"  protocolVersion="3"/>
  </packageSources>
 
  <!-- Learn how package source mapping works https://docs.microsoft.com/en-us/nuget/consume-packages/package-source-mapping?Wt.mc_id=DX_MVP5000553 -->
  <packageSourceMapping>
    <packageSource key="nuget.org">
      <package pattern="*" />
    </packageSource>
    <packageSource key="Telerik">
      <package pattern="JustMock*" />
      <package pattern="Telerik*" />
      <package pattern="Kendo*" />
    </packageSource>
  </packageSourceMapping>
</configuration>

Delete bin and obj folders from the app. Open the solution, clean and rebuild it, then restore NuGet packages. 

Let me know the result. 

Tags
General Discussions
Asked by
Mario
Top achievements
Rank 1
Answers by
Didi
Telerik team
Share this question
or