AdamEssenmacher / GoogleApisForiOSComponents

A community-supported fork of the abandoned Xamarin.iOS.* binding libraries from Microsoft
MIT License
63 stars 13 forks source link

App is stuck during build #21

Closed pinkysek closed 5 months ago

pinkysek commented 6 months ago

first of all like others I want to thank you for your work with these libraries.

I tried upgrade old Xamarin.Firebase.iOS. (8.10.0.3) libraries for these new AdamE.Firebase.iOS. libraries with latest version 10.24.0 but I have problem with build my app which is stuck during build I left it alone for 2 hours and still nothing happened. My problem is I don't have any error message or something so I don't know what is wrong. It's same for simulator or real device. When I tried go back to old libraries build works again withount any problem. I would be very grateful for any help or where I can get more info from some build logs or someting like this.

Environment: Visual Studio Pro 2022 for Windows version 17.9.6 Xcode on Mac version 15.3 .NET iOS app (originally Xamarin.iOS) not MAUI with target framework net8.0-ios

This is how my iOS project .csproj looks:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net8.0-ios</TargetFramework>
    <OutputType>Exe</OutputType>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <SupportedOSPlatformVersion>11.0</SupportedOSPlatformVersion>
    <UseMauiEssentials>true</UseMauiEssentials>
    <ProvisioningType>manual</ProvisioningType>
    <CodesignKey>iPhone Developer</CodesignKey>
    <CodesignProvision>AppName - Devel 2024</CodesignProvision>
  </PropertyGroup>
  <!--https://github.com/xamarin/GoogleApisForiOSComponents/issues/643#issuecomment-1920970044-->
  <PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
    <_ExportSymbolsExplicitly>false</_ExportSymbolsExplicitly>
  </PropertyGroup>
  <PropertyGroup>
    <FirebaseCrashlyticsUploadSymbolsEnabled>True</FirebaseCrashlyticsUploadSymbolsEnabled>
  </PropertyGroup>
  <PropertyGroup>
    <FirebaseCrashlyticsUploadSymbolsContinueOnError>False</FirebaseCrashlyticsUploadSymbolsContinueOnError>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-ios|AnyCPU'">
    <MtouchLink>SdkOnly</MtouchLink>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <MtouchLink>SdkOnly</MtouchLink>
  </PropertyGroup>
  <ItemGroup>
    <None Remove="GoogleService-Info.plist" />
  </ItemGroup>
  <ItemGroup>
    <BundleResource Include="GoogleService-Info.plist">
      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
    </BundleResource>
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="AdamE.Firebase.iOS.Analytics" Version="10.24.0" />
    <PackageReference Include="AdamE.Firebase.iOS.CloudMessaging" Version="10.24.0" />
    <PackageReference Include="AdamE.Firebase.iOS.Core" Version="10.24.0" />
    <PackageReference Include="AdamE.Firebase.iOS.Crashlytics" Version="10.24.0" />
    <PackageReference Include="AdamE.Firebase.iOS.Installations" Version="10.24.0" />
    <PackageReference Include="Cirrious.FluentLayout" Version="3.0.0" />
    <PackageReference Include="ImageCaching.Nuke" Version="3.0.1" />
    <PackageReference Include="Microsoft.Maui.Essentials" Version="8.0.20" />
    <PackageReference Include="MvvmCross" Version="9.2.0" />
    <PackageReference Include="Serilog.Sinks.Xamarin" Version="1.0.0" />
    <PackageReference Include="Xamarin.Build.Download" Version="0.11.4" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\plugins\MobileBarcodeScanner.iOS\MobileBarcodeScanner.iOS.csproj" />
    <ProjectReference Include="..\..\plugins\MvvmCross.Plugin.Sidebar\MvvmCross.Plugin.Sidebar.csproj" />
    <ProjectReference Include="..\AppName.Core\AppName.Core.csproj" />
  </ItemGroup>
  <!-- Target needed until LinkWithSwiftSystemLibraries makes it into the SDK: https://github.com/xamarin/xamarin-macios/pull/20463 -->
  <Target Name="LinkWithSwift" DependsOnTargets="_ParseBundlerArguments;_DetectSdkLocations" BeforeTargets="_LinkNativeExecutable">
      <PropertyGroup>
          <_SwiftPlatform Condition="$(RuntimeIdentifier.StartsWith('iossimulator-'))">iphonesimulator</_SwiftPlatform>
          <_SwiftPlatform Condition="$(RuntimeIdentifier.StartsWith('ios-'))">iphoneos</_SwiftPlatform>
      </PropertyGroup>
      <ItemGroup>
          <_CustomLinkFlags Include="-L" />
          <_CustomLinkFlags Include="/usr/lib/swift" />
          <_CustomLinkFlags Include="-L" />
          <_CustomLinkFlags Include="$(_SdkDevPath)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(_SwiftPlatform)" />
          <_CustomLinkFlags Include="-Wl,-rpath" />
          <_CustomLinkFlags Include="-Wl,/usr/lib/swift" />
      </ItemGroup>
  </Target>
</Project>
pinkysek commented 6 months ago

I had an idea and I tried older version and AdamE.Firebase.iOS.* with version 10.23.0 works well on simulator and I can see my test crash in Firebase Crashlytics and Analytics works too. But I don't know why app is stuck during build with latest version.

AdamEssenmacher commented 6 months ago

https://github.com/AdamEssenmacher/GoogleApisForiOSComponents/issues/4#issuecomment-2133955447

pinkysek commented 5 months ago

#4 (comment)

ye it looks my problem is same like this https://github.com/AdamEssenmacher/GoogleApisForiOSComponents/issues/4#issuecomment-2133940176 but I really don't know what to do with it... I tried turn off Windows Defender and some other things...

pinkysek commented 5 months ago

btw I tried upload my iOS app with 10.23.0 on TestFlight but my app crashing during start up but in debug mode on real device or simulator there is no problem,

bengavin commented 5 months ago

@pinkysek - Install 7-zip directly on your Windows device [or Parallels instance], then add the following to your project file:

<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('windows'))">
    <XamarinBuildDownloadUser7ZipPath>C:\Program Files\7-Zip\7z.exe</XamarinBuildDownloadUser7ZipPath>
</PropertyGroup>

This resolved it for us [besides the various long-path support requirements and issues with Visual Studio].

pinkysek commented 5 months ago

@pinkysek - Install 7-zip directly on your Windows device [or Parallels instance], then add the following to your project file:

<PropertyGroup Condition="$([MSBuild]::IsOSPlatform('windows'))">
  <XamarinBuildDownloadUser7ZipPath>C:\Program Files\7-Zip\7z.exe</XamarinBuildDownloadUser7ZipPath>
</PropertyGroup>

This resolved it for us [besides the various long-path support requirements and issues with Visual Studio].

@bengavin nice thanks for your help... I will try it later :)