基本上,我有一个使用realm的工作应用程序,它可以正常工作,直到我尝试将Firebase导入其中并且情况发生了变化。它不会再看到领域了,在我修复了 relam 导入之后,现在它说
Error:(10, 8) error: Type java.lang.Double of field price is not supported
这是我的班级的样子:
public class RealmTruck extends RealmObject {
@PrimaryKey
private String name;
private String location;
private Double price;
private Integer registrationYear;
private String version;
我再次提到这是有效的。如果我将领域从 0.82.1 版本切换到 0.83.0.+,我会得到这个:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not find any version that matches io.realm:realm-android:0.83.0.+.
Versions that do not match:
0.87.5
0.87.4
0.87.3
0.87.2
0.87.1
+ 31 more
Required by:
LoginTest:app:unspecified
这是怎么回事?我真的没有改变任何东西。我尝试重新编译,重新导入,清除缓存的索引,但没有任何效果。
如果我现在尝试大同步,我会得到这个:
Error:(33, 13) Failed to resolve: io.realm:realm-android:0.83.0.+
<a href="openFile:D:/Projects2016/Android/LoginTest/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
我正在使用Android Studio,我相信这是最新版本
这是因为 Realm 不支持 0.83.0 之前的Double
、Integer
等类。
引入 0.83.0 及更高版本的 NULL support
,允许为空的基元。
尽管建议您至少升级到 0.87.5 或 0.88.3,而不要在 Realm 代码中更改太多现有逻辑。
如果这是一个新项目,并且 Realm 是新引入的,那么您应该选择 1.2.0 或可用的最新版本。