mono / Embeddinator-4000

Tools to turn .NET libraries into native libraries that can be consumed on Android, iOS, Mac, Linux and other platforms.
MIT License
758 stars 95 forks source link

objcgen - Failed to resolve assembly Xamarin.Essentials #729

Open kepboy opened 5 years ago

kepboy commented 5 years ago

Steps to Reproduce

  1. Create .NET Standard 2.0 project
  2. NuGet add dependency Xamarin.Essentials
  3. Create class that uses (not exposes) OrientationSensor class
  4. build assembly
  5. Run objcgen on assembly to build iOS framework

Expected Behavior

Generate a framework exposing the assembly classes (but not the ones in Xamarin.Essentials)

Actual Behavior

Get error stated in subject line

Environment

Mac Mini OSX 10.14.5 Visual Studio Community Mac 8.1.1 (build 27) Xcode Embeddinator 0.4.0

Build Logs

see attached build.log

chamons commented 5 years ago

Error:

Xamarin.iOS 12.10.0.157 (d16-1): 6bd94753) using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk
warning MT0136: Cannot find the assembly 'Xamarin.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' referenced from '/Users/keith/Projects/bank-on-it-mobile/Source/Output/Debug/ObjC/netstandard2.0/BankOnIt.Game.ObjC.dll'.
warning MT0136: Cannot find the assembly 'Xamarin.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' referenced from '/Users/keith/Projects/bank-on-it-mobile/Source/Output/Debug/ObjC/netstandard2.0/BankOnIt.Game.ObjC.dll'.
warning MT0030: The executable name (BankOnIt.Game.ObjC) and the app name (BankOnIt.Game.ObjC) are different, this may prevent crash logs from getting symbolicated properly.
error MT2002: Failed to resolve assembly: 'Xamarin.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

Two things:

/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch --dev /Users/keith/Embed/iPhoneOS/BankOnIt.Game.ObjC --abi=armv7,armv7s,arm64 --sdkroot /Applications/Xcode.app --targetver 8.0 --dsym:false --msym:false --embeddinator /Users/keith/Projects/bank-on-it-mobile/Source/Output/Debug/ObjC/netstandard2.0/BankOnIt.Game.ObjC.dll -r:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll --sdk 12.2 --linksdkonly --xml=./Embed/bindings.xml --registrar:static --cache /Users/keith/Embed/iPhoneOS/build-cache --debug --assembly-build-target=@all=framework=BankOnIt.Game.ObjC.framework --target-framework Xamarin.iOS,v1.0 "--gcc_flags=-force_load /Users/keith/Embed/iPhoneOS/BankOnIt.Game.ObjC.a" 

with an additional -r:?

kepboy commented 5 years ago

Hey Chris, I'll put together a project shortly, however, I ran the command and the output it attached.

On Wed, 26 Jun 2019 at 01:30, Chris Hamons notifications@github.com wrote:

Error:

Xamarin.iOS 12.10.0.157 (d16-1): 6bd94753) using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk warning MT0136: Cannot find the assembly 'Xamarin.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' referenced from '/Users/keith/Projects/bank-on-it-mobile/Source/Output/Debug/ObjC/netstandard2.0/BankOnIt.Game.ObjC.dll'. warning MT0136: Cannot find the assembly 'Xamarin.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' referenced from '/Users/keith/Projects/bank-on-it-mobile/Source/Output/Debug/ObjC/netstandard2.0/BankOnIt.Game.ObjC.dll'. warning MT0030: The executable name (BankOnIt.Game.ObjC) and the app name (BankOnIt.Game.ObjC) are different, this may prevent crash logs from getting symbolicated properly. error MT2002: Failed to resolve assembly: 'Xamarin.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

Two things:

  • Could you attach a project showing the issue?
  • Could you run the command in question:

/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch --dev /Users/keith/Embed/iPhoneOS/BankOnIt.Game.ObjC --abi=armv7,armv7s,arm64 --sdkroot /Applications/Xcode.app --targetver 8.0 --dsym:false --msym:false --embeddinator /Users/keith/Projects/bank-on-it-mobile/Source/Output/Debug/ObjC/netstandard2.0/BankOnIt.Game.ObjC.dll -r:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll --sdk 12.2 --linksdkonly --xml=./Embed/bindings.xml --registrar:static --cache /Users/keith/Embed/iPhoneOS/build-cache --debug --assembly-build-target=@all=framework=BankOnIt.Game.ObjC.framework --target-framework Xamarin.iOS,v1.0 "--gcc_flags=-force_load /Users/keith/Embed/iPhoneOS/BankOnIt.Game.ObjC.a"

with an additional -r:?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mono/Embeddinator-4000/issues/729?email_source=notifications&email_token=ACVMBXQGETE5VFB2ZGZ2KKLP4I223A5CNFSM4H3HFHIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYQUP6Y#issuecomment-505497595, or mute the thread https://github.com/notifications/unsubscribe-auth/ACVMBXUDPQX6RVZLYS646ULP4I223ANCNFSM4H3HFHIA .

