I imported FireBases Database Unity Package today and as part of the import it had to various upgrades (such as a .NET upgrade and installation of some Android packages.
My game builds and runs fine in the Unity editor, however trying to build the game for Android I get the following error.
I was fully able to build the game prior to importing the package.
After some looking around about this issue I found this bug on the Unity page: https://issuetracker.unity3d.com/issues/unity-tries-to-find-a-not-existing-classes-dot-jar-file-in-play-services-dot-aar-which-results-in-failing-android-build
However I am no closer as to saving this issue.
I am using the latest version of Unity 2017.3.1f1
After looking around I was able to find an answer.
Setting the build settings to Gradle and adding a Build.Gradle file in the root of the project was able to solve my issue.
This question was a duplicate of the following:
(Firebase Databse in Unity) missing classes.jar in Temp during build for Android
Related
I am using Android Studio 4.1.1 to complete a Beginner's Android course that was last updated in 2015/2016. I don't know how to use Gradle and GitHub as I am new to this.
This is the link to the GitHub repository of the project:
https://github.com/udacity/ud839_Miwok/tree/Starter-code
I downloaded and extracted the zip file and imported the project, and have even tried importing it directly from the Version Control option. However, whenever I try to sync the project, the following error appears and the Gradle sync fails.
Incremental Java compilation is an incubating feature.
It asked me to install hundreds of files and plugins which I did but nothing works. Please help.
I know this is badly written, but there are so many different errors everytime I try to run it, I am overwhelmed.
I'm developing a project with android studio for a ODROID XU4 board. Because of the nature of the project I'm using android studio to make a native app in order to use some of the Harware features of the board as Ethernet, GPIO,... and because there is no intention of developing this for any other platform.
The problem now is that the customer wants a nice looking ionic interface.
I've been testing most of the approaches I found in google, ionic forums, stack overflow and many others sites but without success.
The nearest I've got is creating an ionic app, adding android platform and importing it to android studio.
My first question is:
1- Is this the correct approach?
My work flow is:
ionic start myapp
ionic platform add android
ionic build android
and then I import the myapp folder with android studio.
first of all I get an android studio error:
19:40:40 Migrate Project to Gradle?
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
More Information about migrating to Gradle
Don't show this message again.
19:40:41 Update Property Files
The structure of following Android modules was changed:
android
CordovaLib
Would you like to update related project.properties files?
Only once
Always for these modules
Never for these modules
19:40:44 Update Property Files
The structure of following Android modules was changed:
android
Would you like to update related project.properties files?
Only once
Always for these modules
Never for these modules
19:40:45 IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
19:48:09 Error Report: Submitted
Now its time to migrate the project to gradle:
here is the main problem, I don't know where to put the new gradle file or how to continue.
thanks.
First off: Your looking in the right direction. This is the correct approach. However, I think your problem is based on the fact that you importing the wrong folder to Android Studio.
Please import the folder "android" that is generated by ionic (cordova) in your myApp/platforms folder.
The recent Versions of cordova are using the Gradle build system. So if generated with a recent version of cordova the gradle build configuration files are already existing in that "android" folder.
By importing the myapp folder (as you did) these files are not present in your Android Studio projekt. Hence you see the error: This project does not use the Gradle build system.
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?
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.
So,
as it seems that more and more people are using Android Studio i got curious and wanted to take a peek at it.
I have used Eclipse up until now and wanted to migrate a project to Android Studio. So i exported a gradle buildfile from within Eclipse, as android.developer.com suggested.
That worked fine, now i wanted to import that into Android Studio 0.3.2
When trying to import i got that Unable to import Eclipse project to Android Studio error. Now it is building.
But it got a new suprise, now before it is finished building, its asking specifically for an older Version of Gradle(1.6)... Ok, i can do that. Which leads me right back to the first error. So i tried this - Gradle version 1.6 is required. Current version is 1.8-20130730220035+0000
I can however create a New Project with Android Studio.
I've tried this for about an hour now and im getting sort of pissed, because it doesnt seem to know what it wants. Is it some sort of Bug or did i make some sort of mistake.
You're using a very old version of Android Studio. I'd recommend upgrading to 0.4.3. Versions later than 0.4.0 allow direct import of Eclipse projects instead of requiring you to do the cumbersome (and as you've seen problematic) export of projects from Eclipse; it's smarter about setting up the right plugin and Gradle versions. 0.4.3 has some important bugfixes over 0.4.0-0.4.2.
I've just migrated my projects. Here is two suggestions from my side.
Take the latest Android Studio.
Do not export / import projects from Eclipse. Most likely you are going to have errors in the project after this step. Starting from a clean project, which builds, will safe you a lot of time and avoid unnecessary frustration.
Create an empty Android Project in Android Studio. It must build without errors (⌘ F9). The start to enhance it using official Gradle Plugin user guide.
Create libraries folder and add all libraries in there one by one. Update build.gradle dependencies as mentioned in user guide. Make sure everything builds successfully.
After all libraries build you can copy-paste sources, resources and assets from Eclipse project to corresponding folders of Android Studio project. Make sure everything build as expected.
Now you can start with more advanced configuration like ProGuard configuration, release certificates etc.
I've done it in a couple of hours. Hope this helps you too.
I have a project with in-app billing implemented. It's currently on
the market, and everything is working fine. Now that I wanted to make a new build for an update, things went upside down.
I had cleaned my project and the ImarketBillingService.java file doesn't get generated anymore. Things that I've tried:
refresh, clean, reimport a million times
checking/unchecking project builders
re-adding the IMarketBillingService.aidl file to my project
building for other API levels
adding the generated java file from an older version of my project (signing went okay, but after I've installed the apk on a device, the app immediately crashed because it couldn't find the necessary files for billing service)
I found the answer for me here:
Android Pre Compiler error on 21.0.1 android sdk
There is an issue with the Android SDK tools 21.0.1 pre-compiler. It seems to have issues with .svn folders causing the pre-compile stage to fail, preventing the processing of the IMarketBillingService.aidl file. This link has a couple of workarounds for it.
what worked for me was this instruction
If you are developing in a non-Eclipse environment: Create the following directory /src/com/android/vending/billing and copy the IInAppBillingService.aidl file into this directory.
even though I am using Eclipse Juno, this was after installing the adt-preview and android tools-preview, none of which solved the problem.
You just have to follow the non-eclipse instructions because everything is messed up right now