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

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

Open
sledderGIT opened this issue Jun 29, 2022 · 11 comments

Comments

@sledderGIT
Copy link

sledderGIT commented Jun 29, 2022

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@7ac33610
ProGuard: Guardsquare/proguard@912d149
SQLite: xamarin/sqlite@0893b3b
Xamarin.Android Tools: xamarin/xamarin-android-tools@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
Copy link
Author

This is what I got from the Microsoft support team:

"Hello,

I see from your logs

Undefined symbols for architecture arm64:
"OBJC_CLASS$_OSDeviceState", referenced from:
-u command line option
"OBJC_CLASS$_OSEmailSubscriptionState", referenced from:
-u command line option
"OBJC_CLASS$_OSEmailSubscriptionStateChanges", referenced from:
-u command line option
"OBJC_CLASS$_OSInAppMessage", referenced from:
-u command line option
"OBJC_CLASS$_OSInAppMessageAction", referenced from:
-u command line option
"OBJC_CLASS$_OSInAppMessageOutcome", referenced from:
-u command line option
"OBJC_CLASS$_OSInAppMessageTag", referenced from:
-u command line option
"OBJC_CLASS$_OSNotification", referenced from:
-u command line option
"OBJC_CLASS$_OSNotificationAction", referenced from:
-u command line option
"OBJC_CLASS$_OSNotificationOpenedResult", referenced from:
-u command line option
"OBJC_CLASS$_OSOutcomeEvent", referenced from:
-u command line option
"OBJC_CLASS$_OSPermissionState", referenced from:
-u command line option
"OBJC_CLASS$_OSPermissionStateChanges", referenced from:
-u command line option
"OBJC_CLASS$_OSSMSSubscriptionState", referenced from:
-u command line option
"OBJC_CLASS$_OSSMSSubscriptionStateChanges", referenced from:
-u command line option
"OBJC_CLASS$_OSSubscriptionState", referenced from:
-u command line option
"OBJC_CLASS$_OSSubscriptionStateChanges", referenced from:
-u command line option
"OBJC_CLASS$_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
Copy link
Author

Any updates?

@jkasten2
Copy link
Member

jkasten2 commented Jul 5, 2022

@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
Copy link
Author

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
Copy link
Author

Any updates on this issue?

@sledderGIT
Copy link
Author

Bump

@ghost
Copy link

ghost commented Aug 16, 2022

Any workaround here?

@ghost
Copy link

ghost commented Aug 17, 2022

It seems this is only happening in debug mode.

@sledderGIT
Copy link
Author

sledderGIT commented Oct 24, 2022

@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
Copy link
Author

Any update on this issue?

@l0gaw
Copy link

l0gaw commented Jan 31, 2023

UP

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