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

Can not build on iOS #30

Closed
Yesterday17 opened this issue Jun 9, 2023 · 14 comments · Fixed by #39
Closed

Can not build on iOS #30

Yesterday17 opened this issue Jun 9, 2023 · 14 comments · Fixed by #39

Comments

@Yesterday17
Copy link
Contributor

https://pipelines.actions.githubusercontent.com/serviceHosts/1990a263-8757-4bdb-9dd4-b3aaea312869/_apis/pipelines/1/runs/794/signedlogcontent/4?urlExpires=2023-06-09T13%3A48%3A08.6604963Z&urlSigningMethod=HMACV1&urlSignature=fGkYGY3ZFMpMBQciH9j6D%2Fm9jbaNTo97HkQyOHla%2Bm0%3D

This script exist in simple_audio.podspec:

mkdir Frameworks
cd Frameworks
if [ ! -d simple_audio.xcframework ]
then
  mkdir simple_audio.xcframework
  cd simple_audio.xcframework
  mkdir ios-arm64
  mkdir ios-arm64_x86_64-simulator
  curl -L "#{lib_url}/Info.plist?raw=true" -o Info.plist
  curl -L "#{lib_url}/ios-arm64/libsimple_audio.a?raw=true" -o ios-arm64/libsimple_audio.a
  curl -L "#{lib_url}/ios-arm64_x86_64-simulator/libsimple_audio.a?raw=true" -o ios-arm64_x86_64-simulator/libsimple_audio.a
fi
cd ../..

But directory simple_audio.xcframework already exists(in published package). So the following download script is never executed, making the compilation fail.

Another strange behavior is that even though I've removed the xcframework directory, it still can not build. It seems that the script is not executed?

@erikas-taroza
Copy link
Owner

The link expired so I can't view it. Can you please update it so I can take a look (expires in 1 day if possible)?

That code is just a modified version of this. Last time I tested on Apple devices, everything worked fine 🤔

But directory simple_audio.xcframework already exists(in published package)

Maybe I should add that to .pubignore

@Yesterday17
Copy link
Contributor Author

Can you please update it so I can take a look

Failed Action: https://github.com/ProjectAnni/annix/actions/runs/5218497944/jobs/9419349659

I'm using the following snippet as workaround in my ci for now:

      - name: Build | iOS, but expect to fail
        run: |
          flutter clean
          flutter build ios --release --verbose --build-number ${{ github.run_number }} || echo done
      - name: Setup | Fix simple_audio
        run: |
          sa_version=1.5.5
          sa_lib_url="https://github.com/erikas-taroza/simple_audio/blob/v${sa_version}/ios/Frameworks/simple_audio.xcframework"
          cd ios/.symlinks/plugins/simple_audio/ios/Frameworks/simple_audio.xcframework
          mkdir ios-arm64
          mkdir ios-arm64_x86_64-simulator
          curl -L "${sa_lib_url}/ios-arm64/libsimple_audio.a?raw=true" -o ios-arm64/libsimple_audio.a
          curl -L "${sa_lib_url}/ios-arm64_x86_64-simulator/libsimple_audio.a?raw=true" -o ios-arm64_x86_64-simulator/libsimple_audio.a
          cd ../../../../../../../
      - name: Build | iOS
        run: |
          flutter build ios --release --verbose --build-number ${{ github.run_number }}
          xcodebuild -workspace $PWD/ios/Runner.xcworkspace -scheme Runner -sdk iphoneos -configuration Release archive -archivePath $PWD/build/ios/iphoneos/Runner.xcarchive
          xcodebuild -exportArchive -archivePath $PWD/build/ios/iphoneos/Runner.xcarchive -exportOptionsPlist $PWD/ios/exportOptions.plist -exportPath $PWD/build/ios/iphoneos/Runner.ipa

@erikas-taroza
Copy link
Owner

Just cached simple_audio on my machine. The Info.plist file is being uploaded to pub.dev which is causing the directory to not be empty. I am going to add the file to .pubignore and upload as a new version.

Here is without the file added to pubignore:

ios
│   ├── Classes
│   │   ├── SimpleAudio.swift (10 KB)
│   │   ├── SimpleAudioPlugin.h (<1 KB)
│   │   ├── SimpleAudioPlugin.m (<1 KB)
│   │   ├── SwiftSimpleAudioPlugin.swift (1 KB)
│   │   └── bridge_generated.h (5 KB)
│   ├── Frameworks
│   │   └── simple_audio.xcframework
│   │       └── Info.plist (1 KB)
│   └── simple_audio.podspec (1 KB)

and with:

ios
│   ├── Classes
│   │   ├── SimpleAudio.swift (10 KB)
│   │   ├── SimpleAudioPlugin.h (<1 KB)
│   │   ├── SimpleAudioPlugin.m (<1 KB)
│   │   ├── SwiftSimpleAudioPlugin.swift (1 KB)
│   │   └── bridge_generated.h (5 KB)
│   └── simple_audio.podspec (1 KB)

Another strange behavior is that even though I've removed the xcframework directory, it still can not build. It seems that the script is not executed?

IIRC, the script will run if you see ... pod installing or something like that in the output. I think you can do flutter clean and rebuild to make it work. This should hopefully be done automatically when adding or updating the dependency.

erikas-taroza added a commit that referenced this issue Jun 9, 2023
@erikas-taroza
Copy link
Owner

Sorry, there were some issues with the workflow. Have to debug more later.

