* 出了什么问题:任务 ':honeywell_scanner:compileDebugJavaWithJavac' 执行失败

2023-12-28


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.deneme_kaynak">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:name="${applicationName}"
        android:label="deneme_kaynak"
        android:icon="@mipmap/launcher_icon"
        android:requestLegacyExternalStorage="true"
        android:usesCleartextTraffic="true">

        <activity
            android:name=".MainActivity"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:exported="true"
            android:hardwareAccelerated="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
                android:name="io.flutter.embedding.android.NormalTheme"
                android:resource="@style/NormalTheme" />
            <meta-data
                android:name="io.flutter.embedding.android.SplashScreenDrawable"
                android:resource="@drawable/launch_background"
                />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver" android:exported="false">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"></action>
            </intent-filter>
        </receiver>
        <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />


        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>


符号:变量 BarcodeReader 位置:HoneywellScannerNative 类 /Users/ddo/development/flutter/.pub-cache/hosted/pub.dartlang.org/honeywell_scanner-3.2.0+13/android/src/main/java/com/plugin/flutter/honeywell_scanner/HoneywellScannerNative.java: 108:错误:找不到符号 property.put(BarcodeReader.PROPERTY_UPC_E_ENABLED, true); ^ 符号:变量 BarcodeReader 位置:HoneywellScannerNative 类 注意:/Users/ddo/development/flutter/.pub-cache/hosted/pub.dartlang.org/honeywell_scanner-3.2.0+13/android/src/main/java/com/plugin/flutter/honeywell_scanner/HoneywellScannerPlugin。 java 使用或覆盖已弃用的 API。 注意:使用 -Xlint:deprecation 重新编译以了解详细信息。 37 个错误

失败:构建失败并出现异常。

  • 什么地方出了错: 任务“:honeywell_scanner:compileDebugJavaWithJavac”执行失败。

编译失败;有关详细信息,请参阅编译器错误输出。

  • Try:

使用 --stacktrace 选项运行以获取堆栈跟踪。 使用 --info 或 --debug 选项运行以获得更多日志输出。 使用 --scan 运行以获得完整的见解。

  • 获得更多帮助https://help.gradle.org https://help.gradle.org

应用程序/build.gradle

def localProperties = new Properties()
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 FileNotFoundException("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 33
    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 {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.deneme_kaynak"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
        minSdkVersion 29
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    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
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

构建.gradle


buildscript {
    ext.kotlin_version = '1.6.10'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.2.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


EDIT:

失败:构建失败并出现异常。

  • 什么地方出了错: 无法确定任务“:app:mergeDebugAssets”的依赖关系。

无法解析配置“:app:debugRuntimeClasspath”的所有任务依赖项。 无法解决项目:honeywell。 要求者: 项目:应用程序 > 项目:honeywell_scanner > 未找到项目 :honeywell 的匹配配置。消费者被配置为查找组件的运行时,最好针对 Android 进行优化,以及值为“debug”的属性“com.android.build.api.attributes.BuildTypeAttr”、属性“com.android.build.api”。 attribute.AgpVersionAttr' 的值为 '7.2.2',属性 'org.jetbrains.kotlin.platform.type' 的值为 'androidJvm',但是: - 所有消耗品配置都没有属性。


请按照以下步骤正确集成honeywell_scanner

https://pub.dev/packages/honeywell_scanner https://pub.dev/packages/honeywell_scanner

  1. flutter 酒吧添加 Honeywell_scanner

2.复制示例代码源中的 Honeywell 文件夹:

.../.pub-cache/hosted/pub.dartlang.org/honeywell_scanner-x.x.x+x/example/android/honeywell

进入你的 android 项目模块,它将使用这个插件。此步骤是必要且至关重要的,因为 Honeywell Data Collection Android 库是一个捆绑包 .aar,必须作为项目库进行引用。

  1. 将此 include ':honeywell' 添加到 Android 项目模块中的 settings.gradle 中,以允许插件找到 honeywell.aar 库。

  2. 在 AndroidManifest.xml 中的应用程序标签下添加 tools:replace="android:label" ,这是必需的,因为 honeywell.aar 库定义了 android:label="@string/app_name" ,它与项目的标签冲突,导致清单合并失败错误

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

* 出了什么问题:任务 ':honeywell_scanner:compileDebugJavaWithJavac' 执行失败 的相关文章

随机推荐