GluonMobile:mergeAndroidAssets任务失败(缺少@Inject)

问题描述 投票:0回答:1

我正在与GluonMobile合作开展一个项目。最近我在android模块中添加了一些android资产。之后我无法运行android构建(apkDebug,...),因为发生了以下错误:

[...]
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':[project-name]:mergeAndroidAssets'.
> There were multiple failures while executing work items
   > A failure occurred while executing com.android.ide.common.res2.MergedAssetWriter$AssetWorkAction
      > Could not create an instance of type com.android.ide.common.res2.MergedAssetWriter$AssetWorkAction.
         > The constructor for class com.android.ide.common.res2.MergedAssetWriter$AssetWorkAction should be annotated with @Inject.
   > A failure occurred while executing com.android.ide.common.res2.MergedAssetWriter$AssetWorkAction
      > Could not create an instance of type com.android.ide.common.res2.MergedAssetWriter$AssetWorkAction.
         > The constructor for class com.android.ide.common.res2.MergedAssetWriter$AssetWorkAction should be annotated with @Inject.
   > A failure occurred while executing com.android.ide.common.res2.MergedAssetWriter$AssetWorkAction
      > Could not create an instance of type com.android.ide.common.res2.MergedAssetWriter$AssetWorkAction.
         > The constructor for class com.android.ide.common.res2.MergedAssetWriter$AssetWorkAction should be annotated with @Inject.

这是从我的build.gradle剪切:

buildscript {
    repositories {
        mavenCentral()
        jcenter()
        google()
        maven {
            url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
        }
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:+'

        classpath 'com.github.jengelman.gradle.plugins:shadow:+'
    }
}

apply plugin: 'org.javafxports.jfxmobile'

apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'idea'

repositories {
    mavenCentral()
    jcenter()
    google()
    maven {
        url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
    }
    maven {
        url uri('libs')
    }
}

mainClassName = '[...].main.Main'
version = '2.0_Alpha'

dependencies {
    compile 'com.gluonhq:charm:+'
    compile 'com.gluonhq:glisten-afterburner:+'

    [...]
}

jfxmobile {
    downConfig {
        version = '+'
        // Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
        //noinspection GroovyAssignabilityCheck
        plugins 'browser', 'connectivity', 'display', 'lifecycle', 'statusbar', 'storage'
    }
    android {
        manifest = 'src/android/AndroidManifest.xml'
        compileSdkVersion = 28
        targetSdkVersion = 22
        minSdkVersion = 16
    }
}
[...]

(我知道,你不应该使用'+'版本,但它适用于我。)

有人知道如何解决这个问题吗?

谢谢

java android gluon-mobile javafxports
1个回答
0
投票

感谢JoséPereda,我找到了一个解决方案:我将jfxmobile-plugin降级为版本1.3.16。

© www.soinside.com 2019 - 2024. All rights reserved.