I uploaded a new version to pub.dev (1.5.6) if you want to test it out.

@erikas-taroza
Copy link
Owner

Hello @Yesterday17. Does this issue still persist on v1.6.2?

@Yesterday17
Copy link
Contributor Author

I may have time to test it these days.

@Yesterday17
Copy link
Contributor Author

Yesterday17 commented Aug 28, 2023

Sorry for late reply. The latest version is still broken due to another (symlink) problem, while 1.6.0 compiles with no problem:

image

@erikas-taroza
Copy link
Owner

Ok. I will look into it when I have the time. Maybe I have to recreate the symlink.

@erikas-taroza
Copy link
Owner

Sorry for late reply. The latest version is still broken due to another (symlink) problem, while 1.6.0 compiles with no problem:
image

Hm, this is weird. When I clone the repo, I see the Swift code, not the symlink path. Maybe its worth to try this?

@Yesterday17
Copy link
Contributor Author

Yesterday17 commented Aug 29, 2023

This folder is extracted from archive file downloaded from pub.dev. So I think it's a publish issue?

@erikas-taroza
Copy link
Owner

This folder is extracted from archive file downloaded from pub.dev. So I think it's a publish issue?

Ah ok. Yeah its the same in my pub cache.

@erikas-taroza
Copy link
Owner

erikas-taroza commented Aug 29, 2023

I have uploaded a prerelease 1.6.4-dev.1. It seems the symlink is working now. I ran flutter upgrade before uploading so maybe there was a regression. Let me know if it works for you. The CD will have to build the files so please wait on it

@Yesterday17
Copy link
Contributor Author

Yesterday17 commented Aug 29, 2023

Now the issue becomes:

Failed to build iOS app
Error (Xcode): Undefined symbol: _drop_opaque_Controls


Error (Xcode): Undefined symbol: _new_Controls


Error (Xcode): Undefined symbol: _new_box_autoadd_i64_0


Error (Xcode): Undefined symbol: _new_box_autoadd_metadata_0


Error (Xcode): Undefined symbol: _new_box_autoadd_player_0


Error (Xcode): Undefined symbol: _new_list_media_control_action_0


Error (Xcode): Undefined symbol: _share_opaque_Controls


Error (Xcode): Undefined symbol: _wire_callback_stream__static_method__Player


Error (Xcode): Undefined symbol: _wire_dispose__static_method__Player


Error (Xcode): Undefined symbol: _wire_get_progress__method__Player


Error (Xcode): Undefined symbol: _wire_has_preloaded__method__Player


Error (Xcode): Undefined symbol: _wire_is_playing__method__Player


Error (Xcode): Undefined symbol: _wire_loop_playback__method__Player


Error (Xcode): Undefined symbol: _wire_new__static_method__Player


Error (Xcode): Undefined symbol: _wire_normalize_volume__method__Player


Error (Xcode): Undefined symbol: _wire_open__method__Player


Error (Xcode): Undefined symbol: _wire_pause__method__Player


Error (Xcode): Undefined symbol: _wire_play__method__Player


Error (Xcode): Undefined symbol: _wire_play_preload__method__Player


Error (Xcode): Undefined symbol: _wire_playback_state_stream__static_method__Player


Error (Xcode): Undefined symbol: _wire_preload__method__Player


Error (Xcode): Undefined symbol: _wire_progress_state_stream__static_method__Player


Error (Xcode): Undefined symbol: _wire_seek__method__Player


Error (Xcode): Undefined symbol: _wire_set_metadata__method__Player


Error (Xcode): Undefined symbol: _wire_set_volume__method__Player


Error (Xcode): Undefined symbol: _wire_stop__method__Player


Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)


Encountered error while building for device.

Raw log:

           Undefined symbols for architecture arm64:
             "_drop_opaque_Controls", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_new_Controls", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_new_box_autoadd_i64_0", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_new_box_autoadd_metadata_0", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_new_box_autoadd_player_0", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_new_list_media_control_action_0", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_share_opaque_Controls", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_callback_stream__static_method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_dispose__static_method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_get_progress__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_has_preloaded__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_is_playing__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_loop_playback__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_new__static_method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_normalize_volume__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_open__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_pause__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_play__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_play_preload__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_playback_state_stream__static_method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_preload__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_progress_state_stream__static_method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_seek__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_set_metadata__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_set_volume__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
             "_wire_stop__method__Player", referenced from:
                 _$s12simple_audio22SwiftSimpleAudioPluginC5dummys5Int64VyFZ in simple_audio(SwiftSimpleAudioPlugin.o)
           ld: symbol(s) not found for architecture arm64
           clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've confirmed that ios.zip is extracted. This build was performed after running flutter clean.

@Yesterday17
Copy link
Contributor Author

However, It seems that those symbols exist in the bundle:

yesterday17@Mac-mini ios-arm64 % otool -Sv libsimple_audio.a | grep wire
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_callback_stream__static_method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_dispose__static_method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_get_progress__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_has_preloaded__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_is_playing__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_loop_playback__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_new__static_method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_normalize_volume__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_open__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_pause__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_play__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_play_preload__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_playback_state_stream__static_method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_preload__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_progress_state_stream__static_method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_seek__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_set_metadata__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_set_volume__method__Player
simple_audio.simple_audio.a480f9851490759e-cgu.04.rcgu.o _wire_stop__method__Player

I would dig deeper after today's work.

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

Successfully merging a pull request may close this issue.

2 participants