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

AudioplayersPlugin.h file not found #272

Closed
rabihmb opened this issue Sep 6, 2019 · 28 comments
Closed

AudioplayersPlugin.h file not found #272

rabihmb opened this issue Sep 6, 2019 · 28 comments

Comments

@rabihmb
Copy link

rabihmb commented Sep 6, 2019

Hello, I'm writing here after checking the following old issues & sorry for the duplicates #237 #80 #101 #92

Still can't generate an archive for iOs. When I launch Archive, it stops with the following error: ../ios/Runner/GeneratedPluginRegistrant.m:6:9: 'audioplayers/AudioplayersPlugin.h' file not found

//
//  Generated file. Do not edit.
//

#import "GeneratedPluginRegistrant.h"
#import <audioplayers/AudioplayersPlugin.h>
#import <connectivity/ConnectivityPlugin.h>
#import <flutter_webview_plugin/FlutterWebviewPlugin.h>
#import <onesignal_flutter/OneSignalPlugin.h>
#import <path_provider/PathProviderPlugin.h>
#import <share/SharePlugin.h>
#import <shared_preferences/SharedPreferencesPlugin.h>
#import <url_launcher/UrlLauncherPlugin.h>
#import <video_player/VideoPlayerPlugin.h>
#import <ytview/WebViewFlutterPlugin.h>

@implementation GeneratedPluginRegistrant

