All Products
Search
Document Center

ApsaraVideo Live:Demo compilation

Last Updated:May 19, 2025

Push SDK for Flutter is a stream ingest tool developed based on the native Push SDKs for Android and iOS. This topic describes how to use the demo of Push SDK for Flutter.

Demo download

For the demo source code and package of the latest version of the Push SDK, see Download SDK.

Demo compilation

Environment requirements

Item

Requirement

Flutter version

Version 2.5.0 and later, but earlier than 3.0.0.

Recommended: Version 2.8.0.

Dart version

Version 2.12.0 and later, but earlier than 3.0.0.

System version

  • Android 5.0 or later

  • iOS 10.0 or later

CPU architecture

armeabi-v7a or arm64-v8a

Development tool

Android Studio or Visual Studio Code

Procedure

IDE

Android Studio

  1. Open the project.

    In Android Studio, click Open, select the flutter_livepush_plugin project, and open the example directory.

  2. Install dependencies.

    Click the pubspec.yaml file, then click the Pub Get button in the upper-right corner to install dependencies.

  3. Configure the device.

    Make sure an Android device is connected.

  4. Run the application.

    Click the green button Run in the toolbar and select the target device to run the application.

Visual Studio Code

  1. Open the project.

    Launch Visual Studio Code. Select File > Open Folder, select the flutter_livepush_plugin project, and open the example directory.

  2. Install dependencies.

    In the example directory, open the command line and run the following command:

    flutter pub get

  3. Configure the device.

    Make sure an Android or iOS device is connected. Use the device selector in the bottom left corner to select the target device.

  4. Run the application.

    Press F5 or click the Run and Debug icon in the left-side activity bar, select the Flutter configuration, and start the debugging session.

Xcode (iOS)

  1. Open the project.

    Click the flutter_livepush_plugin project and open the ios directory under the example directory.

  2. Install CocoaPods dependencies.

    Open the command line in the ios directory and run the following command:

    pod install

  3. Configure signing.

    In Xcode, select the Runner project, click the Signing & Capabilities tab, and configure a valid developer account and signing certificate.

  4. Run the application.

    Click the icon ▶️ in the Xcode toolbar and select the target device.

Command line

Go to flutter_livepush_plugin > example and open the command line.

  1. Install dependencies.

    flutter pub get

  2. Compile the project.

    Android

    Important

    Before compiling, make sure Android SDK and Gradle are installed.

    • Execute the following command to run the program:

      # Run debug version
      flutter run --debug
      # Run release version
      flutter run --release

    • Execute the following command to package the APK file.

      flutter build apk
      Note

      The APK file is located at build/app/outputs/flutter-apk/app-release.apk.

    iOS

    Important

    Before compiling, make sure Xcode and CocoaPods are installed.

    Initialize CocoaPods dependencies.

    cd ios && pod install && cd ..
    • Execute the following command to run the program:

      # Run debug version
      flutter run --debug
      # Run release version
      flutter run --release

    • Execute the following command to package the IPA file:

      flutter build ipa
      Note

      The IPA file is located at build/ios/ipa/Runner.ipa.

FAQ

Compilation issue: error running pod install

For Dart 3.0 and above versions, the following error may occur when running pod install:

[!] CocoaPods could not find compatible versions for pod "Flutter":
In Podfile:
Flutter (from `Flutter`)
url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) was resolved to 0.0.1, which depends on
Flutter
Specs satisfying the `Flutter (from `Flutter`), Flutter` dependency were found, but they required a higher minimum deployment target.

Solution: Open the Podfile in the example directory and modify the value of platform :ios, '' to 12.0.

Compilation issue: CocoaPods and profile environment inconsistency

If you encounter the error message "The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation", perform the following steps to resolve the issue:

  1. Delete the Pods folder.

  2. Delete Podfile.lock.

  3. Execute pod install--repo-update.

  4. Launch Xcode again and open your project.

Compilation issue: Launcher file error

If you encounter the error message "Type 'UIApplication' does not conform to protocol 'Launcher'", it may be due to a mismatch or missing implementation for the protocol Launcher.

image.png

Solution: Modify the code as follows.

/// Launcher is intentionally a direct passthrough to UIApplication.
extension UIApplication: Launcher {
    func open(_ url: URL, options: [OpenExternalURLOptionsKey : Any], completionHandler completion: ((Bool) -> Void)?) {
        self.open(url, options: options, completionHandler: completion)
        }
}

Other compilation issues

Check whether your Flutter version meets the environment requirements.

How do I obtain an ingest URL?

To obtain an ingest URL, see Generate ingest and streaming URLs.

Why did I fail to ingest a stream using the demo?

Use the troubleshooting tool to check if the ingest URL is valid.

How do I obtain information about ingested audio and video streams?

Go to Stream Management in the console and click Active Streams to view and manage the ingested audio and video streams.

How do I play a stream?

After starting stream ingest, you can use a player, such as ApsaraVideo Player, FFplay, and VLC, to test stream pulling. To obtain a streaming URL, see Generate ingest and streaming URLs.