Open KevinBoulongne opened 2 years ago
Hi @KevinBoulongne Sorry for the late reply.
I tried to reproduce the behavior in one of our sample projects, but I had to modify the File model class quite significantly for it to compile, and then it didn't trigger the behavior.
Then, since your project is open source, I tried to build your branch from source, but I'm getting hit by this build error:
* What went wrong:
Could not determine the dependencies of task ':app:mergePreprodReleaseNativeLibs'.
> Could not resolve all task dependencies for configuration ':app:preprodReleaseRuntimeClasspath'.
> Could not resolve project :Core.
Required by:
project :app
> No matching configuration of project :Core was found. The consumer was configured to find a runtime of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release', attribute 'distribution' with value 'preprod', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- None of the consumable configurations have attributes.
Can you provide any advice on how to build your repo, because I suspect it will be much faster to test there.
Hello @cmelchior ! No worries for the delay.
You need to clone the repository with the submodules.
Here is the correct command: git clone --recurse-submodules git@github.com:Infomaniak/android-kDrive.git
Then just checkout the test branch, and everything should be ok :)
@KevinBoulongne Thanks for the instructions. We were able to reproduce the bug.
The Realm build transformer crashes when it encounters a resource within the function. You can avoid this issue, while we work out a solution, by moving the function body into a helper function. A static method in the companion object would work.
How frequently does the bug occur?
All the time
Description
Hello.
I'm encountering a build error that seems to be related to Realm.
I've added a new method (
getFolderIcon
) in a RealmObject (File
), and I'm not able to build anymore.The build fails at the task
:app:transformClassesWithRealmTransformerForStandardDebug
, with the cause beingbroken method
.If I put the method as an extension function in the class companion (or somewhere else in the project), it builds without issue.
You can find here the RealmObject: https://github.com/Infomaniak/android-kDrive/blob/Realm-broken-method/app/src/main/java/com/infomaniak/drive/data/models/File.kt
You can see in its companion that there is another methods with the same issue.
Stacktrace & log output
Can you reproduce the bug?
Yes, always
Reproduction Steps
You can checkout this branch and just build the app module: https://github.com/Infomaniak/android-kDrive/tree/Realm-broken-method
Version
10.8.0 & 10.10.1
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
Android 12
Build environment
Android Studio version: 2020.3.1 Patch 4 Android Build Tools version: 31.0.0 Gradle version: 7.0.4