Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question]: Error MT1035: Cannot include different versions of the framework 'OneSignal.framework' ? #375

Closed
1 task done
robfrancis opened this issue Apr 6, 2023 · 3 comments

Comments

@robfrancis
Copy link

robfrancis commented Apr 6, 2023

How can we help?

Hey,

I'm getting the following error when building my Xamarin Forms iOS project in App Center after upgrading from OneSignal v3 to v4.
Has anyone experienced this issue?

error MT1035: Cannot include different versions of the framework 'OneSignal.framework' [...MyProject.iOS.csproj]
error MT1036: Framework 'OneSignal.framework' included from: /Users/runner/.nuget/packages/onesignalsdk.xamarin/4.3.4/res/iOS/OneSignal.xcframework/ios-arm64_armv7_armv7s/OneSignal.framework (Related to previous error) [/Users/runner/work/1/s/MyProject/MyProject.iOS/MyProject.iOS.csproj]
error MT1036: Framework 'OneSignal.framework' included from: /Users/runner/work/1/s/MyProject/packages/OneSignalSDK.Xamarin.4.3.4/res/iOS/OneSignal.xcframework/ios-arm64_armv7_armv7s/OneSignal.framework (Related to previous error) [/Users/runner/work/1/s/MyProject/MyProject.iOS/MyProject.iOS.csproj]

I would appreciate any advice.
Thanks.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@robfrancis robfrancis changed the title [question]: Cannot include different versions of the framework 'OneSignal.framework' ? [question]: Error MT1035: Cannot include different versions of the framework 'OneSignal.framework' ? Apr 6, 2023
@robfrancis
Copy link
Author

This issue occurred as a result of upgrading the OneSignal.Xamarin package in my iOS ServiceExtensions project.

When upgrading from v3 to v4 it was adding the following to the .csproj

<ItemGroup>
  <Reference Include="OneSignal.iOS.Binding, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
    <HintPath>..\packages\OneSignalSDK.Xamarin.4.1.3\lib\Xamarin.iOS\OneSignal.iOS.Binding.dll</HintPath>
  </Reference>
  <Reference Include="OneSignalSDK.Xamarin, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
    <HintPath>..\packages\OneSignalSDK.Xamarin.4.1.3\lib\Xamarin.iOS\OneSignalSDK.Xamarin.dll</HintPath>
  </Reference>
  <Reference Include="OneSignalSDK.Xamarin.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
    <HintPath>..\packages\OneSignalSDK.Xamarin.4.1.3\lib\Xamarin.iOS\OneSignalSDK.Xamarin.Core.dll</HintPath>
  </Reference>
</ItemGroup>
<ItemGroup>
  ...
  <None Include="packages.config" />
  ...
</ItemGroup>
<Import Project="..\packages\OneSignalSDK.Xamarin.4.1.3\build\Xamarin.iOS\OneSignalSDK.Xamarin.targets" Condition="Exists('..\packages\OneSignalSDK.Xamarin.4.1.3\build\Xamarin.iOS\OneSignalSDK.Xamarin.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
  <PropertyGroup>
    <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
  </PropertyGroup>
  <Error Condition="!Exists('..\packages\OneSignalSDK.Xamarin.4.1.3\build\Xamarin.iOS\OneSignalSDK.Xamarin.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\OneSignalSDK.Xamarin.4.1.3\build\Xamarin.iOS\OneSignalSDK.Xamarin.targets'))" />
</Target>

I needed to replace this chunk of code with

<ItemGroup>
    <PackageReference Include="OneSignalSDK.Xamarin" Version="4.3.4" />
</ItemGroup>

This resolve my issue completely.

@emawby
Copy link
Contributor

emawby commented Apr 11, 2023

Thank you for reporting! I am glad you were able to find the issue

@devperson
Copy link

Thanks @robfrancis I had the same issue and your solution worked for me as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants