用友模块开发

2023-12-06

每次跑模块工程总是好费劲,都不知道打我这个模块工程用的是什么奇葩环境。

PluginsDevProject_Android_1.1.52\androidstudio\AndroidPluginDevSDK_androidStudio\moduleDemo\build.gradle

原版是

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    compileOnly files('../app/libs/apiEngine v1.1.0.jar')
}

我本地打包moduleDemo模块(aar),会报错

Execution failed for task ':moduleDemo:javaPreCompileDebug'.
> Could not resolve all files for configuration ':moduleDemo:debugCompileClasspath'.
   > Failed to transform file 'apiEngine v1.1.0.jar' to match attributes {artifactType=android-classes, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}
      > Execution failed for IdentityTransform: D:\2023\AndroidPluginDevSDK_androidStudio\app\libs\apiEngine v1.1.0.jar.
         > Expecting a file or a directory: D:\2023\AndroidPluginDevSDK_androidStudio\app\libs\apiEngine v1.1.0.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

自己修改成下面的样子,就不报错

dependencies {
    implementation fileTree(dir: '../app/libs', include: ['*.jar'])
    //compileOnly files('libs/apiEngine v1.1.0.jar')
}

或者是把/app/libs/apiEngine v3.0.0.jar复制一份到/moduleDemo/libs下,然后配置改成

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //compileOnly files('../app/libs/apiEngine v1.1.0.jar')
}

也不报错。

Cannot fit requested classes in a single dex file (# methods: 66683 > 65536)

解决办法:在build.gradle配置中加上

android {  
    defaultConfig {  
        // 其他配置项...  
        multiDexEnabled true  
    }  
}

 

posted on 2023-12-06 22:45  angelshelter  阅读(19)  评论(0编辑  收藏  举报

导航