0

I am new. I am building my first app but there is a difficult error. I created an animation and want to use it like a button. Tap on it and the animation starts. I try to use rive but can not run the app when importing rive.dart

this is my code:

import 'dart:ffi';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:rive/rive.dart';

class HomeScreen extends StatefulWidget {
  const HomeScreen({Key? key}) : super(key: key);

  @override
  State createState() => _Home();
}

class _Home extends State {
  String bamboo_tube_animation = 'assets/animations/OngQue.svg';

  @override
  Widget build(BuildContext context) {
    double device_width = MediaQuery.of(context).size.width;
    double device_height = MediaQuery.of(context).size.height;
    double bamboo_button_size = device_width * 0.9;
    double icon_size = 60;

    return Container(
      child: Column(
        mainAxisSize: MainAxisSize.max,
        mainAxisAlignment: MainAxisAlignment.end,
        children: [
          RiveAnimation.asset(bamboo_tube_animation);
          Container(
            height: 20,
          ),
        ],
      ),
    );
  }
}

I add rive to pubspec.yaml

dependencies:
  flutter:
    sdk: flutter

  flutter_svg: ^1.1.6
  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  
  cupertino_icons: ^1.0.2
  flare_flutter: ^3.0.2
  rive: ^0.10.1

And this is debug console:

Launching lib/main.dart on iPhone 13 Pro Max in debug mode...
Xcode build done.                                            6.7s
Failed to build iOS app
Error output from Xcode build:
↳
    2023-01-26 21:51:46.183 xcodebuild[26922:202491] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    2023-01-26 21:51:46.184 xcodebuild[26922:202491] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
     BUILD FAILED 
Xcode's output:
↳
    Writing result bundle at path:
     /var/folders/3w/nscscyx1109ckdn_r__40g7m0000gn/T/flutter_tools.XO1RoC/flutter_ios_build_temp_dirvZKZ6S/temporary_xcresult_bundle
: Error: Type 'Uint8List' not found.
      Future<void> decode(Uint8List bytes) {
                          ^^^^^^^^^
: Error: 'Uint8List' isn't a type.
      Future<void> decode(Uint8List bytes) {
                          ^^^^^^^^^
    Failed to package /Users/manh.do/Documents/flutter_example/angicungduoc/angicungduoc.
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order
    Result bundle written to path:
     /var/folders/3w/nscscyx1109ckdn_r__40g7m0000gn/T/flutter_tools.XO1RoC/flutter_ios_build_temp_dirvZKZ6S/temporary_xcresult_bundle
Could not build the application for the simulator.
Error launching application on iPhone 13 Pro Max.
Exited

Any idea? I just start my app, but it's hard to resolve this error

ManDo
  • 1
  • 1

0 Answers0