Giter VIP home page Giter VIP logo

Comments (6)

Flash3001 avatar Flash3001 commented on August 22, 2024

@flashfoxter Sorry for the HUGE delay. Did you manage it? Is it happening only to iPad not iPhone?

I've only now seen you commented on this #17 closed issue.

In your case, it is happening only on the second build as well? A clean/rebuild fix it?

from ioscharts.xamarin.

follesoe avatar follesoe commented on August 22, 2024

Clean/rebuild is still the way I have to do it in order to build Relese or Debug on physical device. If I have built once, I have to clean to run it a second time. A huge pain as the build times are really slow when building from scratch every time...

from ioscharts.xamarin.

Flash3001 avatar Flash3001 commented on August 22, 2024

@flashfoxter @follesoe are you still having this issue after the most recent updates to Xamarin Studio?

from ioscharts.xamarin.

vorotnyaknazar avatar vorotnyaknazar commented on August 22, 2024

@Flash3001 I have the same issue (not with iOSCharts, but with the same approach from your article of binding swift libraries). It doesn't matter iPad or iPhone. full rebuild signs all *dylibs but when you change anything and try to debug it crashes on startup because this time target _CodesignNativeLibraries isn't executed at all
I created an issue here xamarin/xamarin-macios#4610

from ioscharts.xamarin.

Flash3001 avatar Flash3001 commented on August 22, 2024

Hey @vorotnyaknazar @follesoe and @flashfoxter, on May, 2017 I spent some time trying to debug it on VS and didn't have any success reproducing it, but when I read @vorotnyaknazar report I saw the Version 15.7.6 and realized the issue you are having is not on VS4M, but on the VS for Windows! It didn't cross my mind back then. I'm sorry!

I was able to reproduce it and hack it to work. I won't publish it on Nuget for now as I didn't test it much, if you can test it for a few days and tell me if it doesn't break anything else it would be really nice =)

Please replace the contents of Xamarin.Swift4.targets for the lines bellow - it will resign the Swift dylibs on every compilation (as VS does for the app itself).

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <UsingTask TaskName="Microsoft.Build.Tasks.Copy" Condition="$(OS) == 'Windows'" AssemblyFile="Xamarin.iOS.Tasks.dll"/>
  <UsingTask TaskName="Microsoft.Build.Tasks.RemoveDir" Condition="$(OS) == 'Windows'"  AssemblyFile="Xamarin.iOS.Tasks.dll"/>
  <UsingTask TaskName="Microsoft.Build.Tasks.Delete" Condition="$(OS) == 'Windows'" AssemblyFile="Xamarin.iOS.Tasks.dll"/> 
  <PropertyGroup Condition="'$(Platform)' == 'iPhoneSimulator'">
    <CreateAppBundleDependsOn>
	$(CreateAppBundleDependsOn);
      	_CopySwiftLibsSimulator;
	</CreateAppBundleDependsOn>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Platform)' == 'iPhone'">
    <_CompileToNativeDependsOn>
      _RemoveExtraLibs;
      $(_CompileToNativeDependsOn);
    </_CompileToNativeDependsOn>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Platform)' == 'iPhone'">
    <_CoreCodesignDependsOn>
      _CodesignSwift;
      $(_CoreCodesignDependsOn);
    </_CoreCodesignDependsOn>
  </PropertyGroup>
  
  <Target Name="_CopySwiftLibsSimulator">
    <ItemGroup>
        <_SwiftLibsSimulator Include="$(_AppBundlePath)SwiftFrameworksSimulator\libswift*.dylib" />
    </ItemGroup>
    <ItemGroup>
        <_SwiftLibsDevice Include="$(_AppBundlePath)Frameworks\libswift*.dylib" />
    </ItemGroup>
    <Delete SessionId="$(BuildSessionId)" Files="@(_SwiftLibsDevice)" />
    <Copy SessionId="$(BuildSessionId)" SourceFiles="@(_SwiftLibsSimulator)" DestinationFolder="$(_AppBundlePath)Frameworks" />
  </Target>

  <Target Name="_CodesignSwift">
    <ItemGroup>
        <_SwiftLibsDevice Include="$(_AppBundlePath)Frameworks\libswift*.dylib" />
    </ItemGroup>

    <PropertyGroup>
      <_CodesignDisableTimestamp>False</_CodesignDisableTimestamp>
    </PropertyGroup>

    <Codesign
      SessionId="$(BuildSessionId)"
      Condition="'$(IsMacEnabled)' == 'true'"
      ToolExe="$(CodesignExe)"
      ToolPath="$(CodesignPath)"
      CodesignAllocate="$(_CodesignAllocate)"
      DisableTimestamp="$(_CodesignDisableTimestamp)"
      Keychain="$(CodesignKeychain)"
      Resources="@(_SwiftLibsDevice)"
      SigningKey="$(_CodeSigningKey)"
      ExtraArgs="$(CodesignExtraArgs)" >
    </Codesign>
	</Target>

  <Target Name="_RemoveExtraLibs">
    <RemoveDir SessionId="$(BuildSessionId)" Directories="$(_AppBundlePath)SwiftFrameworksSimulator" />
  </Target>
</Project>

I wouldn't call it a final solution, but it should work as a workaround while we learn what is happing on VS side.

from ioscharts.xamarin.

vorotnyaknazar avatar vorotnyaknazar commented on August 22, 2024

@Flash3001 Thanks, Most likely I will test it today

UPDATE: it's working for me

from ioscharts.xamarin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.