TobiasBuchholz / Plugin.Firebase

Wrapper around the native Android and iOS Firebase Xamarin SDKs
MIT License
220 stars 49 forks source link

Invalid Binary on App Store iOS release build #148

Closed arahmancsd closed 1 year ago

arahmancsd commented 1 year ago

I am facing an Invalid Binary issue with the release build in the App Store. I have an empty sample MAUI app with the following packages.

If I remove the Plugin.Firebase package from the project, the app is uploaded and passes the Test Flight. However, when I add the Plugin.Firebase. The app is directly rejected from the App Store with Invalid Binary. It actually doesn't pass the Test Flight and is removed automatically.

This is an empty MAUI app. The app is working perfectly fine with the Android, so in the sample I target iOS only.

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFrameworks>net7.0-ios</TargetFrameworks>
        <!--<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>-->
        <!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
        <!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
        <OutputType>Exe</OutputType>
        <RootNamespace>MauiTestApp</RootNamespace>
        <UseMaui>true</UseMaui>
        <SingleProject>true</SingleProject>
        <ImplicitUsings>enable</ImplicitUsings>

        <!-- Display name -->
        <ApplicationTitle>MauiTestApp</ApplicationTitle>

        <!-- App Identifier -->
        <ApplicationId>com.azee.mauitestapp</ApplicationId>
        <ApplicationIdGuid>5570cff5-4abb-454f-971e-7106748a6a4d</ApplicationIdGuid>

        <!-- Versions -->
        <ApplicationDisplayVersion>1.0.9</ApplicationDisplayVersion>
        <ApplicationVersion>9</ApplicationVersion>

        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
    </PropertyGroup>

    <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
      <CreatePackage>false</CreatePackage>
    </PropertyGroup>

    <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net7.0-ios|AnyCPU'">
      <CreatePackage>false</CreatePackage>
      <CodesignProvision>Maui Test App</CodesignProvision>
      <CodesignKey>iPhone Distribution</CodesignKey>
      <CodesignEntitlements>Platforms\iOS\Entitlements.plist</CodesignEntitlements>
    </PropertyGroup>
    <ItemGroup>
        <!-- App Icon -->
        <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

        <!-- Splash Screen -->
        <MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

        <!-- Images -->
        <MauiImage Include="Resources\Images\*" />
        <MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

        <!-- Custom Fonts -->
        <MauiFont Include="Resources\Fonts\*" />

        <!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
        <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
    </ItemGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
        <PackageReference Include="CommunityToolkit.Maui" Version="5.0.0" />
        <PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
        <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
        <PackageReference Include="Plugin.Firebase" Version="1.3.0" />
        <PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
        <PackageReference Include="SQLitePCLRaw.core" Version="2.1.4" />
        <PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.4" />
        <PackageReference Include="SQLitePCLRaw.provider.dynamic_cdecl" Version="2.1.4" />
        <PackageReference Include="SQLitePCLRaw.provider.sqlite3" Version="2.1.4" />
        <PackageReference Include="Mopups" Version="1.1.1" />
        <PackageReference Include="Plugin.MediaManager" Version="1.2.2" />
        <PackageReference Include="Plugin.MediaManager.Forms" Version="1.2.2" />
    </ItemGroup>
    <ItemGroup>
      <BundleResource Include="GoogleService-Info.plist" />
    </ItemGroup>
</Project>

Here is the repo without the GoogleService-Info-plist file.

arahmancsd commented 1 year ago

The solution for this issue is #10989

stoff99 commented 1 year ago

After just adding the Plugin.Firebase.CloudMessaging the problem looks solved. (also some little changes in the implementation (check the readme)) I created and uploaded a release build to apple and the processing was successfully. Thx @TobiasBuchholz for your great work!