我在 Hyperion github 中遇到了问题.我想将我的自定义项目添加到 海波 菜单。
当我发现如果我从核心库中删除某些东西时,它们将被成功删除,反之亦然。但是如果我添加自定义 Plugin
- 什么都没发生。
我试过不同版本的 海波 它也不影响结果。
另外,这里我还检查了:
@AutoService
注释 minifyEnabled false
插件:
import com.google.auto.service.AutoService
import com.willowtreeapps.hyperion.plugin.v1.Plugin
import com.willowtreeapps.hyperion.plugin.v1.PluginModule
@AutoService(Plugin::class)
class TestPlugin : Plugin() {
override fun createPluginModule(): PluginModule? {
return TestPluginModule()
}
}
模块:
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.willowtreeapps.hyperion.plugin.v1.PluginModule
class TestPluginModule : PluginModule() {
override fun createPluginView(layoutInflater: LayoutInflater, parent: ViewGroup): View? {
return layoutInflater.inflate(R.layout.htest_plugin_item, parent, false)
}
}
依赖:
def hyperionVersion = '0.9.27'
debugImplementation "com.willowtreeapps.hyperion:hyperion-core:$hyperionVersion"
debugImplementation "com.willowtreeapps.hyperion:hyperion-attr:$hyperionVersion"
debugImplementation "com.willowtreeapps.hyperion:hyperion-crash:$hyperionVersion"
debugImplementation "com.willowtreeapps.hyperion:hyperion-measurement:$hyperionVersion"
debugImplementation "com.willowtreeapps.hyperion:hyperion-recorder:$hyperionVersion"
debugImplementation "com.willowtreeapps.hyperion:hyperion-shared-preferences:$hyperionVersion"
debugImplementation "com.willowtreeapps.hyperion:hyperion-timber:$hyperionVersion"
NOTE: on screenshots v0.9.26. But I've tested also v0.9.27, v0.9.25, v0.9.24.
请您参考如下方法:
看起来问题与 @AutoService
的处理有关注解。确保您已将注释处理器添加到项目中。
您应该将以下注释处理器添加到 build.gradle
文件。
对于 Kotlin 项目:
kapt 'com.google.auto.service:auto-service:1.0-rc6'
对于 java 项目:
annotationProcessor 'com.google.auto.service:auto-service:1.0-rc6'