使用@capacitor/barcode-scanner插件触发扫描时遇NoSuchMethodError求助
求助:@capacitor/barcode-scanner插件启动扫描时出现java.lang.NoSuchMethodError异常
启动@capacitor/barcode-scanner插件的扫描功能时,抛出如下异常:
java.lang.NoSuchMethodError: No static method rememberComposableLambda(IZLjava/lang/Object;Landroidx/compose/runtime/Composer;I)Landroidx/compose/runtime/internal/ComposableLambda; in class Landroidx/compose/runtime/internal/ComposableLambdaKt; or its super classes (declaration of 'androidx.compose.runtime.internal.ComposableLambdaKt' appears in /data/app/~~mK_bGGqANgiVGzIdyQh2Yw==/com.mycompany.caisse.debug-ILKcoyuBxwK5azm899YlKw==/base.apk) at com.outsystems.plugins.barcode.view.OSBARCScannerActivity$onCreate$3.invoke(OSBARCScannerActivity.kt:204) at com.outsystems.plugins.barcode.view.OSBARCScannerActivity$onCreate$3.invoke(OSBARCScannerActivity.kt:198) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34) at androidx.compose.ui.platform.ComposeView.Content(ComposeView.android.kt:428) at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:252) at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:251) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:194) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:123) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:122) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
项目配置信息
1. 根目录build.gradle配置
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:8.2.1' classpath 'com.google.gms:google-services:4.4.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } apply from: "variables.gradle" allprojects { repositories { google() mavenCentral() maven { url 'https://pkgs.dev.azure.com/OutSystemsRD/9e79bc5b-69b2-4476-9ca5-d67594972a52/_packaging/PublicArtifactRepository/maven/v1' name 'Azure' credentials { username = "optional" password = "" } content { includeGroup "com.github.outsystems" } } } } task clean(type: Delete) { delete rootProject.buildDir }
2. app模块build.gradle配置
apply plugin: 'com.android.application' android { namespace "com.mycompany.caisse" compileSdk rootProject.ext.compileSdkVersion defaultConfig { applicationId "com.mycompany.caisse.debug" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 14 versionName "3.3.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } repositories { flatDir{ dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion" implementation project(':capacitor-android') testImplementation "junit:junit:$junitVersion" androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" implementation project(':capacitor-cordova-android-plugins') } apply from: 'capacitor.build.gradle' try { def servicesJSON = file('google-services.json') if (servicesJSON.text) { apply plugin: 'com.google.gms.google-services' } } catch(Exception e) { logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work") }
3. Gradle环境信息
Gradle 8.2.1 Build time: 2023-07-10 12:12:35 UTC Revision: a38ec64d3c4612da9083cc506a1ccb212afeecaa Kotlin: 1.8.20 Groovy: 3.0.17 Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023 JVM: 17.0.12 (Oracle Corporation 17.0.12+8-LTS-286) OS: Windows 11 10.0 amd64
恳请帮忙解决该异常问题。
内容的提问来源于stack exchange,提问作者anonymous anonymous
相关产品推荐
相关产品推荐

