How to properly add dependecy for Realm in Android VS project

VS 2013
Elements 9.1.100.2111
Language Oxygene

How to properly configure Realm plugin in my gradle project ?
Can anyone help me with this ?
Here is Android Studio configuration link (how to do it in Oxygene project in VS ?)

have you tried to add realm-android-library-3.1.0.aar as reference to your project?

NO but how to get aar ?
When i add dependencies in gradle the aar is downloaded and compiled automatically ?
How to achieve it manually ?

I’ve compiled their examples from realm-java-3.1.0.zip with examples\gradlew.bat and .aar were put into C:\Users\<jour name>\.gradle\caches\modules-2\files-2.1\io.realm\realm-android-library

OK I will try … thank you !

But in the future is a chance to set properly all in gradle and apply plugin in VS ?

We never had a need for this before. I’ll log a research issue.

Thanks, logged as bugs://77738

yes, Elements fully supports resolving Grade dependencies, if you add a .gradle file to your project. i’ll find you a. example/doc link in a bit. it should not be necessary to manually download the aar.

nice, thank you !

Hi Marc
Any link to documentation ? Simple example how to set it in VS gradle file properly ?

This doe snot cover VS specifically, but the same steps from here: https://docs.elementscompiler.com/Fire/Gradle/ should work in VS, as well.

Hi Evgeny,
I did aar to my project but when i create simple example with one simple class i have error "Class is not a part of schema when i try to save data to db ? Did you have the same problem ?

var dg := new Dog;
dg.age := 11;
dg.name := 'Joke';

var db := realm.getdefaultinstance;
db.begintransaction;
db.copytorealm(dg); ->here is the problem

according to https://stackoverflow.com/questions/37887303/object-is-not-part-of-the-schema-for-this-realm , different issues and workarounds can be here

I tried but without success. I added aar but all people write about plugin order in gradle…
I unistalled app , clean/build… for now without success :slight_smile:

try to use .gradle as described at

Here are described only dependencies but all writes about applying plugins… I don’t know how to use it here…
Where should I add lines like :
apply plugin: 'com.android.application’
apply plugin: 'android-apt’
apply plugin: 'realm-android’
apply plugin: 'android-command

Adding gradle with :

dependencies {
//compile ‘com.google.android.gms:play-services:+’
//compile ‘com.google.android.gms:play-services-base:+’
//compile ‘com.google.android.gms:play-services-maps:+’
compile ‘io.realm:realm-gradle-plugin:3.5.0’
}
Is it correct configuration in gradle or should I do something else…
I have error druing compilation:

Can i change somewhere -Xmx1024M parameter which is used during build ?

Oh, i’m afraid we don’t support Gradle plugins, as we don’t actually use Gradle to build, we use msbuiid/xbuild. We only call out gradle to resolve references, so that’s all tat will work.

Not currently, no. I’ll see if i can make that an option for vNext (not the release we’ll RTM today, though, but the following beta).