Video not play in Flutter iOS getting error
Unhandled Exception: PlatformException(VideoError, Failed to load video: Operation Stopped, null, null). Working well in android. Please let me know if you have idea of this.
=>Using video_player plugging
=>Code link= https://drive.google.com/file/d/1amGVhtz0CrnG5ocbjWImW79-XYRlXguN/view?usp=sharing
Video=http://143.244.137.15:8000/media/event/org_event_video/None/event_video_4pnqGxk.mp4
=>Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Evento Package</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>evento_package</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<string>0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsForMedia</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>143.244.137.15:8000</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
</dict>
</plist>
On iOS, I found a solution to this problem. The URL needs to be HTTPS, and the app needs to be run on the device instead of the simulator.
I found the solution as below link:
https://github.com/flutter/flutter/issues/56665#issuecomment-1235279217
And I didn't add below things to Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
I hope it can help.
try:
The problem is in the API returning video links, it seems like on iOS it needs a header to specify the range of the bytes to be sent. by adding this header the videos will work as expected.
or
Downgrade your's plugin or flutter/ upgrade your's plugin or flutter
Edit: Add this to your ios/Runner/info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
Edit: Allow unsecure connections
go to your xcode
go to ios/runner/info.plist
on the right side pannel there will be the key, type and value tab
go to information property list/app transport security setting/exception domains/your domain
NSExceptionAllowsInsecureHTTPLoads
allow "yes"
I have the same problem. And the solution was very simple. My video didn't play on my phone. It was not encoded correctly. When I right coded, the problem was solved.
Related
I try to use Snapchat's Login Kit. But it doesn't redirect to my app after authentication.
I used this Login Kit before which is still working now. So I also compared both info.plist which are identical except for "SCSDKClientId", "SCSDKRedirectUrl" and "CFBundleURLSchemes"
Here's my info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>MY_APP_NAME</string>
</array>
</dict>
</array>
<key>SCSDKClientId</key>
<string>MY_SCSDK_CLIENT_ID</string>
<key>SCSDKRedirectUrl</key>
<string>MY_APP_NAME://snap-kit/oauth2</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>itms-apps</string>
<string>snapchat</string>
<string>bitmoji-sdk</string>
</array>
<key>SCSDKScopes</key>
<array>
<string>https://auth.snapchat.com/oauth2/api/user.bitmoji.avatar</string>
</array>
</dict>
</plist>
I make sure that the SCSDKRedirectUrl is the same as the developer portal one
The following function gets called.
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
if SCSDKLoginClient.application(app, open: url, options: options) {return true}
return false
}
But SCSDKLoginClient.application(app, open: url, options: options) returns false all the time.
I'm out of ideas why this happens now. Any thoughts will be appreciated.
Update: I missed the SceneDelegate part for ios13. The solution can be find here: SnapKit fails return to app after logging into Snapchat
I have been struggling with this problem for some time now and I wish that the Snap Kit Documentation would provide more insight on this. Essentially, you may have not set up your URL Schemes. This actually isn't a Snap Chat problem but a p.list problem. You can check if your app allows redirects using safari. Here is the article I read, good luck!
https://kitefaster.com/2016/07/13/how-to-open-ios-app-with-custom-url/
I submitted app to App Store but it was rejected twice because they were unable to install the app on iPhone and iPad. They said the UIRequiredDeviceCapabilities key in the Info.plist is set in such a way that the app will not install on an iPhone and iPad.
They wrote that the next steps are:
To resolve this issue, please check the UIRequiredDeviceCapabilities
key to verify that it contains only the attributes required for your
app features or the attributes that must not be present on the device.
Attributes specified by a dictionary should be set to true if they are
required and false if they must not be present on the device.
After first submit I removed completely UIRequiredDeviceCapabilities key, but they still weren't able to install it.
I don't have iPhone or iPad, I tested app on simulators and it worked normally.
Here is my info.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>3</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiresFullScreen</key>
<false/>
<key>UIStatusBarHidden</key>
<false/>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleDefault</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
Does anyone know how to modify it so that it can be installed on iPhones and iPads?
UIRequiredDeviceCapabilities must be present in your Info.plist, as per the documentation.
In all apps that I have on the App Store, this is what I have:
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
so I'd suggest you try that.
I got an error,
The data couldn’t be read because it isn’t in the correct format.
Now I am making iPhone app by swift.
I added several codes to Info.plist of my app, I deleted these codes.
But when I wanna open Info.plist of my app, this error happen.I do not know why because I deleted all codes which I added.And I think format is really fixed.
My Info.plist is like
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UILaunchStoryboardName</key>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
How can I fix this?
You've duplicated key in the info.plist file, remove the following key in the beginning
<key>UILaunchStoryboardName</key>
and it will resolve the issue.
Try something below:
Right click on Info.plist -> Source Code -> Discard Change
I was Building flutter project , and the problem was missing <string> for key io.flutter.embedded_views_preview adding <string></string> fixed my issue , i didn't update the info.plist though it was as created by flutter , hope this will help someone using flutter
Since upgrading Xcode to v5 and converting launch and app icon images to image asset catalogs, I've been unable to see the Newsstand icon of my app in the Newsstand on iOS 6.1 and iOS 7. Instead I see the regular app icon in its place. I'm still compiling against iOS SDK 6.1 because of obvious style changes in iOS 7 that I haven't been able to test in depth, yet.
That said, here is what I've tried on my Newsstand icon, icon-newsstand.png:
Converting the icon-newsstand.png into an asset catalog located in ./Images.xcassets/icon-newsstand.imageset/icon-newsstand.png.
Keeping icon-newsstand.png in my Resources folder as a part of the project.
Neither of these solutions work. Here is my info.plist for reference also. I've redacted the app names, just FYI.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>---- ----</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIcons</key>
<dict>
<key>UINewsstandIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon-newsstand.png</string>
</array>
<key>UINewsstandBindingEdge</key>
<string>UINewsstandBindingEdgeLeft</string>
<key>UINewsstandBindingType</key>
<string>UINewsstandBindingTypeMagazine</string>
</dict>
</dict>
<key>UIBackgroundModes</key>
<array>
<string>newsstand-content</string>
</array>
<key>UINewsstandApp</key>
<true/>
<key>CFBundleIdentifier</key>
<string>com.----.----</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.1</string>
<key>CFBundleName</key>
<string>---- ----</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.0.1.13830</string> <!-- The Version of the app. -->
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>FB Connect</string>
<key>CFBundleURLSchemes</key>
<array>
<string>fb150871295037449------</string><!-- The app id must be appended to the end of this string. Example: <string>fb150871295037449connections</string> -->
</array>
</dict>
</array>
</dict>
</plist>
Has anyone run into this yet after upgrading Xcode and converting to image asset catalogs? And does anyone have any ideas where to start with changes to my project? So far from my searches, details online and on StackOverflow have been sparse in terms of Newsstand and Xcode 5 issues.
I'd greatly appreciate any help. Thank you!
I found out that the issue was only happening with iPads. Since that discovery, I realized that there was a section missing from my info.plist that looks like this:
<key>CFBundleIcons~ipad</key>
<dict>
<key>UINewsstandIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>icon-newsstand.png</string>
</array>
<key>UINewsstandBindingEdge</key>
<string>UINewsstandBindingEdgeLeft</string>
<key>UINewsstandBindingType</key>
<string>UINewsstandBindingTypeMagazine</string>
</dict>
</dict>
Mystery solved!
When I try to publish my app to the App Store I get an error which says:
This bundle is invalid. An unknown device capability value is supplied
in the UIRequiredDeviceCapabilities key of the Info.plist. Make
certain that the value for UIRequiredDeviceCapabilities is an array or
a dictionary, containing valid values as described in the Information
Property List Key Reference.
Can someone help me to fix this?
Plist looks like this:
http://j.mp/V2B8lk
Plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>AppName</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFiles</key>
<array>
<string>114.png</string>
<string>icon.png</string>
</array>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>114.png</string>
<string>icon.png</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
</dict>
<key>CFBundleIdentifier</key>
<string>company.appname</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<false/>
<key>UIStatusBarTintParameters</key>
<dict>
<key>UINavigationBar</key>
<dict>
<key>Style</key>
<string>UIBarStyleDefault</string>
<key>Translucent</key>
<false/>
</dict>
</dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
The Required device capabilities shouldn't be a Boolean. It's supposed to be an array or a dictionary.
I don't know whether you can fix it in the plist editor. If not, you can open the file in a text editor and change it like this:
<key>UIRequiredDeviceCapabilities</key>
<array></array>
Update
It's probably best to delete the entry Required device capabilities if you don't use it.