i am building a video conference app and using ZegoCloud SDK and UI Kit, i get the following error when running the app on the android:
Launching lib/main.dart on SM M127F in debug mode...
[ZEGO][PLUGIN] Download native dependency
[ZEGO][PLUGIN] Native version: 3.16.0.39779
[ZEGO][PLUGIN] The specified version SDK already exists!
/Users/ahmedelsayed/.pub-cache/hosted/pub.dev/zego_express_engine-3.16.0/android/src/main/java/im/zego/zego_express_engine/internal/ZegoExpressEngineMethodHandler.java:230: error: cannot find symbol
import io.flutter.pluginmon.PluginRegistry.Registrar;
^
symbol: class Registrar
location: interface PluginRegistry
/Users/ahmedelsayed/.pub-cache/hosted/pub.dev/zego_express_engine-3.16.0/android/src/main/java/im/zego/zego_express_engine/internal/ZegoExpressEngineMethodHandler.java:236: error: cannot find symbol
private static Registrar registrar = null;
^
symbol: class Registrar
location: class ZegoExpressEngineMethodHandler
/Users/ahmedelsayed/.pub-cache/hosted/pub.dev/zego_express_engine-3.16.0/android/src/main/java/im/zego/zego_express_engine/internal/ZegoExpressEngineMethodHandler.java:269: error: cannot find symbol
public static void createEngineWithProfile(MethodCall call, Result result, Registrar reg, FlutterPluginBinding binding, EventChannel.EventSink sink) {
^
symbol: class Registrar
location: class ZegoExpressEngineMethodHandler
/Users/ahmedelsayed/.pub-cache/hosted/pub.dev/zego_express_engine-3.16.0/android/src/main/java/im/zego/zego_express_engine/internal/ZegoExpressEngineMethodHandler.java:319: error: cannot find symbol
public static void createEngine(MethodCall call, Result result, Registrar reg, FlutterPluginBinding binding, EventChannel.EventSink sink) {
^
symbol: class Registrar
location: class ZegoExpressEngineMethodHandler
/Users/ahmedelsayed/.pub-cache/hosted/pub.dev/zego_express_engine-3.16.0/android/src/main/java/im/zego/zego_express_engine/ZegoExpressEnginePlugin.java:20: error: cannot find symbol
import io.flutter.pluginmon.PluginRegistry.Registrar;
^
symbol: class Registrar
location: interface PluginRegistry
/Users/ahmedelsayed/.pub-cache/hosted/pub.dev/zego_express_engine-3.16.0/android/src/main/java/im/zego/zego_express_engine/ZegoExpressEnginePlugin.java:27: error: cannot find symbol
private Registrar registrar;
^
symbol: class Registrar
location: class ZegoExpressEnginePlugin
/Users/ahmedelsayed/.pub-cache/hosted/pub.dev/zego_express_engine-3.16.0/android/src/main/java/im/zego/zego_express_engine/ZegoExpressEnginePlugin.java:91: error: cannot find symbol
public static void registerWith(Registrar registrar) {
^
symbol: class Registrar
location: class ZegoExpressEnginePlugin
/Users/ahmedelsayed/.pub-cache/hosted/pub.dev/zego_express_engine-3.16.0/android/src/main/java/im/zego/zego_express_engine/ZegoExpressEnginePlugin.java:106: error: cannot find symbol
private void setupPlugin(Registrar registrar, FlutterPluginBinding pluginBinding, MethodChannel methodChannel, EventChannel eventChannel) {
^
symbol: class Registrar
location: class ZegoExpressEnginePlugin
/Users/ahmedelsayed/.pub-cache/hosted/pub.dev/zego_express_engine-3.16.0/android/src/main/java/im/zego/zego_express_engine/ZegoExpressEnginePlugin.java:156: error: cannot find symbol
method = this.manager.getMethod(call.method, MethodCall.class, Result.class, Registrar.class, FlutterPluginBinding.class, EventChannel.EventSink.class);
^
symbol: class Registrar
location: class ZegoExpressEnginePlugin
/Users/ahmedelsayed/.pub-cache/hosted/pub.dev/zego_express_engine-3.16.0/android/src/main/java/im/zego/zego_express_engine/ZegoExpressEnginePlugin.java:158: error: cannot find symbol
method = this.manager.getMethod(call.method, MethodCall.class, Result.class, Registrar.class, FlutterPluginBinding.class, EventChannel.EventSink.class);
^
symbol: class Registrar
location: class ZegoExpressEnginePlugin
Note: /Users/ahmedelsayed/.pub-cache/hosted/pub.dev/zego_express_engine-3.16.0/android/src/main/java/im/zego/zego_express_engine/internal/ZegoExpressEngineMethodHandler.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/ahmedelsayed/.pub-cache/hosted/pub.dev/zego_express_engine-3.16.0/android/src/main/java/im/zego/zego_express_engine/internal/ZegoExpressEngineMethodHandler.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
10 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':zego_express_engine:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.
BUILD FAILED in 18s
Error: Gradle task assembleDebug failed with exit code 1
Exited (1).
my app build gradle:
plugins {
id "com.android.application"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
// END: FlutterFire Configuration
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
android {
namespace "com.example.lawh"
compileSdk 34
ndkVersion "25.1.8937393"
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (.html).
applicationId "com.example.lawh"
// You can update the following values to match your application needs.
// For more information, see: /deployment/android#reviewing-the-gradle-build-configuration.
minSdk = 21
targetSdk = 34
versionCode = 1
versionName = '2.2'
// manifestPlaceholders = [appAuthRedirectScheme: "com.example.lawh",
// applicationName: "lawh"]
multiDexEnabled true
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
implementation 'androidx.annotation:annotation:1.7.0'
implementation 'androidx.work:work-runtime-ktx:2.7.0'
implementation files('/Users/ahmedelsayed/Developer/flutter/bin/cache/artifacts/engine/android-arm64-release/flutter.jar')
}
my project level build gradle:
allprojects{
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
ext {
compileSdkVersion = 34 // or higher / as desired
targetSdkVersion = 34 // or higher / as desired
minSdkVersion = 21 // Required minimum
appCompatVersion = "1.4.2" // or higher / as desired
playServicesLocationVersion = "21.0.1" // or higher / as desired
}
buildscript {
ext.kotlin_version = '1.8.0'
}
my settings.gradle :
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.3.1' apply false
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
// END: FlutterFire Configuration
id ".jetbrains.kotlin.android" version "1.9.21" apply false
}
// dependencyResolutionManagement {
// repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
// repositories {
// google()
// mavenCentral()
// maven { url '' } // <- Add this line.
// maven { url '' }
// }
// }
include ":app"
my pubspec.yaml:
name: lawh
description: "A new Flutter project."
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# .html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1
environment:
sdk: '>=3.3.4 <4.0.0'
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
flutter:
sdk: flutter
firebase_core: ^2.31.0
flutter_localizations:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.6
animations: ^2.0.11
intl: any
country_code_picker: ^3.0.0
bloc: ^8.1.4
equatable: ^2.0.5
firebase_auth: ^4.19.6
flutter_bloc: ^8.1.5
toastification: ^2.3.0
google_sign_in: ^6.2.1
image_picker: ^1.1.1
image_cropper: ^8.0.2
firebase_storage: ^11.7.6
url_launcher: ^6.3.1
permission_handler: ^11.3.1
user_repository:
path: packages/user_repository
update_repository:
path: packages/update_repository
payment_repository:
path: packages/payment_repository
http: any
zego_express_engine: 3.16.0
zego_uikit_prebuilt_video_conference: 2.9.2
dev_dependencies:
flutter_test:
sdk: flutter
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^3.0.0
# For information on the generic Dart part of this file, see the
# following page: /tools/pub/pubspec
# The following section is specific to Flutter packages.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
assets:
- assets/icons/social_media/
- assets/images/
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# /assets-and-images/#resolution-aware
# For details regarding adding assets from package dependencies, see
# /assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see /custom-fonts/#from-packages
flutter_intl:
enabled: true
i also tried the last version of zego_express_engine and zego_uikit_prebuilt_video_conference and get the same result
i tried to open the plugin project level build.gradle file but it did not work
i appreciate your help :D