Compilation works.
Using 5.1.0 with permissions for photos and camera.
I get the following errors:
** ARCHIVE FAILED **
The following build commands failed:
SwiftCodeGeneration normal armv7k
SwiftCodeGeneration normal arm64_32
SwiftCodeGeneration normal arm64
CompileC /Users/**/permission_handler.build/Objects-normal/armv7/PermissionManager.o /Users/jkoch/development/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0/ios/Classes/PermissionManager.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(4 failures)
[...]
❌ /Users/**/development/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0/ios/Classes/PermissionManager.m:105:53: no visible @interface for 'PhotoPermissionStrategy' declares the selector 'initWithAccessAddOnly:'
return [[PhotoPermissionStrategy alloc] initWithAccessAddOnly:false];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
❌ /Users/**/development/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0/ios/Classes/PermissionManager.m:107:53: no visible @interface for 'PhotoPermissionStrategy' declares the selector 'initWithAccessAddOnly:'
return [[PhotoPermissionStrategy alloc] initWithAccessAddOnly:true];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
Version: 5.1.0
Platform:
@igoriuz I think this is a caching issue, could you please try deleting all permission_handler packages from your flutter cache?
Something like this (note to replace the ** with your username:
rm -rf /Users/**/development/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler*
After that try running the following commands:
# Download all packages and dependencies
flutter pub get
# Make sure all previous builds are deleted and we start with a fresh environment
flutter clean
Let me know if this helps.
Thank you for your fast reply. It still not working after clearing flutters cache.
Running "flutter pub get" in coqon...
Launching lib/main_dev.dart on iPhone SE (2nd generation) in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 18,3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/**/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+1/ios/Classes/PermissionManager.m:105:53: error: no visible @interface for 'PhotoPermissionStrategy' declares the selector 'initWithAccessAddOnly:'
return [[PhotoPermissionStrategy alloc] initWithAccessAddOnly:false];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
/Users/**/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+1/ios/Classes/PermissionManager.m:107:53: error: no visible @interface for 'PhotoPermissionStrategy' declares the selector 'initWithAccessAddOnly:'
return [[PhotoPermissionStrategy alloc] initWithAccessAddOnly:true];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
2 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone SE (2nd generation).
aaa I see what is going on, probably you have the 'PERMISSION_PHOTOS=0' in your ios/Podfile which instructs the compiler to remove the implementation of the PhotoPermissionStrategy and thus also the initWithAccessAddOnly method.
I will fix this shortly in with a hotfix (going to be version 5.1.0+2), in the meantime you can comment out this value in your ios/Podfile (or set the value to 1: 'PERMISSION_PHOTOS=1'). This will at least allow you to your code and continue development.
Your solutions works. Thank you! I would let that issue open so others can see it too. Feel free to close it, once a hotfix is released.
Hi @igoriuz, I have just release version 5.1.0+2 which has a proper fix for this problem.
Please upgrade to this version and undo the workaround change if you are not using the photo permissions in your app (otherwise you might receive a rejection when uploading your app to the Apple AppStore).
I will close this issue now, if you run into problems please don't hesitate to leave a comment here.
Most helpful comment
Hi @igoriuz, I have just release version 5.1.0+2 which has a proper fix for this problem.
Please upgrade to this version and undo the workaround change if you are not using the photo permissions in your app (otherwise you might receive a rejection when uploading your app to the Apple AppStore).
I will close this issue now, if you run into problems please don't hesitate to leave a comment here.