OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
104 stars 50 forks source link

Adding OneSignal Xamarin SDK to OneSignalNotificationServiceExtension causes linker command failed with exit code 1 #309

Open sledderGIT opened 2 years ago

sledderGIT commented 2 years ago

Description: Adding OneSignal Xamarin SDK to OneSignalNotificationServiceExtension causes linker command failed with exit code 1 (use -v to see invocation) when trying to build the solution in Debug | iPhone configuration. Without OneSignal SDK the solution builds correctly without errors.

Environment Version of OneSignalSDK.Xamarin NuGet package: 4.1.0

=== Visual Studio Community 2019 for Mac ===

Version 8.10.25 (build 2) Installation UUID: 6fd53088-9e42-4416-9ef7-f051e07071a0 GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

Package version: 612000182

=== Mono Framework MDK ===

Runtime: Mono 6.12.0.182 (2020-02/6051b710727) (64-bit) Package version: 612000182

=== Roslyn (Language Service) ===

3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb

=== NuGet ===

Версия: 5.9.0.7134

=== .NET SDK (x64) ===

SDK: /usr/local/share/dotnet/sdk/5.0.408/Sdks Версии пакета SDK: 6.0.203 5.0.408 5.0.403 5.0.402 5.0.400 5.0.301 5.0.202 5.0.103 5.0.101 5.0.100 3.1.420 3.1.419 3.1.415 3.1.414 3.1.412 3.1.410 3.1.408 3.1.406 3.1.404 3.1.403 3.1.402 3.1.300 3.1.200 3.0.100 2.1.701 2.1.505 2.1.302 Пакеты MSBuild SDK: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== Среда выполнения .NET Core ===

Среда выполнения: /usr/local/share/dotnet/dotnet Версии среды выполнения: 6.0.5 5.0.17 5.0.12 5.0.11 5.0.9 5.0.7 5.0.5 5.0.3 5.0.1 5.0.0 3.1.26 3.1.25 3.1.21 3.1.20 3.1.18 3.1.16 3.1.14 3.1.12 3.1.10 3.1.9 3.1.8 3.1.4 3.1.2 3.0.0 2.1.23 2.1.22 2.1.18 2.1.16 2.1.13 2.1.12 2.1.9 2.1.2

=== Пакет SDK для .NET Core 3.1 ===

SDK: 3.1.420

=== .NET 5.0 SDK ===

SDK: 5.0.408

=== Xamarin.Profiler ===

Версия: 1.8.0.22 Расположение: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Версия: 11

=== Apple Developer Tools ===

Xcode 13.4.1 (20504) Build 13F100

=== Xamarin.Mac ===

Version: 8.10.0.5 (Visual Studio Community) Hash: 96b3edb6d Branch: d17-2 Build date: 2022-05-18 07:32:06-0400

=== Xamarin.iOS ===

Version: 15.10.0.5 (Visual Studio Community) Hash: 96b3edb6d Branch: d17-2 Build date: 2022-05-18 07:32:07-0400

=== Xamarin Designer ===

Version: 16.11.0.60 Hash: 56f9b80b0 Branch: remotes/origin/d16-11 Build date: 2021-12-15 01:44:16 UTC

=== Xamarin.Android ===

Версия: 12.2.8.3 (Visual Studio Community) Фиксация: xamarin-android/d17-1/fafdba7 Android SDK: /Users/sledder/Library/Developer/Xamarin/android-sdk-macosx Поддерживаемые версии Android: 5.0 (уровень API 21) 7.1 (уровень API 25) 8.1 (уровень API 27)

Версия SDK Tools: 26.1.1 Версия инструментов платформы SDK: 33.0.1 Версия инструментов сборки SDK: 33.0.0 rc4

Сведения о сборке: Mono: dffa5ab Java.Interop: xamarin/java.interop/d17-1@7ac33610 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.37.1@0893b3b Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-1@db125a7

=== Eclipse Temurin JDK ===

Java SDK: Не найден

=== Android SDK Manager ===

Version: 16.10.0.13 Hash: 1b81df5 Branch: remotes/origin/d16-10 Build date: 2021-11-12 00:17:32 UTC

=== Android Device Manager ===

Version: 16.10.0.15 Hash: 89dcc0b Branch: remotes/origin/d16-10 Build date: 2021-11-12 00:17:52 UTC

=== Build Information ===

Release ID: 810250002 Git revision: 0620af530b5800e0eada4882ce1c3d4dad7e53d3 Build date: 2022-06-15 13:41:26-04 Build branch: release-8.10

=== Operating System ===

