Comments (4)
Device: iPhone Xs (16.6.1) image_pickers: ^2.0.4+3
I'm getting NSInvalidArgumentException when retrieving some media (not a clear pattern here) in iOS devices
I have this simple function on my repo
Future<Either<Failure, List<dynamic>>> performGetObjectListFromDevice() async { try { log.fine( 'MediaService called for retrieval of media objects from device'); final List<dynamic> objectsList = await mediaServices.getObjectsListFromDevice(); log.fine( 'MediaService Successfully retrieved ${objectsList.length} media objects from device'); return Right(objectsList); } on MediaServiceException catch (e) { log.warning('MediaServiceException encountered: ${e.message}'); return const Left(ServerFailure( message: "Couldn't retrieve list of media from device")); } }
Which calls
@override Future<List<dynamic>> getObjectsListFromDevice() async { List<imagePickers.Media> listVideoPaths = []; try { listVideoPaths = await imagePickers.ImagePickers.pickerPaths( galleryMode: imagePickers.GalleryMode.all, videoSelectMaxSecond: 1200, videoRecordMaxSecond: 1200, selectCount: 10, ); } on Exception catch (e) { log.severe( 'imagePickers library failed to return pickersPath\n--imagePickers: $e'); rethrow; } return listVideoPaths; }
As you can see in the log below, execution brakes when calling
ImagePickers.pickerPaths()
== LOG ==
flutter: [MemoriesRepositoryImpl] FINE: 2023-10-14 13:54:57.349108: MediaService called for retrieval of media objects from device *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter' *** First throw call stack: (0x197380cb4 0x1904203d0 0x19165f8c0 0x19165f63c 0x1012add0c 0x1012ad2c8 0x1ac3f5f60 0x19e856fc4 0x19e847eac 0x19e84b330 0x19e84a998 0x19e859944 0x19e85a158 0x1f71b5da0 0x1f71b5b7c) libc++abi: terminating due to uncaught exception of type NSException * thread #43, queue = 'com.apple.photos.requestAVAsset', stop reason = signal SIGABRT frame #0: 0x00000001d633d578 libsystem_kernel.dylib`__pthread_kill + 8 libsystem_kernel.dylib`: -> 0x1d633d578 <+8>: b.lo 0x1d633d598 ; <+40> 0x1d633d57c <+12>: pacibsp 0x1d633d580 <+16>: stp x29, x30, [sp, #-0x10]! 0x1d633d584 <+20>: mov x29, sp Target 0: (Runner) stopped. Lost connection to device.
此问题,新的版本已更新,请更新一下代码,具体请见2.0.4+5
from image_pickers.
FYI: After calling ImagePickers.pickerPaths() but before selection is confirmed (done is clicked) I get the following message in the debug console
flutter: [GetObjectsListFromDeviceUseCase] FINE: 2023-10-14 14:33:38.422599: MemoriesRepository performGetObjectListFromDevice call with no Params
flutter: [MemoriesRepositoryImpl] FINE: 2023-10-14 14:33:38.423265: MediaService called for retrieval of media objects from device
[core] "Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)""
[PAAccessLogger] Failed to log access with error: access=<PATCCAccess 0x2817728a0> accessor:<<PAApplication 0x28174cd20 identifierType:auditToken identifier:{pid:4872, version:13663}>> identifier:A64DED7B-B144-4D1E-9941-B3E021FBF668 kind:intervalEvent timestampAdjustment:0 visibilityState:0 assetIdentifierCount:0 tccService:kTCCServicePhotos, error=Error Domain=NSCocoaErrorDomain Code=4097 "connection to service with pid 3358 named com.apple.privacyaccountingd" UserInfo={NSDebugDescription=connection to service with pid 3358 named com.apple.privacyaccountingd}
As per the instructions, my plist is set as
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>Needed for you to create videos and photo memories</string>
<key>NSMicrophoneUsageDescription</key>
<string>Needed for you to add sound to your videos memories</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Needed for you to upload your media</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Needed for you to record new media</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
from image_pickers.
you can also add permissions
PHPhotoLibraryPreventAutomaticLimitedAccessAlert
although this is not the solution to the problem
[PAAccessLogger] Failed to log access with error: access=<PATCCAccess 0x2817728a0>
or You can ignore this issue.
This warning will not affect the normal operation of your program
FYI: After calling ImagePickers.pickerPaths() but before selection is confirmed (done is clicked) I get the following message in the debug console
flutter: [GetObjectsListFromDeviceUseCase] FINE: 2023-10-14 14:33:38.422599: MemoriesRepository performGetObjectListFromDevice call with no Params flutter: [MemoriesRepositoryImpl] FINE: 2023-10-14 14:33:38.423265: MediaService called for retrieval of media objects from device [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)"" [PAAccessLogger] Failed to log access with error: access=<PATCCAccess 0x2817728a0> accessor:<<PAApplication 0x28174cd20 identifierType:auditToken identifier:{pid:4872, version:13663}>> identifier:A64DED7B-B144-4D1E-9941-B3E021FBF668 kind:intervalEvent timestampAdjustment:0 visibilityState:0 assetIdentifierCount:0 tccService:kTCCServicePhotos, error=Error Domain=NSCocoaErrorDomain Code=4097 "connection to service with pid 3358 named com.apple.privacyaccountingd" UserInfo={NSDebugDescription=connection to service with pid 3358 named com.apple.privacyaccountingd}
As per the instructions, my plist is set as
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> <key>NSCameraUsageDescription</key> <string>Needed for you to create videos and photo memories</string> <key>NSMicrophoneUsageDescription</key> <string>Needed for you to add sound to your videos memories</string> <key>NSPhotoLibraryUsageDescription</key> <string>Needed for you to upload your media</string> <key>NSPhotoLibraryAddUsageDescription</key> <string>Needed for you to record new media</string> <key>UIApplicationSupportsIndirectInputEvents</key> <true/>
you can also add permissions
PHPhotoLibraryPreventAutomaticLimitedAccessAlert
although this is not the solution to the problem
[PAAccessLogger] Failed to log access with error: access=<PATCCAccess 0x2817728a0>
or You can ignore this issue.
This warning will not affect the normal operation of your program
from image_pickers.
First of all, congrats on you guys fro the super fast response on those issues.
While release ^2.0.4+5 solved the crashing issue it generated a new one.
Now I'm facing several timeouts when selecting images. Unfortunately, I couldn't find a clear pattern to share with you guys. I had time out alerts while selecting one single image in the same compass that I have succeeded selecting some videos (up to 30secs).
FYI (1): In case it help, the progress indicator changed. It used to a progress indicator per selected tile and now is a generic one for the whole screen. And it's triggered not by individual selections but by clicking "done".
FYI (2): I had to pod update ZLPhotoBrowser
so the code could compile
from image_pickers.
Related Issues (20)
- videoSelectMaxSecond parameter won't be overridden when using GalleryMode.all HOT 1
- jcenter has been closed but it is used
- 图片稍微大一点,来回多点几次之后会一直转圈圈
- There is an issue with aligning when selecting multiple images. HOT 1
- Android选择图片闪退,必现 HOT 6
- 保存图片失败 HOT 21
- Semantic Issue (Xcode): Property 'timeout' not found on object of type 'ZLPhotoConfiguration *' /Users/anmolgupta/.pub-cache/hosted/pub.dev/image_pickers-2.0.4+6/ios/Classes/ImagePickersPlugin.m:181:22 HOT 5
- IOS保存图片没反应 HOT 7
- 当手机断网但是选中icloud图片的时候会一直转圈「正在处理」
- 如果 你遇到 You need to use a Theme.AppCompat theme,请尝试 HOT 1
- Fatal Exception: java.lang.RuntimeException,In the firebase crash, the device information is Google Pixel 7 Pro Android 14 HOT 1
- It would be nice if I leaked out how to compress the picture HOT 2
- 插件冲突 HOT 10
- ios pod 最低版本和其它插件冲突
- GalleryMode.image 里面没有过滤掉视频
- 有没有对targetSdkVersion 30进行适配的版本。
- 引入再删除插件后ios构建失败了
- 安卓13,进入相册之后,不选择图片直接点击返回键,无法正常退出 HOT 2
- 从相机退出之后,app内所有页面都不能播放声音
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image_pickers.