我有一个工作颤振项目,但当我安装agora RTC包时,它给出的任务执行失败
“:agora\u rtc\u引擎:CompiledBugkotlin”
。错误
我甚至还没有使用该软件包,我尝试在
readme
但我认为问题出在程序包本身,而且我的flutter项目是空安全迁移的,它正在工作,所以我确信我的项目没有问题。
我还没有使用这个软件包。只需安装它就会出现错误。
这是
app/gradle.build
:
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "com.example.malhamti_app"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
这是我的
android/build.gradle
:
ext.kotlin_version = '1.6.20'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是gradle
--stacktrace
:
查看完整
stacktrace
(字符限制)
> Task :agora_rtc_engine:compileProfileKotlin FAILED
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraRtcEnginePlugin.kt: (251, 18): Type mismatch: inferred type is String? but String was expected
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraSurfaceViewFactory.kt: (16, 1): Class 'AgoraSurfaceViewFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraSurfaceViewFactory.kt: (20, 3): 'create' overrides nothing
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraTextureViewFactory.kt: (12, 1): Class 'AgoraTextureViewFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraTextureViewFactory.kt: (17, 3): 'create' overrides nothing
> Task :agora_rtc_engine:compileDebugKotlin FAILED
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraRtcEnginePlugin.kt: (251, 18): Type mismatch: inferred type is String? but String was expected
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraSurfaceViewFactory.kt: (16, 1): Class 'AgoraSurfaceViewFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraSurfaceViewFactory.kt: (20, 3): 'create' overrides nothing
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraTextureViewFactory.kt: (12, 1): Class 'AgoraTextureViewFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraTextureViewFactory.kt: (17, 3): 'create' overrides nothing
> Task :agora_rtc_engine:compileReleaseKotlin FAILED
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraRtcEnginePlugin.kt: (251, 18): Type mismatch: inferred type is String? but String was expected
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraSurfaceViewFactory.kt: (16, 1): Class 'AgoraSurfaceViewFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraSurfaceViewFactory.kt: (20, 3): 'create' overrides nothing
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraTextureViewFactory.kt: (12, 1): Class 'AgoraTextureViewFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory
e: /Users/doabletech/Development/Tools/flutter_sdk/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-5.1.0/android/src/main/kotlin/io/agora/agora_rtc_engine/AgoraTextureViewFactory.kt: (17, 3): 'create' overrides nothing
FAILURE: Build completed with 3 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':agora_rtc_engine:compileProfileKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Exception is:
see full [stacktrace][3] here (character limit)
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':agora_rtc_engine:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Exception is:
see full [stacktrace][3] here (character limit)
==============================================================================
3: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':agora_rtc_engine:compileReleaseKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Exception is:
see full [stacktrace][3] here (character limit)
BUILD FAILED in 4s
49 actionable tasks: 49 executed