首页 \ 问答 \ Android上的Proguard和Netty 5(Proguard and Netty 5 on Android)

Android上的Proguard和Netty 5(Proguard and Netty 5 on Android)

我已经看到关于这个问题的几个问题,但是它们是针对旧版Netty的。
我已经尝试了他们的答案,使用io.netty切换org.jboss.netty,但发生同样的错误。

我试图编译一个使用Netty 5.0.0Alpha2(build#16)并启用了Proguard的Android应用程序。

没有Proguard,应用程序运行良好。
只要启用Proguard,我会在尝试使用Netty时遇到此异常:

java.lang.IllegalStateException: unknown type parameter 'I': class io.netty.channel.SimpleChannelInboundHandler
    at io.netty.util.internal.TypeParameterMatcher.find0(Unknown Source)
    at io.netty.util.internal.TypeParameterMatcher.find(Unknown Source)
    at io.netty.channel.SimpleChannelInboundHandler.<init>(Unknown Source)
    at io.netty.channel.SimpleChannelInboundHandler.<init>(Unknown Source)
    ...

这是我的Proguard配置:

# billing
-keep class com.android.vending.billing.**

# butterknife
-dontwarn butterknife.internal.**
-keep class **$$ViewInjector {
    *;
}
-keepnames class * {
    @butterknife.InjectView *;
}

# admob
-keep public class com.google.android.gms.ads.** {
    public *;
}

-keep public class com.google.ads.** {
    public *;
}

# logging
-assumenosideeffects class android.util.Log

# netty (partial)
-dontwarn io.netty.**
-dontwarn sun.**

我已经测试了它,没有使用-twtwarn选项来查看警告是否会指向正确的方向,但是它都缺少可选的依赖项,如slf4j和Tomcat。

我也尝试过排除所有Netty类,如下所示:

-keep class io.netty.** {
    *;
}

...但似乎并没有解决它。


I've seen a couple questions regarding this issue, but they are for older versions of Netty.
I have tried their answers, switching org.jboss.netty out with io.netty, but the same error occurs.

I'm trying to compile an Android app that uses Netty 5.0.0Alpha2 (build #16) with Proguard enabled.

Without Proguard, the app runs fine.
As soon as I enable Proguard, I get this exception when it tries to use Netty:

java.lang.IllegalStateException: unknown type parameter 'I': class io.netty.channel.SimpleChannelInboundHandler
    at io.netty.util.internal.TypeParameterMatcher.find0(Unknown Source)
    at io.netty.util.internal.TypeParameterMatcher.find(Unknown Source)
    at io.netty.channel.SimpleChannelInboundHandler.<init>(Unknown Source)
    at io.netty.channel.SimpleChannelInboundHandler.<init>(Unknown Source)
    ...

This is my Proguard config:

# billing
-keep class com.android.vending.billing.**

# butterknife
-dontwarn butterknife.internal.**
-keep class **$$ViewInjector {
    *;
}
-keepnames class * {
    @butterknife.InjectView *;
}

# admob
-keep public class com.google.android.gms.ads.** {
    public *;
}

-keep public class com.google.ads.** {
    public *;
}

# logging
-assumenosideeffects class android.util.Log

# netty (partial)
-dontwarn io.netty.**
-dontwarn sun.**

I have tested it without the -dontwarn options to see if the warnings would point me in the right direction, but it's all missing optional dependencies like slf4j and Tomcat.

I have also tried excluding all the Netty classes like so:

-keep class io.netty.** {
    *;
}

...but that does not appear to fix it either.


原文:https://stackoverflow.com/questions/27083667
更新时间:2022-05-07 14:05

最满意答案

您需要获取最新的b值。 一种方法是将from子句中的条件作为附加连接。 另一种方法是使用where子句,以及相关的子查询:

where tableB.created_on = (select max(created_on)
                           from tableB b2
                           where b2.a_id = tableA.id
                          ) and
       . . . /* the rest of your conditions here */

You do need to get the latest b value. One way is to put the condition in the from clause as an additional join. Another way is to use the where clause, with a correlated subquery:

where tableB.created_on = (select max(created_on)
                           from tableB b2
                           where b2.a_id = tableA.id
                          ) and
       . . . /* the rest of your conditions here */

相关问答

更多
  • 看来你正在从错误的方向接近它。 你真正想要的是: SELECT t2.PriceId AS PriceId, t2.ServiceId AS ServiceId, t1p.Name AS PriceName, t1m.Name AS MaterialName, t1s.Name AS ServiceName FROM Table2 t2 LEFT JOIN Table1 t1p ON t2.PriceId = t1p.Id LEFT JOIN Table1 t1m ON t2.Mater ...
  • 尝试这个 select t1.USER ID , NAME , FAVORITE_COLOR , AGE ,JOB , LOCATION , NOTES from TABLE1 t1 INNER JOIN table2 t2 ON t1.USER_ID = t2.USER_ID 编辑> 如果您有3或4个表,那么只需加入它们就可以添加它 INNER JOIN table3 t3 ON t2.USER_ID = t3.USER_ID INNER JOIN table4 t4 ...
  • 您可以加入多个表,只需将所有联接链接到主查询,然后从这些表中选择列: SELECT ds_usermeta.first_name, ds_usermeta.last_name, ... ds_em_bookings.booking_date, ds_em_bookings.booking_comment, ds_em_events.event_name, ds_em_locations.location_name ...
  • 我个人认为没有任何理由可以使用Events表。 我会通过A UNION ALL查询解决这个问题,我会在查询的同一行链接问题和答案。 就像是: SELECT 'Question' as EventType, Q.QuestionID, t.AnswerID, NULL as DiscussionID, Q.QuestionTitle, U1.Name as QuestionBy, A.Answer, U2.Name as AnswerBy, NULL as DiscussionTitle, NULL as ...
  • 您需要获取最新的b值。 一种方法是将from子句中的条件作为附加连接。 另一种方法是使用where子句,以及相关的子查询: where tableB.created_on = (select max(created_on) from tableB b2 where b2.a_id = tableA.id ) and . . . /* t ...
  • 首先,您使用的实体框架完全错误。 Linq不是SQL。 你不应该使用join 。 相反,你应该使用关联。 相反,您的查询应该看起来像...... from sale in FactSales where sale.DateKey == 20130921 where sale.CompanyID <= 1 group sale by sale.Item.Department into c select new { Amount = c.Sum(l => l.Amount) Departmen ...
  • 我得出的结论是,我正在处理的环境是导致问题的原因。 我的查询按预期工作,并且根本不慢(1秒,18,000行)。 正如评论中所述,我必须以有限的灵活性填充网格,我相信这些网格填充首先用SQL语句填充临时网格,然后逐行复制到所需的网格中。 这很可能是导致我的问题的原因。 感谢大家的帮助。 I have come to the conclusion the environment I'm working in is the cause of the problem. My query works as inten ...
  • 你可以试试 SELECT i.name as name, v1.value as value_1, v2.value as value_2 FROM item i INNER JOIN item_value iv ON iv.item = i.id INNER JOIN property p ON iv.property = p.id LEFT JOIN value v1 ON p.name = 'prop1' AND v1.id = iv.value ...
  • 第一排 对于X的第一行,只有Y的第一行具有匹配的x和y因此Y的第一行将匹配iff Y$t[1]在X$t[1]和X$t[1] + 0.005但是实际上Y$t[1] < X$t[1]如下所示: > X$t[1] - Y$t[1] Time difference of 0.0009999275 secs 需要一个正roll=值,其大小至少等于上述差值,以便在行1中得到非NA。例如 > Y[X, roll=0.001] x y t IDX 1: 1 FALSE 2 ...
  • 我会用间接关系来设置它: class User has_many :employments has_many :companies, through: :employments has_many :positions has_many :teams, through: :positions end class Company has_many :employments has_many :users, through: :employments has_many :teams, ...

相关文章

更多

最新问答

更多
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • 电脑高中毕业学习去哪里培训
  • 电脑系统专业就业状况如何啊?
  • IEnumerable linq表达式(IEnumerable linq expressions)
  • 如何在Spring测试中连接依赖关系(How to wire dependencies in Spring tests)
  • Solr可以在没有Lucene的情况下运行吗?(Can Solr run without Lucene?)
  • 如何保证Task在当前线程上同步运行?(How to guarantee that a Task runs synchronously on the current thread?)
  • 在保持每列的类的同时向数据框添加行(Adding row to data frame while maintaining the class of each column)
  • 的?(The ? marks in emacs/haskell and ghc mode)
  • 一个线程可以调用SuspendThread传递自己的线程ID吗?(Can a thread call SuspendThread passing its own thread ID?)
  • 延迟socket.io响应,并“警告 - websocket连接无效”(Delayed socket.io response, and “warn - websocket connection invalid”)
  • 悬停时的图像转换(Image transition on hover)
  • IIS 7.5仅显示homecontroller(IIS 7.5 only shows homecontroller)
  • 没有JavaScript的复选框“关闭”值(Checkbox 'off' value without JavaScript)
  • java分布式框架有哪些
  • Python:填写表单并点击按钮确认[关闭](Python: fill out a form and confirm with a button click [closed])
  • PHP将文件链接到根文件目录(PHP Linking Files to Root File Directory)
  • 我如何删除ListView中的项目?(How I can remove a item in my ListView?)
  • 您是否必须为TFS(云)中的每个BUG创建一个TASK以跟踪时间?(Do you have to create a TASK for every BUG in TFS (Cloud) to track time?)
  • typoscript TMENU ATagParams小写(typoscript TMENU ATagParams lowercase)
  • 武陟会计培训类的学校哪个好点?
  • 从链接中删除文本修饰(Remove text decoration from links)