admin管理员组文章数量:1221167
I recently tried updating a .NET MAUI app that we have that was targeting android version 33 to version 34. Im now getting 4 errors:
Assets file '{Filepath}\obj\project.assets.json' doesn't have a target for 'net8.0-windows10.0.19041.0'. Ensure that restore has run and that you have included 'net8.0-windows10.0.19041.0' in the TargetFrameworks for your project.
Assets file '{Filepath}\obj\project.assets.json' doesn't have a target for 'net8.0-ios'. Ensure that restore has run and that you have included 'net8.0-ios' in the TargetFrameworks for your project.
Assets file '{Filepath}\obj\project.assets.json' doesn't have a target for 'net8.0-android34.0'. Ensure that restore has run and that you have included 'net8.0-android34.0' in the TargetFrameworks for your project.
Assets file '{Filepath}\obj\project.assets.json' doesn't have a target for 'net7.0-maccatalyst'. Ensure that restore has run and that you have included 'net7.0-maccatalyst' in the TargetFrameworks for your project.
I've tried running msbuild /target:Restore {Project Name.sln} from the developer powershell, but still no dice. I see that this seems to be a pretty common issue but I haven't had any luck with the solutions
I recently tried updating a .NET MAUI app that we have that was targeting android version 33 to version 34. Im now getting 4 errors:
Assets file '{Filepath}\obj\project.assets.json' doesn't have a target for 'net8.0-windows10.0.19041.0'. Ensure that restore has run and that you have included 'net8.0-windows10.0.19041.0' in the TargetFrameworks for your project.
Assets file '{Filepath}\obj\project.assets.json' doesn't have a target for 'net8.0-ios'. Ensure that restore has run and that you have included 'net8.0-ios' in the TargetFrameworks for your project.
Assets file '{Filepath}\obj\project.assets.json' doesn't have a target for 'net8.0-android34.0'. Ensure that restore has run and that you have included 'net8.0-android34.0' in the TargetFrameworks for your project.
Assets file '{Filepath}\obj\project.assets.json' doesn't have a target for 'net7.0-maccatalyst'. Ensure that restore has run and that you have included 'net7.0-maccatalyst' in the TargetFrameworks for your project.
I've tried running msbuild /target:Restore {Project Name.sln} from the developer powershell, but still no dice. I see that this seems to be a pretty common issue but I haven't had any luck with the solutions
Share Improve this question asked Feb 7 at 20:00 Zachary DemmelZachary Demmel 214 bronze badges 2- 1 How did you update your app to android version 34? In addition, why did the errors contains both .net7.0 and .net8.0? – Liyun Zhang - MSFT Commented yesterday
- Went into the project properties and updated it to .net8.0 and version 34. I would assume that because it used to target .net7.0 but I had to make the upgrade to get it to version 34. Is there a better way to do that? Sorry for whats probably a stupid question! – Zachary Demmel Commented yesterday
1 Answer
Reset to default 0If you don't have to use the new api in the Android version 34.0, the easiest way to update your app to android version 34 is setting the target sdk in the AndoridManifest.xml. Just add the following code in the AndoridManifest.xml.
<uses-sdk android:targetSdkVersion="34" />
In addition, the .Net 7 is obsolete. So if you want to upgrade your maui project from .net 7 to .net 8, you can change the csproj file as the following code after installing .NET 8 and the .NET MAUI workload.
<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
The .net 8.0 maui project target Android version 34 defaultly. For more information, you can refer to Upgrading .NET MAUI from .NET 7 to .NET 8.
本文标签: visual studioUpdating NET MAUI app to android version 34 causing app to crashStack Overflow
版权声明:本文标题:visual studio - Updating .NET MAUI app to android version 34 causing app to crash - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1739293082a2156782.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论