alibaba / alibaba/freeline

Caused by: java.lang.ExceptionInInitializerError: RealmTransformer doesn't seem to be applied

Open
#660 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
5.4k
Forks
620
PR merge metrics
No merged PRs in 30d

Description

It may be because freeline doesn't support the Transform API yet

OkBuck also has the same problem, see https://github.com/realm/realm-java/issues/3971

### Steps & Code to Reproduce
in your demoApplication.java
```java
// Initialize Realm. Should only be done once when the application starts.
Realm.init(this);

RealmConfiguration config = new RealmConfiguration.Builder()
.deleteRealmIfMigrationNeeded()
.build();
Realm.setDefaultConfiguration(config);
```

exampleRealmModel
```java
public class exampleRealmModel extends RealmObject {
@PrimaryKey
@Required
private String conversationId;
@Required
private String myUUID;
@Required
private String otherUUID;
}
```

1. first run, it's ok
2. modify exampleRealmModel, for example: update `@Required private String otherUUID;` to `private String otherUUID;`, run the project, get a exception: `Caused by: java.lang.ExceptionInInitializerError: RealmTransformer doesn't seem to be applied`

Instant Run does not have the problem

### Version of Realm and tooling
Realm version: 2.3.1
Android Studio version: 2.2.3
Gradle version: 2.14.1
Android Gradle Plugin: 2.2.3

compileSdkVersion 25
buildToolsVersion "25.0.2"
minSdkVersion 16
targetSdkVersion 25

Thanks a lot.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the RealmTransformer integration and the Transform API path implicated by the report. Reproduce using demoApplication.java and exampleRealmModel by changing the @Required annotation as described, then verify that the project no longer raises RealmTransformer doesn't seem to be applied when rebuilt with Freeline.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
build-system, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.