1

INTRODUCTION: I exported android project from Unity version 4.6.1f1. After that, I imported it in Android Studio. I worked on a project for a few days and everything worked as supposed to.

When I change something in Unity, I just export android project again. In android studio, I delete ASSETS folder and then paste the new one that I get from Unity export. I did this in Eclipse to update my project. I am doing it now and everything works just fine.

PROBLEM PART: Then, I updated Unity to version 4.6.2p2. I exported android project again. I changed ASSETS folder as usual. I also changed unity-classes.jar. I used this method in Eclipse before and it worked for me (apparently it worked for a lot of people, as my research on the internet confirmed it).

This does not work in Android Studio. I get error

Invalid serialized file version. Expected version: 4.6.2p2. Actual version: 4.6.1f1.

I tried: restarting Android Studio; cleaning and rebuilding project; syncing gradle; using other versions of Unity,... I also tried removing all dependencies, cleaning project, then adding dependencies again and rebuilding project.

I did not find any reference to this problem on the internet.

The only solution I get so far is to import project in Android Studio as new one and then do all the work again. But that is very undesirable.

Did anyone has this problem and come up with a solution that will not require making new project from scratch?

1 Answer 1

2

I did more research and here is the solution.

The problem is that Unity doesn't export all libraries together now. Specifically, libmain.so libmono.so and libunity.so are now separated and you need to change them also after you export project with new version of Unity (changing unity-classes.jar and assets folder is mandatory as before).

When you export project from Unity, you can find those libraries in libs/armeabi-v7a folder. In Android Studio, you can find them in src/main/jniLibs/armeabi-v7a folder.

Not the answer you're looking for? Browse other questions tagged or ask your own question.