Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(Firebase Databse in Unity) missing classes.jar in Temp during build for Android

I am using Firebase Database in my Unity project, but I am having some issues when building the project for android. It runs fine in the unity player, but when I try to build and run for android, I get the following error message. enter image description here

I have double checked that the Firebase SDK is imported correctly.

The console outputs this error;

IOException: Failed to Move File / Directory from 'Temp/StagingArea\android-libraries\firebase-core-11.2.0\classes.jar' to 'Temp/StagingArea\android-libraries\firebase-core-11.2.0\libs\classes.jar'.

After checking the Temp folder I see that these files does indeed not exist. Should these files be generated during build? Am I missing something?

like image 522
Simon Olsen Avatar asked Sep 09 '17 11:09

Simon Olsen


1 Answers

In your build settings change it from Internal to Gradle and then add a build.gradle file to your root folder

Here's a sample build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}
like image 77
Dezinated Avatar answered Oct 19 '22 07:10

Dezinated