【问题标题】:Android jenkins build errorAndroid jenkins 构建错误
【发布时间】:2013-08-05 16:39:13
【问题描述】:

我正在使用 jenkins 构建一个使用 ORMLite 的 Android 库项目,我收到以下错误,我真的不知道如何解决:

[javac] /Users/x/Desktop/workspace/x/src/com/x/x/database/DatabaseHelper.java:109:
    type parameters of <D>D cannot be determined; no unique maximal instance exists
    for type variable D with upper bounds com.x.x.database.dao.DatabaseObjectDao,
    com.j256.ormlite.dao.Dao<com.x.x.database.entity.UserEntity,?>
[javac] sUserEntityDao = getDao(UserEntity.class);

任何帮助都会非常棒:)

【问题讨论】:

标签: android ant jenkins ormlite


【解决方案1】:

所以下面可能是错误的,但我会把它留给后代。我最初认为这是一个 ORMLite 错误,但现在我认为这是一个编译器错误。

我认为你应该看看这个问题/答案:

Why does the compiler state no unique maximal instance exists?


这可能是ORMLite 错误,如果异常树的一部分可能具有以下效果的消息:

Could not find OpenHelperClass because none of the generic parameters of class 
YourActivityClass extends OrmLiteSqliteOpenHelper.  You should use
getHelper(Context, Class) instead.

Android 应用程序的简单 ORMLite 模式是让活动扩展 OrmLiteBaseActivity&lt;YourDatabaseHelper&gt;。比如:

public class HelloAndroid extends OrmLiteBaseActivity<DatabaseHelper> {

然后,当您调用getHelper() 时,ORMLite 可以自动确定要使用哪个 DatabaseHelper 辅助类。还有其他方法可以设置 ORMLite 的接线。我先看看Android starting docs,然后再看看Android example programs。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-19
    • 2017-10-10
    • 2013-03-26
    • 2016-05-26
    • 1970-01-01
    • 1970-01-01
    • 2022-10-06
    相关资源
    最近更新 更多