Compiling the example app from Android Studio

Added by Jakob Eriksson over 3 years ago

Hi!

We are trying to compile the example app in Android Studio.

While doing this against the AGA Android SDK (1.1), there are build errors related to the support libraries pointed out by gradle. It needs version 21 something-something, while the AGA SDK seems to on version 19?

And if we let Android update these support libraries as it suggests, AGA classes disappears from the SDK.

How can this be resolved? Could it be that the example app is built against a newew AGA SDK internally?

It works if the AGA SDK is not referenced and instead the bundled jar service files are used.

Hope that made sense, I don't have access to the dev computer at this moment, so I can't quote exact error messages, but nonetheless I think what I wrote is truthful.

best regards,
Jakob
 

Replies (7)

RE: Compiling the example app from Android Studio - Added by Aida Ehsani over 3 years ago

We are trying to Run the sample code but it seems that it’s written for an android SDK not AGA SDK so it has couple of files redundancies that cause problems. When we tried to remove those files it still didn’t work since the sample is using a newer version of com.swedspot.automativeapi. could you please update the SDK ?

RE: Compiling the example app from Android Studio - Added by Kiril Kiryazov over 3 years ago


Dear Jakob and Aida

Thank you for you posts. Here you are some ideas which could be usefull for the issues you have mentioned:

1. The aga-sample-project is in two variants: rom and jar. If you are using the rom version - it is build to run on a device with AGA ROM on it.
The jar version of the app is supposed to be run on a regular Android device (without AGA).

2. You should not let Android studio to update your Android SDK. If it starts the wizard for SDK setting, close it and choose "Do not re-run the
setup wizard". Go to Project Structure and there set thel ocation to your Android AGA SDK. If the Android studio already updated your SDK you
should clean the folder and put again the Android AGA SDK there.

3. Run the SDK manager for the Android AGA SDK. There update some of the Tools and Extras but NOT the Android API as it is described in
https://developer.lindholmen.se/redmine/projects/aga/wiki/Develop_an_Android_application
Basically you should update:
-Android SDK Tools
-Android SDK Platform-Tools
-Android SDK Built-Tools
-Android Support Repository
-Android Support Library
-Google USB Drive (important only if you are using Windows)
It is a good practice is to press "Deselect All" before you have select any items in order not to update something which you don't want.

4. We have used Android Build Tool version 21.1.1 for aga-ssample-project but you can use other version as well if you want, in this case in the
gradle script of the app, modify the buildToolsVersion to the one you have

5. Which version of AGA SDK do you use - 4.4.2 or 5.0.0?  If you use 4.4.2 please change in the gradle script
compileSdkVersion and targetSdkVersion from 21 to 19 before you build.  You should also remove following line from the app gradle script:
compile 'com.android.support:appcompat-v7:21.0.2'
Otherwise the sample app should work with both versions of the SDK without any problems.

Hope it helps. Please let me know.

Best Regards, Kiril

Other version, from GIT - Added by Jakob Eriksson over 3 years ago

Actually, there seems to be a problem with the sample app code. A mismatch between the code in the SDK and what's in the sample code.

After we got a the sample app source code from you by email (supposedly from a version in git?) it works.

(I will try now to access the git repo directly.)

RE: Compiling the example app from Android Studio - Added by Aida Ehsani over 3 years ago

I got a demo app from :
 
and it’s not working on the nexus device with AGA on it (receiving any data from the simulator). The binding is failed and it seems that the address is already in use(same problem as the previous example). I think this demo app is not the ROM version. how can we solve this ?

 

RE: Compiling the example app from Android Studio - Added by Kiril Kiryazov over 3 years ago

Hello Aida
The demo-app is very old and not  supported anymore. We just removed the links in the wiki.
Could you please try our new sample app:
git@developer.lindholmen.se:aga-sample-project-rom
You can get more information for it and also download it from here :
https://developer.lindholmen.se/redmine/projects/aga/wiki/Release_Notes_AGA_sample_application
Best Regards, Kiril

RE: Compiling the example app from Android Studio - Added by Jakob Eriksson over 3 years ago

Kiril, apparently the version in git is also the old version.
 

RE: Compiling the example app from Android Studio - Added by Kiril Kiryazov over 3 years ago

Hi Jacob
In git you have them both : the old "demo-app" and the new "aga-sample-project"
Best, Kiril

(1-7/7)