flutter跑通腾讯云直播Demo

运行示例

前提条件

要求java jdk 11版本 并且配置到了环境变量 重要

要求flutter 版本 2.8.0 并且配置到了环境变量 重要

要求dart-sdk版本2.15 并且配置到了环境变量 重要

您已 注册腾讯云 账号,并完成 实名认证。

申请 SDKAPPID 和 SECRETKEY

  1. 登录实时音视频控制台,选择【开发辅助】>【快速跑通Demo】。
  2. 单击【立即开始】,输入您的应用名称,例如TestTRTC,单击【创建应用】。

环境要求:

运行出问题

  • Launching lib\main.dart on V2164A in debug mode... Running Gradle task 'assembleDebug'... Warning: The plugin path_provider_android requires Android SDK version 33. For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. Warning: The plugin shared_preferences_android requires Android SDK version 33. For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. Warning: The plugin url_launcher_android requires Android SDK version 33. For more information about build configuration, see https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. One or more plugins require a higher Android SDK version. Fix this issue by adding the following to C:\Users\Administrator\Desktop\ceshi\android\app\build.gradle: android { compileSdkVersion 33 ... } Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. > Failed to find Build Tools revision 29.0.2 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 12s Exception: Gradle task assembleDebug failed with exit code 1 
  • 怎么回事

  • 这个错误通常是由于Flutter项目中的某些插件需要更高版本的Android SDK,而你的项目当前使用的Android SDK版本不符合要求所致。具体来说,错误信息中提到了需要 Android SDK 版本 33,而你当前的项目使用的版本较低。

    要解决这个问题,你需要更新你的 Android 项目的编译 SDK 版本到 33。你可以按照错误信息中提供的建议,在你的项目的 android/app/build.gradle 文件中添加以下内容:

     
  • android {compileSdkVersion 33...
    }
    

    然后重新运行你的Flutter项目,应该就能够成功构建了。

  • 问题



    Warning: This version only understands SDK XML versions up to 2 but an SDK XML file of version 3 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times. Warning: �����Ԫ�� (uri:"", local:"base-extension")������Ԫ��Ϊ<{}codename>,<{}layoutlib>,<{}api-level> FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. > Failed to find Build Tools revision 30.0.2 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 2m 41s Exception: Gradle task assembleDebug failed with exit code 1




    怎么回事

  • 这个错误提示表明你的项目中使用了一个不兼容的 Android SDK 版本。具体来说,错误信息中提到了需要 Build Tools 版本 30.0.2,但是你的环境中没有找到这个版本的构建工具。

    要解决这个问题,你可以按照以下步骤操作:

    1. 打开 Android Studio,然后点击顶部菜单中的 “Tools” -> "SDK Manager"。
    2. 在 “SDK Platforms” 标签下,确保你已经安装了 Android 11.0(API level 30)的 SDK。
    3. 在 “SDK Tools” 标签下,确保你已经安装了 “Android SDK Build-Tools” 版本 30.0.2。
    4. 如果没有找到相应的版本,点击相应的复选框进行安装。
    5. 安装完成后,重新构建你的项目,应该就可以成功了。

    如果你无法在 Android Studio 中找到所需的版本,你也可以手动下载并安装相应的 SDK 和构建工具。安装完成后,确保在你的项目中正确配置了使用这个版本的 SDK 和构建工具。

    一旦你的环境中安装了所需的 SDK 和构建工具,重新运行你的 Flutter 项目,应该就能够成功构建了。

  • FAILURE: Build failed with an exception.

    * What went wrong:
    Could not determine the dependencies of task ':permission_handler:compileDebugAidl'.
    > Failed to find Platform SDK with path: platforms;android-29

    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 5s
    Exception: Gradle task assembleDebug failed with exit code 1

    什么原因

  • 这个错误提示表明在编译 permission_handler 这个库时,Gradle 找不到指定路径下的 Android 平台 SDK,路径为 platforms;android-29

    要解决这个问题,你可以尝试以下步骤:

    1. 确保你的项目中包含了 Android 平台 SDK 版本为 29 的文件。你可以通过打开 Android Studio,然后点击顶部菜单中的 “Tools” -> "SDK Manager",在 “SDK Platforms” 标签下确认是否安装了 Android 10.0(API level 29)的 SDK。

    2. 如果没有安装,你可以在 SDK Manager 中选择相应的 SDK 版本进行安装。

    3. 如果你已经安装了对应的 SDK,但仍然出现这个错误,可能是 Gradle 配置有误。你可以检查你的 android/build.gradle 文件,确保 compileSdkVersiontargetSdkVersion 版本设置正确,指向了正确的 SDK 版本。

    4. 最后,如果以上步骤都没有解决问题,你可以尝试清理 Gradle 缓存并重新构建项目。可以通过在终端中运行以下命令来清理 Gradle 缓存:

       
    1. flutter clean
      

      然后重新运行你的 Flutter 项目。

    通过这些步骤,应该能够解决你遇到的问题。

  • FAILURE: Build failed with an exception.* What went wrong:
    Could not determine the dependencies of task ':tencent_trtc_cloud:compileDebugAidl'.
    > Failed to find Platform SDK with path: platforms;android-28* Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 5s
  • 这个错误提示表明在编译 tencent_trtc_cloud 这个库时,Gradle 找不到指定路径下的 Android 平台 SDK,路径为 platforms;android-28

    要解决这个问题,你可以尝试以下步骤:

    1. 确保你的项目中包含了 Android 平台 SDK 版本为 28 的文件。你可以通过打开 Android Studio,然后点击顶部菜单中的 “Tools” -> "SDK Manager",在 “SDK Platforms” 标签下确认是否安装了 Android 9.0(API level 28)的 SDK。

    2. 如果没有安装,你可以在 SDK Manager 中选择相应的 SDK 版本进行安装。

    3. 如果你已经安装了对应的 SDK,但仍然出现这个错误,可能是 Gradle 配置有误。你可以检查你的 android/build.gradle 文件,确保 compileSdkVersiontargetSdkVersion 版本设置正确,指向了正确的 SDK 版本。

    4. 最后,如果以上步骤都没有解决问题,你可以尝试清理 Gradle 缓存并重新构建项目。可以通过在终端中运行以下命令来清理 Gradle 缓存:

       
    1. flutter clean
      

      然后重新运行你的 Flutter 项目。

    通过这些步骤,应该能够解决你遇到的问题。

  • /D:/flutter_windows_2.8.0-stable/.pub-cache/hosted/pub.flutter-io.cn/tencent_trtc_cloud-2.7.7/lib/trtc_cloud_listener.dart:661:25: Error: The getter 'Uint8List' isn't defined for the class 'TRTCAudioFrameListenerPlatformMethod'.- 'TRTCAudioFrameListenerPlatformMethod' is from 'package:tencent_trtc_cloud/trtc_cloud_listener.dart' ('/D:/flutter_windows_2.8.0-stable/.pub-cache/hosted/pub.flutter-io.cn/tencent_trtc_cloud-2.7.7/lib/trtc_cloud_listener.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'Uint8List'.audioFrame.data = Uint8List.fromList(List<int>.from(params['data']));^^^^^^^^^
    /D:/flutter_windows_2.8.0-stable/.pub-cache/hosted/pub.flutter-io.cn/tencent_trtc_cloud-2.7.7/lib/trtc_cloud_listener.dart:677:30: Error: The getter 'Uint8List' isn't defined for the class 'TRTCAudioFrameListenerPlatformMethod'.- 'TRTCAudioFrameListenerPlatformMethod' is from 'package:tencent_trtc_cloud/trtc_cloud_listener.dart' ('/D:/flutter_windows_2.8.0-stable/.pub-cache/hosted/pub.flutter-io.cn/tencent_trtc_cloud-2.7.7/lib/trtc_cloud_listener.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'Uint8List'.audioFrame.extraData = Uint8List.fromList(List<int>.from(params['extraData']));^^^^^^^^^FAILURE: Build failed with an exception.* Where:
    Script 'D:\flutter_windows_2.8.0-stable\packages\flutter_tools\gradle\flutter.gradle' line: 1070* What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.
    > Process 'command 'D:\flutter_windows_2.8.0-stable\bin\flutter.bat'' finished with non-zero exit value 1* Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 24s
    Exception: Gradle task assembleDebug failed with exit code 1怎么回事
    
  • 这个错误提示表明在编译过程中出现了无法识别的类或方法。具体来说,代码中引用了不存在的 Uint8List 类型。

    要解决这个问题,你可以尝试以下步骤:

    1. 检查依赖版本: 确保你使用的 tencent_trtc_cloud 库的版本与你的代码兼容。有时候更新库版本或者降低库版本可以解决这类问题。

    2. 检查引用路径: 确保 Uint8List 类型被正确地引入。在 Dart 中,Uint8List 类型通常是从 dart:typed_data 中引入的。你可以检查一下是否在文件开头引入了该类:

       
    1. import 'dart:typed_data';
      
    2. 检查参数类型: 确保传递给 Uint8List.fromList 方法的参数类型是 List<int>。你可以添加一些调试语句,确认参数类型和值是否正确。

    3. 清理缓存并重新构建: 有时候清理 Flutter 和 Gradle 的缓存可以解决一些编译问题。你可以尝试运行 flutter clean 命令清理 Flutter 缓存,然后重新构建项目。

    4. 查看文档和示例: 如果以上方法都没有解决问题,你可以查看相关库的文档和示例,看是否有类似的用法示例或者已知的解决方法。

    通过以上步骤,你应该能够解决这个编译错误。如果问题仍然存在,可以提供更多的代码片段或者详细的错误信息,这样我可以给出更具体的帮助。

  • ע: D:\flutter_windows_2.8.0-stable\.pub-cache\hosted\pub.flutter-io.cn\path_provider_android-2.0.12\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.javaʹ����δ�����򲻰�ȫ�IJ�����
    ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:unchecked ���±��롣
    ע: ijЩ�����ļ�ʹ�û򸲸����ѹ�ʱ�� API��
    ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣
    ע: ijЩ�����ļ�ʹ����δ�����򲻰�ȫ�IJ�����
    ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:unchecked ���±��롣乱码
  • 这些警告信息看起来是由于编译过程中使用了非 ASCII 字符,导致终端输出了乱码。虽然这些警告信息看起来比较杂乱,但通常不会影响到你的应用程序的运行。

    根据警告信息中提到的路径 D:\flutter_windows_2.8.0-stable\.pub-cache\hosted\pub.flutter-io.cn\path_provider_android-2.0.12\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java,似乎是在处理路径提供者插件(path_provider)的 Android 部分时出现了一些问题。但从这个信息来看,并没有提供具体的错误信息或者异常。

    要解决这个问题,你可以尝试以下几点:

    1. 清理缓存并重新构建: 运行 flutter clean 清理 Flutter 缓存,然后重新构建你的应用程序。

    2. 检查依赖版本: 确保你使用的 path_provider 插件的版本是最新的,并且与你的 Flutter 版本兼容。

    3. 查看详细日志: 如果上述步骤无法解决问题,你可以尝试添加 -v 参数重新运行构建命令,以获取更详细的日志信息,帮助你定位问题所在。

    4. 更新插件: 如果问题依然存在,可以尝试更新相关的插件或者依赖库到最新版本,看是否有已知的问题修复。

    通过以上步骤,你应该能够解决这个警告信息所引发的问题。如果问题依然存在,欢迎提供更多的详细信息,我会尽力帮助你解决。

