amplitude / unity-plugin

Official Amplitude Unity Plugin
https://developers.amplitude.com/docs/unity
MIT License
44 stars 34 forks source link

ios undefine analyticsconnector class from amplitude #104

Closed AkiraJue closed 2 years ago

AkiraJue commented 2 years ago

build ios platform error.

bohan-amplitude commented 2 years ago

Hi @AkiraJue , Thanks for provide feedback. Could you provide more details about the error like error logs and how to reproduce?

mathieudel commented 2 years ago

Hi !

I think I got the same issue when building from a Unity Cloud Build bot. Here is the relevant logs:


8953: > Symbol: _OBJC_CLASS_$_AnalyticsConnector
8954: > Referenced from: objc-class-ref in Amplitude.o
8955: ❌;  ld: symbol(s) not found for architecture arm64
8956: ❌;  clang: error: linker command failed with exit code 1 (use -v to see invocation)
8957: ** ARCHIVE FAILED **
8958: The following build commands failed:
8959:   Ld /BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-ejfmyrsekvocjxffwlzilmiivtkh/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/UnityFramework.framework/UnityFramework normal (in target 'UnityFramework' from project 'Unity-iPhone')
8960: (1 failure)
8961: Exit status: 65```
DimaPetrinko commented 2 years ago

Hello Having the exact same error during unity ios build using jenkins UPD: the 2.4.0 version of the sdk does not cause the error

BlackstaffGames commented 2 years ago

Hey,

Having the same issue as above for iOS. Using Unity 2019.4 and Xcode 13.3 and version 2.5.0 of the SDK. "_OBJCCLASS$_AnalyticsConnector"

Will try 2.4 version in the meantime as suggested above.

arda-arvis commented 2 years ago

Hello! We are having the same error. GitLab CI/CD pipeline runner, Mac Mini M1 2020, Unity 2020.3.20f1.

dnshi commented 2 years ago

A new release of the Unity plugin is ready. Please install the new version to resolve the issue. Thanks.

ugurinal commented 2 years ago

The problem still occurs on Unity 2021.3.6f1. Using v2.4.0 solved the issue for me. @dnshi

dnshi commented 2 years ago

The problem still occurs on Unity 2021.3.6f1. Using v2.4.0 solved the issue for me. @dnshi

@ugurinal Thanks for reporting. Could you please share me which unity plugin version has the issue? Is the problem reproduced on v2.5.1?

ugurinal commented 2 years ago

@dnshi Yes, it is reproduced on v2.5.1.

dnshi commented 2 years ago

@ugurinal Could you please share your error message and your podfile?

ugurinal commented 2 years ago

@dnshi

Undefined symbol: _OBJCCLASS$_AnalyticsConnector

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_AnalyticsConnector", referenced from:
      objc-class-ref in Amplitude.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Pod file:

source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'

target 'UnityFramework' do
  pod 'Amplitude', '~> 8.10.0'
  pod 'FBSDKCoreKit', '~> 14.0'
  pod 'FBSDKCoreKit_Basics', '~> 14.0'
  pod 'FBSDKGamingServicesKit', '~> 14.0'
  pod 'FBSDKLoginKit', '~> 14.0'
  pod 'FBSDKShareKit', '~> 14.0'
end
target 'Unity-iPhone' do
end
use_frameworks! :linkage => :static
use_frameworks!
dnshi commented 2 years ago

@ugurinal Do you remove any existing iOS plugin source files before importing the new version? For the version 2.5.1, most of iOS files from Unity side are removed and imported from from Pod file pod 'Amplitude', '~> 8.10.0'. From the error message, it looks like that some Unity iOS plugin files stay in your dev environment.