skip to Main Content
App Transport Security exception http://54.234.189.148:4000 is not a valid CIDR notation. ERR | dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character 'G' around line 1, column 1." UserInfo={NSJSONSerializationErrorIndex=0, NSDebugDescription=Unexpected character 'G' around line 1, column 1.}))) ERR | The data couldn’t be read because it isn’t in the correct format. ERR | dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character 'G' around line 1, column 1." UserInfo={NSJSONSerializationErrorIndex=0, NSDebugDescription=Unexpected character 'G' around line 1, column 1.}))) ERR | The data couldn’t be read because it isn’t in the correct format. ERR | dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character 'G' around line 1, column 1." UserInfo={NSJSONSerializationErrorIndex=0, NSDebugDescription=Unexpected character 'G' around line 1, column 1.}))) ERR | The data couldn’t be read because it isn’t in the correct format.

this is my base url which i am using : {{http://54.234.189.148:4000}}/v1/songs

this is my Appdelegate.swift file:

import UIKit import Flutter import video_editor_sdk import ImglyKit

@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool {

    applySoundstripe()


    GeneratedPluginRegistrant.register(with: self)


    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

// Define the function to apply Soundstripe integration
func applySoundstripe() {
    let soundstripeProvider = SoundstripeAudioProvider(baseURL: "http://54.234.189.148:4000")
    let soundstripeCategory = SoundstripeAudioClipCategory(provider: soundstripeProvider)

    FlutterVESDK.configureWithBuilder = { builder in
        let assetCatalog = AssetCatalog.defaultItems
        assetCatalog.audioClips.append(soundstripeCategory)
        builder.assetCatalog = assetCatalog
    }
}

2

Answers


  1. Buddy Try it Out

    Open your Info.plist file.
    Add the following configuration:

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    

    and here is an other error while you are decoding your json response please as well

    Login or Signup to reply.
  2. The server response from "http://54.234.189.148:4000&quot; does not contain valid JSON, which may be due to an issue with the server or the URL used in the SoundstripeAudioProvider.

    Try this

    func applySoundstripe() {
        guard let url = URL(string: "http://54.234.189.148:4000") else {
            print("Invalid URL")
            return
        }
        
        let soundstripeProvider = SoundstripeAudioProvider(baseURL: url)
        let soundstripeCategory = SoundstripeAudioClipCategory(provider: soundstripeProvider)
    
        FlutterVESDK.configureWithBuilder = { builder in
            let assetCatalog = AssetCatalog.defaultItems
            assetCatalog.audioClips.append(soundstripeCategory)
            builder.assetCatalog = assetCatalog
        }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search