安装到手机如果白屏的话,请关闭app后台让后将 ,让后重新启动app就可以看到所有模块按钮了

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/610613.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Leetcode 406. 根据身高重建队列

心路历程&#xff1a; 看到二维数组的排序问题&#xff0c;第一反应想到了之前合并区间那道题先对数组按照第一维排序&#xff0c;后来在纸上模拟后发现&#xff0c;如果按照第一维度降维&#xff0c;第二维度升维的方式排序&#xff0c;那么后面插入的元素一定不会影响前面的…

【算法练习】29:插入排序学习笔记

一、插入排序的算法思想 原理&#xff1a;将一个无序的数据序列逐步转化为有序序列。算法将待排序的数组分为两个部分已排序部分和未排序部分。 时间复杂度&#xff1a;插入排序的时间复杂度在最坏、平均和最好情况下的表现相同&#xff0c;均为 &#xff0c;其中 n 是待排序数…

WS2812B彩灯

目录 1、介绍 2、参数 3、引脚功能 4、应用电路 5、Code 1、介绍 WS2812是一种智能控制LED灯源&#xff0c;集成了控制电路和RGB芯片在一个5050封装组件中。它的主要特点和技术规格如下&#xff1a; 集成设计&#xff1a;WS2812将控制电路和RGB芯片集成在同一个封装中&…

