Error while adding Firebase to android using cordova - android

I am trying to add Firebase to the android app using Cordova to implement push notification.
so for I was able to add 'google-services.json' to the root of the project.
however when I am trying to build an android app using the command
cmd>cordova build
it's giving me following error.
Could not resolve all dependencies for configuration ':_debugApkCopy'.
Could not find com.google.firebase:firebase-core:9.0.0.
this is occurring despite adding google play services plugin to Cordova.
I am new to hybrid app building , please help me on this.thanks

You need 'Android support Repository'. Open sdk manager check weather this is installed or not. Install/Update it. If already installed, you may need to uninstall and reinstall Android support repository. then restart your PC
You may also install google play services and google repository. many plugins may require these two.

Related

Can't find solution to upgrade Stripe SDK

I am trying to publish my application to play store but I get following error.
I am new to flutter and I don't know where to upgrade this SDK as I have not included it in my build.gradle or pubspec.yaml
Error
SDK Stripe Android SDK (com.stripe:stripe-android), 10.4.6 facilitates the transmission or collection of personal and sensitive information. Such behavior must comply with Google Play's Prominent Disclosure & Consent Requirements and applicable privacy policy requirements as described in the User Data policy. You can't publish this release due to this policy issue.
To be allowed to publish, you may consider upgrading to 16.9.0, which the SDK provider has recommended for use instead. Please consult the SDK provider for further information.
I had exactly the same error in the Google Play console. It was asking to upgrade sdk to 16.9.0 meanwhile that version was aborting.
The only solution which worked in my case was upgrading SDK to 10.5.0.
implementation 'com.stripe:stripe-android:10.5.0'
It is a hot fix version which resolves the Google Play compliance issues.
Hope this will hep you.
There's a simple fix to this:
Install patch-package & add it to your post-install script
Go to node_modules/tipsi-stripe/android/build.gradle and change implementation 'com.stripe:stripe-android:10.4.6' to implementation 'com.stripe:stripe-android:10.5.0'
Re-sync gradle
Apply patch: yarn patch-package tipsi-stripe
Done!
In case anyone uses React Native, this helped me to get it updated and launched in Google Play Store: https://gitmemory.com/issue/tipsi/tipsi-stripe/785/861289460
The error was caused due to the use of stripe-payment : 1.0.9 in pubspec.yaml and simply upgrading it didn't actually solve the problem. I had to open build.gradle in a new window as android project and in the file build.gradle, implementing suggested 16.9.0 and whenever we change the build.gradle it starts re-indexing and afterwards the issue was resolved.

Ionic 3 Error: "File google-services.json is missing. The Google Services Plugin cannot function without it." in ionic cordova build/prepare android

I am trying to do an ionic cordova build android command in my Ionic 3 project and I came across an error for File google-services.json is missing. The Google Services Plugin cannot function without it.
Here is the trace in my console:
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
C:\Users\Bryan\Desktop\iSpace\iSpaceProject\platforms\android\app\src\nullnull\debug\google-services.json
C:\Users\Bryan\Desktop\iSpace\iSpaceProject\platforms\android\app\src\debug\nullnull\google-services.json
C:\Users\Bryan\Desktop\iSpace\iSpaceProject\platforms\android\app\src\nullnull\google-services.json
C:\Users\Bryan\Desktop\iSpace\iSpaceProject\platforms\android\app\src\debug\google-services.json
C:\Users\Bryan\Desktop\iSpace\iSpaceProject\platforms\android\app\src\nullnullDebug\google-services.json
C:\Users\Bryan\Desktop\iSpace\iSpaceProject\platforms\android\app\google-services.json
Many answers I found online were to download the google-services.json file and put it in my platform/android/app folder. However, as my firebase application is a Web Application, I can't download the google-services.json file from there. All I can do is to copy the firebase config over to my html page.
When I tried to search my file directory, I couldn't find any google-service.json related files as well.
Please help me with this! My aim is to be able to run the application on the android studio's emulator.
Note that my firebase application is a Web Application and cannot download the google-service.json file directly from the firebase console.
In the Firebase Console, under your project's Project Settings you will find the configuration for your application.
As your project is currently configured as a web application, you will need to initialise your project to target other platforms (such as Android).
On the right-hand side of the page about halfway down, you will find an Add app button that will allow you to choose Android, configure it and then generate the google-services.json file.
Step 1 - Open "Project Settings" and click "Add app" button
Step 2 - Choose platform - Android, in this example
Step 3 - Follow configuration wizard
I found the solution for this!
I uninstalled the cordova-support-google-services by doing cordova plugin remove cordova-support-google-services and it managed to build. I tried to run it on Android Studio as well and it worked perfectly!

