I create a fresh nativescript project according to this article by running these commands:
tns create fitApp --appid "..."
cd fitApp
tns plugin add nativescript-plugin-firebase
tns run android
and changed AndroidManifest.xml accordingly and put google-services.json as it said.but i get this error:
Could not find support-compat.jar (com.android.support:support-compat:28.0.0).
Searched in the following locations:
https://maven.google.com/com/android/support/support-compat/28.0.0/support-compat-28.0.0.jar
this is my package.json:
{
"nativescript": {
"id": "...",
"tns-android": {
"version": "5.2.1"
},
"tns-ios": {
"version": "5.2.0"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"#angular/animations": "~7.2.0",
"#angular/common": "~7.2.0",
"#angular/compiler": "~7.2.0",
"#angular/core": "~7.2.0",
"#angular/forms": "~7.2.0",
"#angular/http": "~7.2.0",
"#angular/platform-browser": "~7.2.0",
"#angular/platform-browser-dynamic": "~7.2.0",
"#angular/router": "~7.2.0",
"nativescript-angular": "~7.2.1",
"nativescript-plugin-firebase": "^8.1.1",
"nativescript-theme-core": "~1.0.4",
"reflect-metadata": "~0.1.12",
"rxjs": "~6.3.0",
"tns-core-modules": "~5.2.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"#angular/compiler-cli": "~7.2.0",
"#nativescript/schematics": "~0.5.0",
"#ngtools/webpack": "~7.2.0",
"nativescript-dev-typescript": "~0.8.0",
"nativescript-dev-webpack": "~0.20.0"
},
"gitHead": "f548ec926e75201ab1b7c4a3a7ceefe7a4db15af",
"readme": "NativeScript Application"
}
build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Related
Could not find method compile() for arguments [{name=barcodescanner-release-2.1.5, ext=aar}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
It should open android studio normally to build app but it gives me that error
here is my package.json
`
{
"name": "test-barcode",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"lint": "ng lint"
},
"private": true,
"dependencies": {
"#angular/common": "^14.0.0",
"#angular/core": "^14.0.0",
"#angular/forms": "^14.0.0",
"#angular/platform-browser": "^14.0.0",
"#angular/platform-browser-dynamic": "^14.0.0",
"#angular/router": "^14.0.0",
"#awesome-cordova-plugins/barcode-scanner": "^6.2.0",
"#awesome-cordova-plugins/core": "^6.2.0",
"#capacitor/android": "4.5.0",
"#capacitor/app": "4.1.0",
"#capacitor/core": "4.5.0",
"#capacitor/haptics": "4.0.1",
"#capacitor/keyboard": "4.0.1",
"#capacitor/status-bar": "4.0.1",
"#ionic/angular": "^6.1.9",
"ionicons": "^6.0.3",
"phonegap-plugin-barcodescanner": "^8.1.0",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^14.0.0",
"#angular-eslint/builder": "^14.0.0",
"#angular-eslint/eslint-plugin": "^14.0.0",
"#angular-eslint/eslint-plugin-template": "^14.0.0",
"#angular-eslint/template-parser": "^14.0.0",
"#angular/cli": "^14.0.0",
"#angular/compiler": "^14.0.0",
"#angular/compiler-cli": "^14.0.0",
"#angular/language-service": "^14.0.0",
"#capacitor/cli": "4.5.0",
"#ionic/angular-toolkit": "^6.0.0",
"#types/jasmine": "~4.0.0",
"#types/node": "^12.11.1",
"#typescript-eslint/eslint-plugin": "5.3.0",
"#typescript-eslint/parser": "5.3.0",
"eslint": "^7.6.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "30.7.6",
"eslint-plugin-prefer-arrow": "1.2.2",
"jasmine-core": "~4.3.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"ts-node": "~8.3.0",
"typescript": "~4.7.2"
},
"description": "An Ionic project"
}
`
and home-page.ts
`
import { Component } from '#angular/core';
import { BarcodeScanner } from '#awesome-cordova-plugins/barcode-scanner/ngx';
#Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
content: any;
constructor(private barcodeScanner: BarcodeScanner) {}
barcode(){
this.barcodeScanner.scan().then(barcodeData => {
console.log('Barcode data', barcodeData);
}).catch(err => {
console.log('Error', err);
});
}
}
`
and this is build.gradle
`
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "io.ionic.starter"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
implementation project(':capacitor-android')
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')
}
apply from: 'capacitor.build.gradle'
try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}
`
I think you did everything correctly, I followed your steps and I managed to solve my issue, which was very similar to yours.
The error you are facing should be due to the fact that the plugin uses the old way of including native Android libraries by using compile instead of implementation.
The solution is well explained within this post, where the user Loiic says:
You can change it manually (in Project Structure > Dependencies tab) the
field “configuration” of the the dependency barcodescanner to switch
from “compile” to “implementation”.
Make it a try and see if it works also for you 😉.
Thank you.
I am working in a old react native project. I am getting errors while running this app. How I can solve these errors. First time I am working in a old react native project. This app build in react native old version. I update this in to version. Please help me.
// My package.json ==>
"name": "unknown",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start",
"flow": "flow --show-all-errors",
"flow start": "flow start",
"flow stop": "flow stop",
"flow status": "flow status",
"flow coverage": "flow coverage",
"eslint": "eslint",
"eslint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
"build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'"
},
"dependencies": {
"#react-native-community/cli-platform-android": "^9.1.0",
"babel-plugin-transform-remove-console": "6.9.4",
"braces": "^2.3.2",
"crypto-js": "4.1.1",
"currency-formatter": "1.5.9",
"d3": "7.3.0",
"d3-array": "3.1.1",
"d3-scale": "4.0.2",
"d3-shape": "3.1.0",
"moment": "^2.29.4",
"react": "^17.0.2",
"react-dom": "^18.2.0",
"react-native": "^0.69.5",
"react-native-appstore-version-checker": "3.0.0",
"react-native-device-info": "^10.1.1",
"react-native-dropdownalert": "4.5.1",
"react-native-elements": "3.4.2",
"react-native-fabric": "^0.5.2",
"react-native-fingerprint-scanner": "6.0.0",
"react-native-gesture-handler": "^2.6.0",
"react-native-keychain": "8.0.0",
"react-native-loading-spinner-overlay": "3.0.0",
"react-native-maps": "0.30.1",
"react-native-modal-datetime-picker": "13.0.1",
"react-native-pathjs-charts": "0.0.30",
"react-native-segmented-control-tab": "4.0.0",
"react-native-sentry": "0.43.2",
"react-native-simple-dialogs": "1.4.0",
"react-native-svg": "12.3.0",
"react-native-table-component": "1.2.2",
"react-native-vector-icons": "9.1.0",
"react-navigation": "4.4.4",
"react-redux": "7.2.6",
"realm": "10.13.0",
"redux": "4.1.2",
"redux-logger": "3.0.6",
"redux-thunk": "2.4.1"
},
"devDependencies": {
"#babel/core": "7.17.5",
"#babel/plugin-proposal-class-properties": "7.16.7",
"#babel/plugin-transform-runtime": "7.17.0",
"#babel/preset-env": "7.16.11",
"#babel/preset-react": "7.16.7",
"babel-cli": "6.26.0",
"babel-eslint": "10.1.0",
"babel-jest": "27.5.1",
"babel-plugin-module-resolver": "4.1.0",
"babel-preset-flow": "6.23.0",
"babel-preset-react-native": "2.1.0",
"eslint": "8.10.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "8.5.0",
"eslint-import-resolver-babel-module": "5.3.1",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.29.3",
"flow-bin": "0.173.0",
"invariant": "2.2.4",
"jest": "27.5.1",
"metro-react-native-babel-preset": "0.69.0",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
},
"rnpm": {
"assets": [
"./assets/fonts/"
]
}
}
//project level gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
//My gradle.app file ==>
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:'
}
}
apply plugin: "com.android.application"
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
google()
}
When I try to run android app getting this below error->
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not resolve project :realm.
Required by:
project :app
> No matching configuration of project :realm was found. The consumer was configured to find a runtime of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.2.1' but:
- None of the consumable configurations have attributes.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
I am triying to add push-notification in my ionic mobile application with capacitor but as soon as I install the npm package for push-notification npm install #capacitor/push-notifications i am not longer able to build my app in android studio and i get the error :
../node_modules#capacitor\push-notifications\android\src\main\java\com\capacitorjs\plugins\pushnotifications\MessagingService.java:7: error: cannot access Service
public class MessagingService extends FirebaseMessagingService {
^
class file for android.app.Service not found
This is my package.json file:
{
"name": "push-notifications-app",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/common": "^14.0.0",
"#angular/core": "^14.0.0",
"#angular/forms": "^14.0.0",
"#angular/platform-browser": "^14.0.0",
"#angular/platform-browser-dynamic": "^14.0.0",
"#angular/router": "^14.0.0",
"#capacitor/android": "4.0.1",
"#capacitor/app": "4.0.1",
"#capacitor/core": "4.0.1",
"#capacitor/haptics": "4.0.1",
"#capacitor/keyboard": "4.0.1",
"#capacitor/push-notifications": "^4.0.1",
"#capacitor/status-bar": "4.0.1",
"#ionic/angular": "^6.1.9",
"rxjs": "~6.6.0",
"tslib": "^2.2.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^14.0.0",
"#angular-eslint/builder": "~13.0.1",
"#angular-eslint/eslint-plugin": "~13.0.1",
"#angular-eslint/eslint-plugin-template": "~13.0.1",
"#angular-eslint/template-parser": "~13.0.1",
"#angular/cli": "^14.0.0",
"#angular/compiler": "^14.0.0",
"#angular/compiler-cli": "^14.0.0",
"#angular/language-service": "^14.0.0",
"#capacitor/cli": "4.0.1",
"#ionic/angular-toolkit": "^6.0.0",
"#types/jasmine": "~3.6.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"#typescript-eslint/eslint-plugin": "5.3.0",
"#typescript-eslint/parser": "5.3.0",
"eslint": "^7.6.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "30.7.6",
"eslint-plugin-prefer-arrow": "1.2.2",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"typescript": "~4.7.3"
},
"description": "An Ionic project"
}
My build.gradle file(android)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply from: "variables.gradle"
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My build.gradle file(android.app)
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "io.ionic.starter"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName '1.0.0-1'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation project(':capacitor-android')
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')
}
apply from: 'capacitor.build.gradle'
try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}
I had the same problem. I fix it downgrading the capacitor push notifications package version to 1.0.9
npm i #capacitor/push-notifications#1.0.9
npx cap sync android
And including this dependencies to my build.gradle file
implementation platform("com.google.firebase:firebase-bom:30.1.0")
implementation("com.google.firebase:firebase-iid")
i had the same problem too. And resolve it by removing #capacitor-community/fcm and installing #capacitor/push-notifications version 1.0.9 . Also you have to add google-services.json in android/app or android
My APP was running fine but while I tried a new installation it shows the error - Task :react-native-camera:compileGeneralDebugJavaWithJavac FAILED. Below code might help you to address the issue.
My package.json is given below:
{
"name": "app name",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"#react-native-community/async-storage": "^1.7.1",
"axios": "^0.18.1",
"native-base": "^2.13.12",
"react": "16.8.3",
"react-native": "^0.62.2",
"react-native-animatable": "^1.3.2",
"react-native-camera": "^2.11.0",
"react-native-modalbox": "^1.7.1",
"react-native-qrcode-scanner": "^1.2.1",
"react-native-search-filter": "^0.1.4",
"react-native-vector-icons": "^6.5.0",
"react-native-webview": "5.8.1",
"react-navigation": "^2.18.3",
"url": "^0.11.0"
},
"devDependencies": {
"#babel/core": "7.4.5",
"#babel/runtime": "7.4.5",
"babel-jest": "^26.0.1",
"jest": "^26.0.1",
"metro-react-native-babel-preset": "^0.54.1",
"react-native-dotenv": "^0.2.0",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
},
"rnpm": {
"assets": [
"./assets/fonts/"
]
}
}
android/build.gradle
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.4.0")
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
I have no clue on this error. Any help???
I think you have some linking problem.
I just faced same problem and solved it on React-Native v0.6,here's my solution:
JUST FOLLOWING THIS TUTORIAL
EXECUTE THIS `react-native run-android --no-jetifier
`
the question which I'm gonna ask was had been asked here, here and here. Unfortunately, no one worked for me.
I'm currently working on an ionic4 application and trying to run the app on Android. I need to use both FCM and firebase phone authentication from firebase services. Firstly, I have added FCM to the project, it builds and worked fine, however, after adding the firebase phone authentication plugin using below commands using from this :
ionic cordova plugin add cordova-plugin-firebase --save
npm install angularfire2 firebase --save
Now I'm going to provide some codes:
project.properties:
target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0
cordova.system.library.2=com.android.support:support-v4:24.1.1+
cordova.system.library.3=com.android.support:support-annotations:27.+
cordova.system.library.4=com.google.firebase:firebase-core:10.+
cordova.system.library.5=com.google.firebase:firebase-messaging:10.+
cordova.gradle.include.1=cordova-plugin-fcm-with-dependecy-updated/raihan-FCMPlugin.gradle
cordova.gradle.include.2=cordova-support-google-services/raihan-build.gradle
cordova.system.library.6=com.google.firebase:firebase-auth:16.1.+
Package.json
{
"name": "raihan",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/common": "^7.2.2",
"#angular/core": "^7.2.2",
"#angular/forms": "^7.2.2",
"#angular/http": "^7.2.2",
"#angular/platform-browser": "^7.2.2",
"#angular/platform-browser-dynamic": "^7.2.2",
"#angular/router": "^7.2.2",
"#ionic-native/camera": "^5.5.1",
"#ionic-native/core": "^5.0.0",
"#ionic-native/fcm": "^5.5.1",
"#ionic-native/file": "^5.5.1",
"#ionic-native/file-path": "^5.5.1",
"#ionic-native/file-transfer": "^5.5.1",
"#ionic-native/firebase-authentication": "^5.5.1",
"#ionic-native/http": "^5.5.1",
"#ionic-native/ionic-webview": "^5.5.1",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic/angular": "^4.1.0",
"#ionic/pro": "2.0.4",
"#ionic/storage": "^2.2.0",
"#types/jquery": "^3.3.29",
"angularfire2": "^5.1.3",
"cordova-android": "7.1.4",
"cordova-browser": "5.0.4",
"cordova-plugin-advanced-http": "^2.0.9",
"cordova-plugin-camera": "^4.0.3",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-fcm-with-dependecy-updated": "^2.4.0",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-filepath": "^1.5.5",
"cordova-plugin-firebase-authentication": "^1.1.2",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-ionic-webview": "^4.0.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-sqlite-storage": "^3.2.0",
"cordova-support-android-plugin": "^1.0.1",
"cordova-support-google-services": "^1.3.1",
"core-js": "^2.5.4",
"firebase": "^6.0.2",
"jquery": "^3.4.1",
"rxjs": "~6.5.1",
"tslib": "^1.9.0",
"zone.js": "~0.8.29"
},
"devDependencies": {
"#angular-devkit/architect": "~0.13.8",
"#angular-devkit/build-angular": "~0.13.8",
"#angular-devkit/core": "~7.3.8",
"#angular-devkit/schematics": "~7.3.8",
"#angular/cli": "~7.3.8",
"#angular/compiler": "~7.2.2",
"#angular/compiler-cli": "~7.2.2",
"#angular/language-service": "~7.2.2",
"#ionic/angular-toolkit": "~1.5.1",
"#ionic/lab": "^1.0.24",
"#types/jasmine": "~2.8.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~12.0.0",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~8.1.0",
"tslint": "~5.16.0",
"typescript": "~3.1.6"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-advanced-http": {},
"cordova-sqlite-storage": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-file-transfer": {},
"cordova-plugin-camera": {},
"cordova-plugin-file": {},
"cordova-plugin-filepath": {},
"cordova-plugin-fcm-with-dependecy-updated": {},
"cordova-plugin-firebase-authentication": {
"FIREBASE_AUTH_VERSION": "16.1.+"
}
},
"platforms": [
"browser",
"android"
]
}
}
Build.gradle
buildscript {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
//This replaces project.properties w.r.t. build settings
project.ext {
defaultBuildToolsVersion="27.0.1" //String
defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Change the following:
maven
{
url "https://maven.google.com"
}
into this:
google()
and at the bottom of the build.gradle add:
apply plugin: 'com.google.gms.google-services'
in buildscript replace your code with :
repositories {
google()
jcenter()
}
below in allprojects:
allprojects {
repositories {
google()
jcenter()
}
}