Nativescript-plugin-firebase: Angular + NativeScript on Android

Created on 8 Jun 2016  路  7Comments  路  Source: EddyVerbruggen/nativescript-plugin-firebase

Sadly, the instructions for Android installation within a NativeScript app built using Angular don't work as the app structure is different when you create an Android app. For one thing, there's no app.gradle file in app/App_Resources/Android in this type of app. I try to build, but we get all kind of errors. could you take a look at the angular-firebase branch here: http://www.github.com/nativescript/sample-Groceries

thanks!

Most helpful comment

OMG got it working!
PR sent.

JS: firebase.init done
JS: Page loaded
JS: BOOTSTRAPPING...
JS: Setting DOM
JS: Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
JS: ANGULAR BOOTSTRAP DONE.
JS: --- auth state changed: com.google.android.gms.internal.zzadg@5fccb6f
JS: --- user: null
JS: --- auth state changed: com.google.android.gms.internal.zzadg@5fccb6f
JS: --- user: com.google.android.gms.internal.zzadh@3e04dc12
JS: --- auth state changed: com.google.android.gms.internal.zzadg@5fccb6f
JS: --- user: com.google.android.gms.internal.zzadh@3e04dc12

All 7 comments

Just to note, the specific error I鈥檓 getting at this point is

W/GooglePlayServicesUtil( 2177): Cannot find Google Play services package name.
W/GooglePlayServicesUtil( 2177): android.content.pm.PackageManager$NameNotFoundException: com.google.android.gms
W/GooglePlayServicesUtil( 2177):     at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:114)
D/FirebaseApp( 2177): Initialized class com.google.firebase.auth.FirebaseAuth.
W/GooglePlayServicesUtil( 2177): Google Play services is missing.

Which is confusing because I _think_ I have everything needed set up. We committed the appropriate native files to help debug this. See https://github.com/NativeScript/sample-Groceries/tree/angular-firebase/platforms/android.

I will take a deeper look tomorrow, but for now:

hi, I did the above changes and ran the command:

:config phase: createDefaultIncludeFiles
+found plugins: nativescript-plugin-firebase
{
"F0" {
dimension "nativescriptpluginfirebase"
}
}
} +found plugins: tns-core-modules-widgets
{
"F1" {
dimension "tnscoremoduleswidgets"
}
} }
:config phase: createPluginsConfigFile
Creating product flavors include.gradle file in /Users/Looper/Documents/NativeScript/sample-Groceries/platforms/android/configurations folder...

:config phase: pluginExtend
+applying configuration from: /Users/Looper/Documents/NativeScript/sample-Groceries/platforms/android/configurations/include.gradle
+applying configuration from: /Users/Looper/Documents/NativeScript/sample-Groceries/platforms/android/configurations/nativescript-plugin-firebase/include.gradle
+applying configuration from: /Users/Looper/Documents/NativeScript/sample-Groceries/platforms/android/configurations/tns-core-modules-widgets/include.gradle

:config phase: copyAarDependencies

:config phase: addAarDependencies
+adding dependency: /Users/Looper/Documents/NativeScript/sample-Groceries/platforms/android/libs/aar/widgets-release.aar

FAILURE: Build failed with an exception.

  • What went wrong:
    Project 'app' not found in root project 'groceries'.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 9.878 secs

@jlooper Did you have the same error as @tjvantoll or did you see something like com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536?

I'm seeing that one and need to add MultiDex to fix that.

I will be looking more into this in a few hours.

I see different errors, as I did add MultiDex prior as per the instructions. Ain't Android great? I'll paste the errors in a bit after my commute...

OMG got it working!
PR sent.

JS: firebase.init done
JS: Page loaded
JS: BOOTSTRAPPING...
JS: Setting DOM
JS: Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
JS: ANGULAR BOOTSTRAP DONE.
JS: --- auth state changed: com.google.android.gms.internal.zzadg@5fccb6f
JS: --- user: null
JS: --- auth state changed: com.google.android.gms.internal.zzadg@5fccb6f
JS: --- user: com.google.android.gms.internal.zzadh@3e04dc12
JS: --- auth state changed: com.google.android.gms.internal.zzadg@5fccb6f
JS: --- user: com.google.android.gms.internal.zzadh@3e04dc12

images duckduckgo
also, to get Google Play services on your Android emulators so you can test, it's super fun: https://inthecheesefactory.com/blog/how-to-install-google-services-on-genymotion/en

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NNieto picture NNieto  路  4Comments

romandragan picture romandragan  路  3Comments

ButterMeWaffle picture ButterMeWaffle  路  4Comments

EddyVerbruggen picture EddyVerbruggen  路  3Comments

bunower picture bunower  路  3Comments