+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
  [AudioplayersPlugin registerWithRegistrar:[registry registrarForPlugin:@"AudioplayersPlugin"]];
  [FLTConnectivityPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTConnectivityPlugin"]];
  [FlutterWebviewPlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterWebviewPlugin"]];
  [OneSignalPlugin registerWithRegistrar:[registry registrarForPlugin:@"OneSignalPlugin"]];
  [FLTPathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTPathProviderPlugin"]];
  [FLTSharePlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTSharePlugin"]];
  [FLTSharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTSharedPreferencesPlugin"]];
  [FLTUrlLauncherPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTUrlLauncherPlugin"]];
  [FLTVideoPlayerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTVideoPlayerPlugin"]];
  [FLTWebViewFlutterPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTWebViewFlutterPlugin"]];
}

@end
flutter doctor -v
[✓] Flutter (Channel master, v1.9.8-pre.108, on Mac OS X 10.14.6 18G87, locale en-LB)
    • Flutter version 1.9.8-pre.108 at /Users/macbook/flutter
    • Framework revision 95168fcc03 (17 hours ago), 2019-09-06 00:05:40 -0400
    • Engine revision f4d930581c
    • Dart version 2.5.0 (build 2.5.0-dev.4.0 be66176534)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/macbook/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.3, Build version 10G8
    • CocoaPods version 1.7.5

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 39.0.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

Note that I'm using the audioplayers: ^0.13.1 in pubspec.yaml. So is recommended to clone the master branch in github and then force the package to use it audioplayers: path: ../ or it doesn't matter?

Any Idea please would be appreciated.

@GaboBrandX
Copy link

Having the same issue, same package version.

@rabihmb
Copy link
Author

rabihmb commented Sep 11, 2019

@GaboBrandX can you share your Podfile inside ios folder

@erickzanardo
Copy link
Member

This is not a problem with audiplayers, this is something that I see happening a lot when you are using a swift plugin and your flutter projects uses objective-c, or the plugin is objective-c and your project is in swift. I am not an iOS expert, but here is some things that seems to work for:

  • Open your project on xcode and set the legacy build system
  • Open your project on xcode, creates a swift file on your project, any name will do, xcode will ask if you want to create a bridging file, hit yes, you can now delete the swift file.

@GaboBrandX
Copy link

GaboBrandX commented Sep 11, 2019

Hi, the solution for me was to open the xcworkspace file with Xcode, instead of the xcodeproj. After that I've archived with no problems.

Maybe someone could enlighten us telling why did that work?
Thanks for your support!

@rabihmb
Copy link
Author

rabihmb commented Sep 11, 2019

@GaboBrandX that is why I requested to provide the file, I want to check it if empty or missed some information, to advise you how to do.

@GaboBrandX
Copy link

GaboBrandX commented Sep 11, 2019

@rabihmb I see, sorry.. I've made it work an hour after my previous post. Anyway, I've made a pod reinstallation before and didn't work. What I've made was:

pod repo remove master
pod setup
pod install

Also I've checked my iOS version and that audioplayers was present on the Podfile.

(It is clear it isn't an issue with audioplayers plugin, but I'm very new to iOS and would like to know why these things happen)

@rabihmb
Copy link
Author

rabihmb commented Sep 11, 2019 via email

@GaboBrandX
Copy link

@rabihmb Here you have:
pods.zip

@erickzanardo
Copy link
Member

Any of the advices here has solved your issue?

@therealjohnsummer
Copy link

Have the same issue but the issue only occurs if I try and deploy to a physical device (iOS device). If I run in simulator there isnt any issue and the plugin functions correctly.

Using plugin version 0.13.2. Flutter version 1.9.1+HF 4

@sallymariehollywood
Copy link

I have the same issue here. Tried everything mentioned here. My project is not swift but Objective C. Is there any workaround for this ?

@Igalsr
Copy link

Igalsr commented Oct 15, 2019

Hi guys any solution for Flutter?

@erickzanardo , Have you found a solution?

@ssbaval
Copy link

ssbaval commented Oct 19, 2019

Can now build. I am on iOS 13.1.2 and Flutter 1.9.1.HF 5. The issue was AudioPlayers 0.13.2 Downgrading to 13.1 I was able to build and deploy to simulator and live device.

Note - I upgraded from 0.12.1 Which doesnt have ANY ISSUE whatsoever. Something must have changed with respect to 13.2. Furthermore, I found that Flutter_Twitter_Login and Audio_Players Clashed with AudioPlayers 13.2 version

@JiweiMaster
Copy link

anyone have idea how to solve the lost of AudioPlaysPlugin.file or other better audio pub

@chatpongs
Copy link

I faced the same problem. In my case, it seemed pub's cache was corrupted. Running pub cache repair fixed the issue

@vadymhimself
Copy link

Nothing of the above worked for me

@therealjohnsummer
Copy link

Not working at all for me - a pity as this seemed like a good plugin but I dont think there is any support for Catalina, Flutter 1.9.1 hotfix 6 and Obj C project so dont waste your time trying to fix if you have this enviroment - I've wasted months trying to get this to work.

Is there anything better out there that is regularly supported as it seems the author of this plugin has sadly abandoned this project or not interested in fixing this particular issue.

@vadymhimself
Copy link

vadymhimself commented Nov 17, 2019

Regenerating the Podfile for the ios project solved the issue for me

@erickzanardo
Copy link
Member

Not working at all for me - a pity as this seemed like a good plugin but I dont think there is any support for Catalina, Flutter 1.9.1 hotfix 6 and Obj C project so dont waste your time trying to fix if you have this enviroment - I've wasted months trying to get this to work.

Is there anything better out there that is regularly supported as it seems the author of this plugin has sadly abandoned this project or not interested in fixing this particular issue.

We don’t think this problem just happens on that flutter version, or even on Catalina, we have reports from it since forever.

All the things that I tried to do to fix this, which I commented on this issue, pointed to that this is not a problem with audioplayers itself, but with the project setup using the package, but neither me or @luanpotter have strong iOS development background so we haven’t gave up on this problem, it just don’t look there is much we can do.

Of course, if an awesome member of the community with advanced iOS knowledge could help us here, we would be very grateful.

@TobyTong
Copy link

TobyTong commented Dec 2, 2019

Hi, the solution for me was to open the xcworkspace file with Xcode, instead of the xcodeproj. After that I've archived with no problems.

Maybe someone could enlighten us telling why did that work?
Thanks for your support!

Thank you very much for helping me to Solve the problem,I've tried all the ways I can find.

@siloebb
Copy link

siloebb commented Dec 2, 2019

For me work when in "Build Settings" I change the "iOS Deployment Target" to 11.0.
Looks like the audio players use tools to version >10.0

@luanpotter
Copy link
Member

I did not abandon this project at all, we are constantly trying to merge all the PRs from the community at the same time keeping the code clean and bug free. I have lots of repos and not a lot of time, so @erickzanardo is kindly helping me to organize this repo.

I however use linux and also it's very hard to reproduce this problem as it 99% of the time works fine. This seems to be more a bug with flutter itself, and anytime I had similar issues a a clean install from flutter always solved my problem.

I would really appreciated if someone with a macos would find a cause and provide us with a PR. We will definitely take a look! Or maybe someone from the flutter team can help us out.

My only hunch would be to convert all the archaic ObjC code to swift, which might or might not fix this issue. I will try to sync with Erick to get that done at some point.

@smocken78
Copy link

I encounterd a similar problem after increasing iOS platform from 8.0 to 11.0 in my Podfile.

I was able to fix the problem by opening the project in XCode and increasing the target version to 11.0 as well.

@JiweiMaster
Copy link

good news, I resolve this problem by deleting the ios file and execute 'flutter create -i objc .',if still failed,youcan use the pub: audioplayer: ^0.5.2

@luanpotter
Copy link
Member

@JiweiMaster did you do this on your app or on the audioplayers code? is there something we can fix on the audioplayers side? could you please help our with a PR?

@rafa-js
Copy link

rafa-js commented Dec 25, 2019

This solved my issue: flutter/flutter#41033 (comment)

For some reason, doing Open in XCode from VSCode opened Runner.xcodeproj instead of Runner.xcworkspace. I assumed it was right because it always worked properly.

@luanpotter
Copy link
Member

I finally was able to obliterate all the obj-c code and migrate 100% to swift, so this interop stuff is no longer an issue -- check the 0.17.0 version.

@zhapparkulov
Copy link

solution for m1 processors (2021-2022)
I opened the ios folder in the terminal in flutter project and wrote

#1 Install ffi
sudo arch -x86_64 gem install ffi

#2 Re-install dependencies
arch -x86_64 pod install

after this run the project

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