Mac OS X 12.4.0 Darwin 21.5.0 Darwin Kernel Version 21.5.0 Tue Apr 26 21:08:22 PDT 2022 root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64

Steps to Reproduce Issue: Following the steps from the oficial Onesignal guide for Xamarin. https://documentation.onesignal.com/docs/xamarin-sdk-setup

  1. Add Notification extension to the solution.
  2. Modify info.plist and entitlements.plist as in the guide.
  3. Check that everything builts. Everything builts on this step.
  4. Add OneSignalSDK.Xamarin via nuget.
  5. Replace the code in the NotificationService.cs
  6. Try to build the app in the Debug | iPhone mode
  7. Getting error " linker command failed with exit code 1 "

Anything else:

OnesignalNotificationExtension.csproj : 

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\iPhone\Debug</OutputPath>
    <DefineConstants>DEBUG;</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <DeviceSpecificBuild>true</DeviceSpecificBuild>
    <MtouchDebug>true</MtouchDebug>
    <MtouchNoSymbolStrip>true</MtouchNoSymbolStrip>
    <MtouchFastDev>true</MtouchFastDev>
    <MtouchFloat32>true</MtouchFloat32>
    <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
    <IOSDebuggerPort>34708</IOSDebuggerPort>
    <MtouchLink>SdkOnly</MtouchLink>
    <MtouchArch>ARM64</MtouchArch>
    <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
    <MtouchVerbosity></MtouchVerbosity>
    <CodesignKey>Apple Development....(the key goes here)</CodesignKey>
    <CodesignProvision>match Development com.dev.cteleport.app.OneSignalNotificationServiceExtension</CodesignProvision>
  </PropertyGroup>
sledderGIT commented 2 years ago

This is what I got from the Microsoft support team:

"Hello,

I see from your logs

Undefined symbols for architecture arm64: "_OBJCCLASS$_OSDeviceState", referenced from: -u command line option "_OBJCCLASS$_OSEmailSubscriptionState", referenced from: -u command line option "_OBJCCLASS$_OSEmailSubscriptionStateChanges", referenced from: -u command line option "_OBJCCLASS$_OSInAppMessage", referenced from: -u command line option "_OBJCCLASS$_OSInAppMessageAction", referenced from: -u command line option "_OBJCCLASS$_OSInAppMessageOutcome", referenced from: -u command line option "_OBJCCLASS$_OSInAppMessageTag", referenced from: -u command line option "_OBJCCLASS$_OSNotification", referenced from: -u command line option "_OBJCCLASS$_OSNotificationAction", referenced from: -u command line option "_OBJCCLASS$_OSNotificationOpenedResult", referenced from: -u command line option "_OBJCCLASS$_OSOutcomeEvent", referenced from: -u command line option "_OBJCCLASS$_OSPermissionState", referenced from: -u command line option "_OBJCCLASS$_OSPermissionStateChanges", referenced from: -u command line option "_OBJCCLASS$_OSSMSSubscriptionState", referenced from: -u command line option "_OBJCCLASS$_OSSMSSubscriptionStateChanges", referenced from: -u command line option "_OBJCCLASS$_OSSubscriptionState", referenced from: -u command line option "_OBJCCLASS$_OSSubscriptionStateChanges", referenced from: -u command line option "_OBJCCLASS$_OneSignal", referenced from: -u command line option "_ONESIGNAL_VERSION", referenced from: -u command line option ld: symbol(s) not found for architecture arm64 This usually means that the library you are using does not contain the right architecture."

sledderGIT commented 2 years ago

Any updates?

jkasten2 commented 2 years ago

@sledderGIT Thanks for reporting, do you also get the same build error when you try running on a iOS simulator?

Can you also try going to your project setting and under "iOS Build" change the "Link behavior" to "Don't Link"?

image
sledderGIT commented 2 years ago

On iOS simulator everything works correctly because it's not ARM64 I suppose. But on iPhone it odesn't build and it doesnt matter if it's don't link or link SDKs only.

sledderGIT commented 1 year ago

Any updates on this issue?

sledderGIT commented 1 year ago

Bump

ghost commented 1 year ago

Any workaround here?

ghost commented 1 year ago

It seems this is only happening in debug mode.

sledderGIT commented 1 year ago

@arctouch-rafaelpontes Yeah still happens in debug mode. Verry annoing. Every time I want to debug on real device I have to remove the nuget package and commetn everything regarding OneSignal from the extension.

sledderGIT commented 1 year ago

Any update on this issue?

l0gaw commented 1 year ago

UP