Comments (9)
我exclude下面这些就解决了:
aspectjx {
//排除所有package的class文件及库(jar文件)
exclude 'androidx'
exclude 'com.google'
exclude 'org.jetbrains.kotlin'
exclude 'com.squareup'
exclude 'android.support'
exclude 'versions.9'
exclude 'module-info'
}
from gradle_plugin_android_aspectjx.
kotlin 降级到 1.4 尝试一下?
from gradle_plugin_android_aspectjx.
我也是这样的问题 降了也不管用
from gradle_plugin_android_aspectjx.
经过比对和测试,发现结合Koutlin使用会发生以下问题:
1 Kotlin的版本:
测试1.3.61是没有问题的,测试1.5.20会报 Cause: zip file is empty 错误。
2 AspectJ使用:
引入Kotlin使用,必须要给某个类声明@aspect注解,否则会报找不到启动类(如果项目中有自定义的Application,那么会报找不到Application,如果项目中没有Application,那么项目中会报找不到启动类XXXActivity)
该问题在纯Java项目中并不会出现(不给某个类声明@aspect注解也不会报错),Kotlin+Java结合使用会出现该情况。
from gradle_plugin_android_aspectjx.
经过比对和测试,发现结合Koutlin使用会发生以下问题: 1 Kotlin的版本: 测试1.3.61是没有问题的,测试1.5.20会报 Cause: zip file is empty 错误。 2 AspectJ使用: 引入Kotlin使用,必须要给某个类声明@aspect注解,否则会报找不到启动类(如果项目中有自定义的Application,那么会报找不到Application,如果项目中没有Application,那么项目中会报找不到启动类XXXActivity) 该问题在纯Java项目中并不会出现(不给某个类声明@aspect注解也不会报错),Kotlin+Java结合使用会出现该情况。
1.3.61就会找不到application
from gradle_plugin_android_aspectjx.
经过比对和测试,发现结合 Koutlin 使用会发生以下问题: 1 Kotlin 的版本: 测试 1.3.61 是没有问题的,测试 1.5.20 会报 原因:zip 文件为空错误。 2 AspectJ 使用:引入 Kotlin 使用,必须要给某个类声明@aspect注解,否则会报找不到启动类(如果项目有自定义的申请,那么就会找到申请,如果项目中没有申请,那么项目中会报不到启动类XXXActivity)该问题在纯Java项目中并不会出现(不给某类声明@aspect注解不会报错),Kotlin+Java结合使用会出现该情况。
1.3.61 可能找不到申请
新建一个类,给这个类添加上注解@aspect
from gradle_plugin_android_aspectjx.
这个怎么解决呢?
怎么给关了
from gradle_plugin_android_aspectjx.
我exclude下面这些就解决了: aspectjx { //排除所有package的class文件及库(jar文件) exclude 'androidx' exclude 'com.google' exclude 'org.jetbrains.kotlin' exclude 'com.squareup' exclude 'android.support' exclude 'versions.9' exclude 'module-info' }
还要加上协程的类,Aspectjx也会导致Kotlin协程相关类找不到
exclude 'kotlinx.coroutines'
from gradle_plugin_android_aspectjx.
@leeyushi 可以使用我fork过来维护的插件,这些问题都有修复。#332
from gradle_plugin_android_aspectjx.
Related Issues (20)
- kotlin 中使用 运行报错 HOT 2
- java.util.zip.ZipException: zip file is empty HOT 6
- kotlin 1.5 会报错 HOT 2
- 1年多没更新了,还维护吗 HOT 1
- ArrayIndexOutOfBoundsException HOT 2
- 无法插桩成功怎么回事? 完全按照文档的步骤去配置的 HOT 1
- 插件会导致androidTest找不到class HOT 1
- library中配置的annotation注解不生效 HOT 2
- 原作者已不再维护,继续使用建议使用我fork后修复发布的版本。(给即将使用或已经使用的几点建议) HOT 18
- 关于代码混淆后,AOP切面异常void java.lang.ClassNotFoundException.
- aspectjx会入侵所有的三方包,那是否可以使用include控制到只在本应用的包名下的类生效?而不去第三方sdk包?
- 什么时候可以支持kotlin1.5.+
- aspectjx加cmake以后各种冲突externalNativeBuildCleanBxn_nationDebug,我把cmake注释掉以后报错Cause: zip file is empty
- gradle7.1后项目,build.gradle使用plugins,要怎么集成使用 HOT 14
- 【include使用】如果不配置,编译太慢了
- 当前是否支持gradle 8.0.1版本,升级后报错 HOT 2
- 这个项目彻底凉了吗 HOT 3
- 社区有没有使用AGP7-AGP8新的api的版本?不使用trasnform 框架的,跪求! HOT 1
- 推荐一个新的 Android 端 AOP 框架,支持 AGP8 以上 https://github.com/FlyJingFish/AndroidAOP HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle_plugin_android_aspectjx.