/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch --dev /Users/keith/Embed/iPhoneOS/BankOnIt.Game.ObjC --abi=armv7,armv7s,arm64 --sdkroot /Applications/Xcode.app --targetver 8.0 --dsym:false --msym:false --embeddinator /Users/keith/Projects/bank-on-it-mobile/Source/Output/Debug/ObjC/netstandard2.0/BankOnIt.Game.ObjC.dll -r:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll --sdk 12.2 --linksdkonly --xml=./Embed/bindings.xml --registrar:static --cache /Users/keith/Embed/iPhoneOS/build-cache --debug --assembly-build-target=@all=framework=BankOnIt.Game.Obj.framework --target-framework Xamarin.iOS,v1.0 "--gcc_flags=-force_load /Users/keith/Embed/iPhoneOS/BankOnIt.Game.ObjC.a" -r:/Users/keith/Projects/bank-on-it-mobile/Source/packages/Xamarin.Essentials.1.1.0/lib/netstandard2.0/Xamarin.Essentials.dll Xamarin.iOS 12.10.0.157 (d16-1): 6bd94753) using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk warning MT0030: The executable name (BankOnIt.Game.ObjC) and the app name (BankOnIt.Game.ObjC) are different, this may prevent crash logs from getting symbolicated properly. error MT0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new System.ArgumentNullException: Value cannot be null. Parameter name: collection at System.Collections.Generic.List1[T].InsertRange (System.Int32 index, System.Collections.Generic.IEnumerable1[T] collection) [0x00003] in :0 at System.Collections.Generic.List1[T].AddRange (System.Collections.Generic.IEnumerable1[T] collection) [0x00000] in :0 at Xamarin.Bundler.Application.BuildApp () [0x00040] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Application.cs:1526 at Xamarin.Bundler.Application.BuildNative () [0x0001f] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Application.cs:900 at Xamarin.Bundler.Application+<>c.b__146_2 (Xamarin.Bundler.Application v) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Application.cs:837 at System.Collections.Generic.List1[T].ForEach (System.Action1[T] action) [0x0001e] in :0 at Xamarin.Bundler.Application.BuildAll () [0x00076] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Application.cs:837 at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x00442] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/mtouch.cs:1344 at Xamarin.Bundler.Driver.Main (System.String[] args) [0x00015] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/mtouch.cs:864

kepboy commented 5 years ago

see attached sample project.

On Thu, 27 Jun 2019 at 21:01, Keith Moore keith.moore43@gmail.com wrote:

Hey Chris, I'll put together a project shortly, however, I ran the command and the output it attached.

On Wed, 26 Jun 2019 at 01:30, Chris Hamons notifications@github.com wrote:

Error:

Xamarin.iOS 12.10.0.157 (d16-1): 6bd94753) using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk warning MT0136: Cannot find the assembly 'Xamarin.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' referenced from '/Users/keith/Projects/bank-on-it-mobile/Source/Output/Debug/ObjC/netstandard2.0/BankOnIt.Game.ObjC.dll'. warning MT0136: Cannot find the assembly 'Xamarin.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' referenced from '/Users/keith/Projects/bank-on-it-mobile/Source/Output/Debug/ObjC/netstandard2.0/BankOnIt.Game.ObjC.dll'. warning MT0030: The executable name (BankOnIt.Game.ObjC) and the app name (BankOnIt.Game.ObjC) are different, this may prevent crash logs from getting symbolicated properly. error MT2002: Failed to resolve assembly: 'Xamarin.Essentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

Two things:

  • Could you attach a project showing the issue?
  • Could you run the command in question:

/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch --dev /Users/keith/Embed/iPhoneOS/BankOnIt.Game.ObjC --abi=armv7,armv7s,arm64 --sdkroot /Applications/Xcode.app --targetver 8.0 --dsym:false --msym:false --embeddinator /Users/keith/Projects/bank-on-it-mobile/Source/Output/Debug/ObjC/netstandard2.0/BankOnIt.Game.ObjC.dll -r:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll --sdk 12.2 --linksdkonly --xml=./Embed/bindings.xml --registrar:static --cache /Users/keith/Embed/iPhoneOS/build-cache --debug --assembly-build-target=@all=framework=BankOnIt.Game.ObjC.framework --target-framework Xamarin.iOS,v1.0 "--gcc_flags=-force_load /Users/keith/Embed/iPhoneOS/BankOnIt.Game.ObjC.a"

with an additional -r:?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mono/Embeddinator-4000/issues/729?email_source=notifications&email_token=ACVMBXQGETE5VFB2ZGZ2KKLP4I223A5CNFSM4H3HFHIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYQUP6Y#issuecomment-505497595, or mute the thread https://github.com/notifications/unsubscribe-auth/ACVMBXUDPQX6RVZLYS646ULP4I223ANCNFSM4H3HFHIA .

kepboy commented 5 years ago

EmbedinatorProb.zip