Firebase console sdk setup showing as unfinished

I created an android application on Android studio 3.4.2 and integrated Firebase using the firebase assistant tool provided on Android studio.There is no problem with using the features of Firebase on the app but when going to the developer's console of Firebase and going to the project overview, it appears as if the the sdk setup is not finished ,I tried following the sdk setup steps provided and the setup won't finish at the last stage i.e, "checking if the app has communicated with our servers,you may need to uninstall and reinstall the app". I've uninstalled my app and reinstalled it but doesn't seem to be registering the app on the Firebase server.
I've tried restarting the internet, Uninstalled my app and reinstalled,made sure net connectivity are okay on both emulator and pc
Check your Firebase console projects, Is there any project with the same package name?. If there is any please remove and try again.

APKs generated through Eclipse are accepted or not?

I am a little new to Android development.
I have a hybrid app which uses Apache cordova plugins.
I am using eclipse to generate the APK.
But when I publish the APK, the Google play store rejects it saying:
APP UPDATE REJECTED
Your APK has been rejected for containing security vulnerabilities, which violates the Malicious Behavior policy. The Alerts page has more information about how to resolve the issue. If you submitted an update, the previous version of your app is still live on Google Play.
And, when I click on the alerts page the following error shows up:
Security alert :
Your app is using a version of Apache Cordova containing one or more security vulnerabilities. Please see this Google Help Center article for details, including the deadline for fixing the app.
I have already tried the followings:
Update the android platform (cordova platform update android), but no positive results.
I could not update all the cordova plugins as I am getting errors. (wanted to know can this be the issue)
I am building this APK using the Eclipse IDE and I went through this ADT plugin release note https://developer.android.com/studio/tools/sdk/eclipse-adt.html which says: The Eclipse ADT plugin is no longer supported
Eventually I will be importing my project to Android studio but I want an app update immediately thats why still using Eclipse.
If Eclipse is the reason then I immediately need to import my app to Android studio.
I want to figure out that which one of the last two point is responsible for my app rejection.
Also, if none of these are responsible then what could be the possible reason for my app rejection.
Thanks in advance.
An APK is an APK, regardless of where you developed the code. You can write the code in Eclipse, Android Studio, or you can write the code in your favorite plain text editor. The end APK will be indistinguishable regardless of which editor you use.
The error in this case seems to be pretty clear- your version of Cordova has known vulnerabilities and you need to update that.
Run cordova platform version android to check your version. The error message you are receiving will show for anything less than 4.1.1.
The best path would probably be to upgrade to 5.x, as detailed here.

GCM Demo Application's failure to register to tomcat server

i have tried and finished 90% of GCM Demo application for android from the link: http://developer.android.com/guide/google/gcm/demo.html So i would like to ask your favour for the following error. I googled and referred many websites and forums for the solution. But i could not figure it out. So please help me. Thank you.
You need to install the helper libraries and make required changes to the emulator.
Goto your android SDK folder and open SDK Manager and install Google Cloud Messaging for Android Library under Extras section. (If you don’t see Google Cloud Messaging for Android Library update your SDK manager to latest version)
After installing the library it will create gcm.jar file in your Andoird_SDK_Folder\extras\google\gcm\gcm-client\dist. Later you need to add this .jar file to your android project.
Now open your AVD Manager and create a new Google API emulator and start the emulator. (Note: To test gcm application in emulator you need to test it on Google API device only)
After launching emulator press Menu button goto Settings. Select Accounts & Sync. And then press Add Account button and add a Google account.
Finally Test your Application on Simulator.

Categories

Resources