【高端电流检测IC储能产品应用方案】耐压28V侧轨的电流检测芯片FP130A 应用于电脑电源,开关电源以及多口快充充电器,户外移动电源,适配器,电池充电器等

电流检测技术常用于高压短路保护、电机控制、DC/DC换流器、系统功耗管理、二次电池的电流管理、蓄电池管理等电流侦测等场景。对于大多数应用而言&#xff0c;都是间接测量电阻两端的跨压差来获取待测电流。 如下面的高端电流检测芯片FP130A&#xff0c;丝印是FC915。电路原理图…

【方法】PDF密码如何取消?

对于重要的PDF文件&#xff0c;很多人会设置密码保护&#xff0c;那后续不需要保护了&#xff0c;如何取消密码呢&#xff1f; 今天我们来看看&#xff0c;PDF的两种密码&#xff0c;即“限制密码”和“打开密码”&#xff0c;是如何取消的&#xff0c;以及忘记密码的情况要怎…

设计模式-组合模式(Composite Pattern)

1. 概念 组合模式是一种结构型设计模式&#xff0c;它允许将对象组合成树状的层次结构&#xff0c;用来表示“整体-部分”的关系。 2. 原理结构图 原理图 抽象角色&#xff08;Component&#xff09;&#xff1a;这是组合模式的核心&#xff0c;它定义了树叶和树枝构件的公…

