Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Build failed on NativeScript 2.0.1 #41

Closed
mi6crazyheart opened this issue Jun 3, 2016 · 16 comments
Closed

Build failed on NativeScript 2.0.1 #41

mi6crazyheart opened this issue Jun 3, 2016 · 16 comments

Comments

@mi6crazyheart
Copy link

HI,
After adding this plugin I'm getting following error when I'm trying to build my app by using tns run android command.

Error -

firebase-error-cropped

@EddyVerbruggen
Copy link
Owner

Doesn't look like a plugin-specific error to me. Can you try removing and adding the Android platform?

tns platform remove android && tns platform add android

If that doesn't help please test on a new project.

@mi6crazyheart
Copy link
Author

@EddyVerbruggen : Thanks for your quick reply. But, after running tns platform remove android && tns platform add android command now I'm getting following error.

firebase-error-cropped

I'm new to nativeScript. So, don't know a lot. But, before adding this plugin my app was working properly. Just only after adding this one. I've started getting this error.

@EddyVerbruggen
Copy link
Owner

Never seen this one. Perhaps others reading this have an idea?

@mi6crazyheart
Copy link
Author

mi6crazyheart commented Jun 3, 2016

I've no idea what's happening. I have a working copy which I took as a backup before adding this plugin. Which works fine. But, after adding this plugin only.. something is happening & whole build process is failed. Already 2 times I've done this thing & I'm getting same behaviour each time.

I'm also getting following error with above one. May this will do any kind of help.

firebase-error-1

@441N143G
Copy link

441N143G commented Jun 3, 2016

It seems multiDex error. U can add multiDex(multiDexEnabled true) supprot in your app.gradle. something like this:
android {
defaultConfig {
applicationId "com.mysite.myproj"
generatedDensities = []
multiDexEnabled true
}
....
But u need read what is it. *But I dont remember what u need to do for support android versions below 5.0 - google)

@441N143G
Copy link

441N143G commented Jun 3, 2016

*and rebuild project

@mi6crazyheart
Copy link
Author

@441N143G : Thanks a lot for patience & helping hand. Finally, your above suggestion multiDexEnabled true did the job. Now, previous firebase error Cannot read property 'firebase' of undefined also resolved.

By the way, what's is this multiDex thing? Why was it shown to me? Is anything wrong in my development?

Man, you just made my day. From last 2 days, I was struggling with this & as I'm using NativeScript with AngularJS2 which is still in testing phase today I thought to give up this R&D on NativeScript as long as AngualrJS2 will not production ready.

But, now I can move ahead. By the way, I'm from India. Bug me whenever you'll be at here. I'll buy you a beer.

@441N143G
Copy link

441N143G commented Jun 3, 2016

you are welcome :-) about multiDex: https://developer.android.com/studio/build/multidex.html

@mi6crazyheart
Copy link
Author

Have you also added that multiDexEnabled true in your test app & Shall this thing should be mentioned in Plugin doc ?

@EddyVerbruggen
Copy link
Owner

NativeScript issue related to this phenomenon: NativeScript/android#344

@441N143G
Copy link

441N143G commented Jun 3, 2016

In test app - yes. This is not plugin fail, but if author will put few lines about this issue in readMe - will be great)

@mi6crazyheart
Copy link
Author

All right. Thanks a lot for your support people. I'm closing this issue now.

@EddyVerbruggen
Copy link
Owner

Added a note to the readme, thx! 👍

@LakshmiEvana
Copy link

HI,
After adding this plugin I'm getting following error when I'm trying to build my app by using tns run android command.

Error -
Command E:\Native Script\firebasetest3\platforms\android\gradlew.bat failed with
exit code 1
Help me please!

@dameety
Copy link

dameety commented Oct 24, 2016

Facing this issue too, right now, but this solution does not work for me. removing and adding platform android, enabling multidex.

@lumayara
Copy link

lumayara commented Aug 3, 2018

I am facing the same issue. I already added the reference path to firebase.d.ts on references.d.ts, also already added :

multiDexEnabled = true

on app.graddle and still get

JS: Error in firebase.init: TypeError: Cannot read property 'getInstance' of undefined

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants