Visual Studio aar libraries

Hi all,

i try to reference google play services to VS project but i have two issues

  1. when i try to reference the aar library in Android sdk directory structure the build stops with error that cannot find library (in case i put aar in to the root project directory this error disappears)
  2. but for the next error i was not able to find any workaround
    error JE20: Could not load referenced Java archive “classes.jar”: Invalid reference

Any idea how to reference aar libraries in Visual Studil Swift project ?

Thank you
Jan

Sorry for the delayed response. Is this with 8.3 or the 8.4 beta?

we made significant changes and improvements to the reference tool chain for 8.4, so if you’re currently on 8.3, i recommend trying the latest, before we investigate further. In general, just adding the .aar as reference should “work”.

Could you sand me the link fo 8.4 beta.

Thank you

Jan

Jan,

i have set up your account with beta access. You should find there betas at http://beta.remobjects.com.

yours,
marc

Thank you i will test it today and let you know

1 Like

Marc,

now i have tested latest beta and I receive this exception during build
process

C:\Users\radl\OneDrive\Dokumenty\Visual Studio
2015\Projects\org.me.androidapplication1\org.me.androidapplication1\Android\aarrefs\play-services-maps-9.6.1\res\values\values.xml(3,1):
error Android: Attribute “mapType” already defined with incompatible format.
C:\Users\radl\OneDrive\Dokumenty\Visual Studio
2015\Projects\org.me.androidapplication1\org.me.androidapplication1\obj\Debug\Android\aar\play-services-maps-9.6.1\res\values\values.xml:3:
Original attribute defined here.

Any idea ?

Jan

Hmm, sounds like for some reason two versions of the values.xml file are being processed, one from Android\aarrefs (where does that come from?) and one from \obj\Debug\Android\aar\ (that’s where we un-archive the .aar’s to during build.

Could the first one bet a leftover from an earlier version? Did you put stuff in \Android\aarrefs\ yourself? what happens if you delete that folder?

Well I remove the wrong directory and now I receive

error JE20: Could not load referenced Java archive “classes.jar”: Invalid
reference

JR

Hmm. Is this for an Android app or a plain Java app? do you have classes or android as reference in your project? can you send me the project?

It is a test android project where we want to test google service.

xxx is a zip

Hi Marc,

I’m so sorry I disturb you, but did you find the reason of compilation
error ?

Thank you

Jan

see my previous questions.

Ok,

it is a Android project with aar references. Did you receive the project
sources ?

Thank you

Jan

I don’t believe i did. where did you send it?

—marc

It is a test android project where we want to test google service.

xxx is a zip

sorry for the delay. i still don,t see where to find the zip file with your project. i didn’t receive it, and it’s not attached here. can you mail a copy to mh@remobjects.com? thanx!

sended

got it, i’ll have a look tomorrow.

    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>
    <Reference Include="classes"/>

that’s A LOT of reference to classes.jar, which does fit exist for Android. where did this come from?

If i remove those, i’m down to

public override func onCreate(savedInstanceState: Bundle!) { // E178 Cannot find a suitable method in the base class to override with signature "onCreate(# savedInstanceState: Bundle!)"
															 // N12 Possible match: onCreate(_ Bundle!)

which needs an underscore for Swift 3, e.g.:

public override func onCreate(_ savedInstanceState: Bundle!) { 

and after that, all builds (and fails on me not having your keystore; expected).