【linux】set ff=unix、linux设置文件格式

文章目录 一、文件格式二、如何查看文件格式三、设置文件格式、set ffunix四、查看unix与dos的区别 一、文件格式 当我们打开sh脚本时发现有时候格式是unix(LF) ,有时候是windows(CR LF) 。如下图&#xff1a; 文件格式影响了文件中的换行符 linux中sh类型的文件一般要设置为…

Centos7 k8s 集群 - Rook Ceph 安装

环境准备 基础环境 系统名称操作系统CPU内存硬盘Kubernete 版本Docker版本IPmasterCentos74c4gsdb 20G1.17.023.0.1192.168.1.128node01Centos74c4gsdb 20G1.17.023.0.1192.168.1.129node02Centos74c4gsdb 20G1.17.023.0.1192.168.1.130node03Centos74c4gsdb 20G1.17.023.0.1…

oracle分区表迁移后空间占用增大

检查分区段隐含参数&#xff1a; select a.KSPPINM "Parameter", c.ksppstvl "Instance Value", ksppdesc "Desc" from sys.x$ksppi a, sys.x$ksppcv b, sys.x$ksppsv c where a.indx b.indx and a.indx c.indx and substr(ksppinm,1,1)_ and…

MySQL——全文检索

不是所有的数据表都支持全文检索 MySQL支持多种底层数据库引擎&#xff0c;但是并非所有的引擎支持全文检索 &#xff0c;目前最常用引擎是是MyISAM和InnoDB&#xff1b;前者支持全文检索&#xff0c;后者不支持。 booolean模式操作符 实验&#xff1a; 表productnotes &…

[Kubernetes[K8S]集群:Slaver从节点初始化和Join]:添加到主节点集群内

文章目录 操作流程&#xff1a;上篇主节初始化地址&#xff1a;前置&#xff1a;Docker和K8S安装版本匹配查看0.1&#xff1a;安装指定docker版本 **[1 — 8] ** [ 这些步骤主从节点前置操作一样的 ]一&#xff1a;主节点操作 查看主机域名->编辑域名->域名配置二&#x…

【论文阅读】Digging Into Self-Supervised Monocular Depth Estimation

论文&#xff1a;https://arxiv.org/pdf/1806.01260.pdf 代码&#xff1a;https://github.com/nianticlabs/monodepth2 Q: 这篇论文试图解决什么问题&#xff1f; A: 这篇论文试图解决的问题是如何提高仅使用单目图像进行深度估计的性能。具体来说&#xff0c;它关注的是如何…