Android App Not working with NS 8.2.
See original GitHub issueA problem occurred evaluating script. Plugin with id ‘com.google.gms.google-services’ not found.
Actions taken to resolve:
- Created a Native-script Vue project of NS 8.2.1
- After creating run the app in android emulator. It works fine.
- Added npm module @nativescript/firebase and its related google-services.json in App_resources/Android folder. Also bundle id’s are same for the firebase json and application.xml
Added
project.ext {
googlePlayServicesVersion = "+"}
in both before-plugins and app gradle. 5. Add android platform executes without any problem 6. Build fails with problem
A problem occurred evaluating script.
Plugin with id 'com.google.gms.google-services' not found.
PS: Same code works for iOS.
My Local environment Information ✔ Getting environment information
No issues were detected. ✔ Your ANDROID_HOME environment variable is set and points to correct directory. ✔ Your adb from the Android SDK is correctly installed. ✔ The Android SDK is installed. ✔ A compatible Android SDK for compilation is found. ✔ Javac is installed and is configured properly. ✔ The Java Development Kit (JDK) is installed and is configured properly. ✔ Xcode is installed and is configured properly. ✔ xcodeproj is installed and is configured properly. ✔ CocoaPods are installed. ✔ CocoaPods update is not required. ✔ CocoaPods are configured properly. ✔ Your current CocoaPods version is newer than 1.0.0. ✔ Python installed and configured correctly. ✔ The Python ‘six’ package is found. ✔ Xcode version 12.5.1 satisfies minimum required version 10. ✔ Getting NativeScript components versions information… ⚠ Update available for component nativescript. Your current version is 8.2.1 and the latest available version is 8.2.2. ✔ Component @nativescript/core has 8.2.1 version and is up to date. ✖ Component @nativescript/ios is not installed. ✔ Component @nativescript/android has 8.2.2 version and is up to date.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:42
Top GitHub Comments
@maddy2get basically what @comporell has posted above.
Your
platform/app/build.gradle
needs to haveapply plugin: "com.google.gms.google-services"
and yourplatform/build.gradle
needs to containdependencies { classpath "com.google.gms:google-services:4.3.4"}
I use an
after-prepare
hook script to write these two lines to their respective files. This is necessary for me as I use CI/CD for my builds. If you don’t use a CI/CD you can manually update the build files with the lines above. `@tylerablake Hi I had the same problem
You have to had this in Manifest (I think its because the script when insert this code in the Manifest does’t put the exported)
<service android:name="org.nativescript.plugins.firebase.MyFirebaseInstanceIDService" android:exported="false"> <intent-filter> <action android:name="com.google.firebase.INSTANCE_ID_EVENT" /> </intent-filter> </service> <service android:name="org.nativescript.plugins.firebase.MyFirebaseMessagingService" android:exported="false"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service>
PS - Sorry for my English but I’m Portuguese