Closed dpa99c closed 4 years ago
Until such time as this has been merged, you can install the fixed plugin directly off my fork:
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
@dpa99c Unable to install the fixed plugin directly off your fork: getting issues
@dpa99c Unable to install the fixed plugin directly off your fork: getting issues
Github appears to be having some stability issues right now - this is what I'm getting when trying to access https://github.com/dpa99c/cordova-plugin-firebase/tree/GH-1057-April-05-android-build-issue - may be related:
I'm getting an error:
In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[15.0.
2]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.android.gms:play-services-tagmanager-api:15.0.2 -> com.google.android.gms:play-services-m
easurement-base@[15.0.2], but play-services-measurement-base version was 15.0.4.
It's working fine for me in a test project (see console output below). If you're installing into an existing project you may need to remove/re-add the Android platform in order to rebuild the Gradle config:
cordova platform rm android --nosave && cordova platform add android --nosave
cordova platform rm android --nosave && cordova plugin add android --nosave
Works! Thank a lot.
Until such time as this has been merged, you can install the fixed plugin directly off my fork:
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
Works, Thanks!
Thank you for this fork. It's merge in the original project is urgent.
Yes please! Our builds are failing as a result.
played with this for a bit and seems to work like a gem 👍
Yes, please merge this changes ASAP.
Working here. Merge that, please.
Wow, like magic, thanks!
Works great. Thanks heaps. Merge Merge Merge.
@dpa99c sir got this error after install above command:
Error: Failed to fetch plugin https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue via registry.
Until such time as this has been merged, you can install the fixed plugin directly off my fork:
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
I have installed plugin with command:
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
But I have build issue. Can you please check ?
:preDebugBuild FAILED
FAILURE: Build failed with an exception.
What went wrong: 1
Get more help at https://help.gradle.org
BUILD FAILED in 3m 7s at ChildProcess.whenDone (/Users/test/Documents/projects/ionic/test-project/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) (node:13453) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:13453) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I have installed plugin with command:
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
But I have build issue. Can you please check ?
I have the same trouble. The same error can be found in the failed travis build https://travis-ci.org/arnesson/cordova-plugin-firebase/jobs/529225437
I have installed plugin with command:
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
But I have build issue. Can you please check ?I have the same trouble. The same error can be found in the failed travis build https://travis-ci.org/arnesson/cordova-plugin-firebase/jobs/529225437
I think it's related with cordova-android version .
I'm using cordova-android "6.4.0" version
@rhanesoghlyan Yes, seems so. I also run "6.4.0" and just tried it with "7.1.1" but this also failed. Based on the travis tests it seems to only work with "8.0.0."
@dpa99c what do you think about this ?
Does this changes will work only for cordova-android 8.0.0 version ?
This workaround works for me on cordova-android 6.4.0
https://github.com/arnesson/cordova-plugin-firebase/issues/1057#issuecomment-490418993
Regarding cordova-android@6.4.0
, I think it's worth bearing in mind that the APKs it produces will soon be inadmissible to the Play Store and therefore you should migrate to cordova-android@8.x
as soon as possible:
cordova-android@6.4.0
=> Android API Level 26 (8.0)cordova-android@7.x
=> Android API Level 27 (8.1)cordova-android@8.x
=> Android API Level 28 (9.0)https://developer.android.com/distribute/best-practices/develop/target-sdk:
Starting August 1, 2019, Google Play requires that new apps target at least Android 9.0 (API level 28), and that app updates target Android 9.0 from November 1, 2019.
Regarding
cordova-android@6.4.0
, I think it's worth bearing in mind that the APKs it produces will soon be inadmissible to the Play Store and therefore you should migrate tocordova-android@8.x
as soon as possible:
Thanks for provided information
@dpa99c : I got another error after install this plugin
Uninstalling cordova-plugin-firebase from android Error during processing of action! Attempting to revert... Uh oh! AndroidStudio.js:inAndroidStudioProject root does not exist: /Users/kapil/Desktop/project/AMS/platforms/android [ERROR] An error occurred while running subprocess cordova.
I am not understand why got above error this plugin is present in our plugin list,... com.googlemaps.ios 2.7.0 "Google Maps SDK for iOS" cordova-plugin-actionsheet 2.3.3 "ActionSheet" cordova-plugin-advanced-http 2.0.2 "Advanced HTTP plugin" cordova-plugin-android-permissions 1.0.0 "Permissions" cordova-plugin-background-mode 0.7.2 "BackgroundMode" cordova-plugin-camera 4.0.3 "Camera" cordova-plugin-datepicker 0.9.3 "DatePicker" cordova-plugin-device 2.0.2 "Device" cordova-plugin-document-viewer 0.9.10 "SitewaertsDocumentViewer" cordova-plugin-file 6.0.1 "File" cordova-plugin-file-transfer 1.7.1 "File Transfer" cordova-plugin-filepath 1.5.1 "cordova-plugin-filepath" cordova-plugin-firebase 2.0.5 "Google Firebase Plugin" cordova-plugin-geolocation 4.0.1 "Geolocation" cordova-plugin-googlemaps 2.4.4 "cordova-plugin-googlemaps" cordova-plugin-inappbrowser 3.0.0 "InAppBrowser" cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard" cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview" cordova-plugin-mauron85-background-geolocation 3.0.1 "CDVBackgroundGeolocation" cordova-plugin-network-information 2.0.1 "Network Information" cordova-plugin-request-location-accuracy 2.2.3 "Request Location Accuracy" cordova-plugin-splashscreen 4.0.3 "Splashscreen" cordova-plugin-statusbar 2.4.2 "StatusBar" cordova-plugin-telerik-imagepicker 2.2.2 "ImagePicker" cordova-plugin-uniquedeviceid 1.3.2 "UniqueDeviceID" cordova-plugin-whitelist 1.3.1 "Whitelist" cordova-sqlite-storage 2.6.0 "Cordova sqlite storage plugin" cordova.plugins.diagnostic 4.0.11 "Diagnostic" org.apache.cordova.geolocation 0.3.6 "Geolocation" i tried with with --nofetch not working.
Hey guys. If you are using version of cordova-android less then 8.0.0 you can use my forked repository
ionic cordova plugin add https://github.com/rhanesoghlyan/cordova-plugin-firebase.git#master --save
No need to change anything in platforms/ directory. It's generated directory after adding the platform.
@dpa99c :Please help. both provided git links were not able to install
https://github.com/rhanesoghlyan/cordova-plugin-firebase https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
@baluworks please do the following
ionic cordova plugin rm cordova-plugin-firebase
rm -rf platforms/
ionic cordova plugin add https://github.com/rhanesoghlyan/cordova-plugin-firebase.git#master --save
ionic cordova platform add android
ionic cordova build android
@rhanesoghlyan Thanks so much for forking a solution compatible with cordova-android 6.4.0 (as is my case). I did get past the original error that many people are reporting but, now, I have something different:
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_111681jxraufgcz3cg5gruysh.run(/home/enriquepineda/fishint_v3/platforms/android/build.gradle:148)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
:preBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:preDebugBuild FAILED
3 actionable tasks: 1 executed, 2 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Can you advise? Something about the preDebugBuild
failing... (no additional info from --stacktrace
)
@rhanesoghlyan sir i got antother error after remove fireabase plugin:
Uninstalling cordova-plugin-firebase from android
> Error during processing of action! Attempting to revert...
> Uh oh!
> AndroidStudio.js:inAndroidStudioProject root does not exist: /Users/kapil/Desktop/project/AMS/platforms/android
> [ERROR] An error occurred while running subprocess cordova.
>
> cordova plugin remove cordova-plugin-firebase --save exited with exit code 1.
Please tell me why generate above error?
@kapilSoni101 and @eppineda please do the following: rm -rf node_modules && rm -rf platforms && rm -rf plugins
And after that: ionic cordova plugin add https://github.com/rhanesoghlyan/cordova-plugin-firebase.git#master --save npm install ionic cordova platform add android ionic cordova build android
@rhanesoghlyan sir i got another error
rm: -: No such file or directory rm: rf: No such file or directory rm: platforms: is a directory
@kapilSoni101 You can instead of this command manually remove platforms, plugins and node_modules directories.
And after that add plugin and continue process
@rhanesoghlyan ok sir i will try and let you know
@rhanesoghlyan: sir i have customize the project.properties according to the firebase docs and finally i got another new error
e/FirebasePluginMessagingService.java:75: error: cannot access zzbfm
Until such time as this has been merged, you can install the fixed plugin directly off my fork:
cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
Works fine for me while building new cordova project. Thanks!
Any solution to this problem? I have tested almost all of it and I did not succeed in any solution. Here is the information from my project
@rhanesoghylan :ok sir i will contact thanks a lot sir..
Forgot to mention with approval:
In order to get your project compile successfully an upgrade to cordova-android@8.0.0
or higher might be required.
As @dpa99c mention earlier:
... the APKs
cordova-android@6.4.0
produces will soon be inadmissible to the Play Store and therefore you should migrate tocordova-android@8.x
as soon as possible
Can we expect this to be merged in the coming days? I would like to avoid setting up the fork to get back to the main project before having to actually release something :)
Hello Guys, I am having the same error. I created new cordova project for testing. Then I did the following: 1) cordova plugin add C:..\cordova-plugin-firebase-master (I added the plugin locally since I am not able to add it from url) 2) cordova platform add android@8.0.0 3) cordova build android
However, I get the same error: **Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[16.5.0,16.5.0], [16.4.0,16.4.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.**
Any suggestions please.
Hi guys, thanks for this fix!
I want to comment an error that i'm getting with this versión:
The first time that I launch the app crash with the fallowing message:
07-04 15:58:53.649 5986-5986/com.myapp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.myapp, PID: 5986 java.lang.RuntimeException: Unable to instantiate service org.apache.cordova.firebase.FirebasePluginInstanceIDService: java.lang.ClassNotFoundException: Didn't find class "org.apache.cordova.firebase.FirebasePluginInstanceIDService" on path: DexPathList[[zip file "/data/app/com.myapp-7E523fyAdaDB2oPbaq9wog==/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp-7E523fyAdaDB2oPbaq9wog==/lib/arm64, /system/lib64, /product/lib64]] at android.app.ActivityThread.handleCreateService(ActivityThread.java:3996) at android.app.ActivityThread.access$2100(ActivityThread.java:267) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1979) at android.os.Handler.dispatchMessage(Handler.java:109) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:7470) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958) Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.cordova.firebase.FirebasePluginInstanceIDService" on path: DexPathList[[zip file "/data/app/com.myapp-7E523fyAdaDB2oPbaq9wog==/base.apk"],nativeLibraryDirectories=[/data/app/com.myapp-7E523fyAdaDB2oPbaq9wog==/lib/arm64, /system/lib64, /product/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at android.app.AppComponentFactory.instantiateService(AppComponentFactory.java:103) at android.support.v4.app.CoreComponentFactory.instantiateService(CoreComponentFactory.java:68) at android.app.ActivityThread.handleCreateService(ActivityThread.java:3991) at android.app.ActivityThread.access$2100(ActivityThread.java:267) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1979) at android.os.Handler.dispatchMessage(Handler.java:109) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:7470) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
This only happen on the first launch, the next launch works fine
And this only happen with release signed apk
can we merge this?
@dpa99c , can you make some change to allow this update can merge sir?
@ThonyBG The above commits resolve the issue of the obsolete <service>
entry.
Should be good to merge now.
BTW would be great if #972 was merged too then I wouldn't need to maintain a parallel branch which uses Cocoapods to install Firebase SDK on iOS (rather than bundling it inside the plugin).
@dpa99c great job!
For someone with problems with this changes:
I set this versions in my build-extras, I'm not sure why, but it solved my build and run problems
configurations.all { resolutionStrategy { force "com.google.firebase:firebase-core:16.0.9" force "com.google.firebase:firebase-iid:18.0.0" force "com.google.android.gms:play-services-measurement-api:16.5.0" force "com.google.firebase:firebase-perf:17.0.0" force "com.google.firebase:firebase-config:17.0.0" force "com.google.firebase:firebase-messaging:18.0.0" force "com.google.android.gms:play-services-tagmanager:16.0.8" } }
This is my ionic info:
Ionic:
ionic (Ionic CLI) : 4.2.1 (/usr/local/lib/node_modules/ionic) Ionic Framework : ionic-angular 3.9.5 @ionic/app-scripts : 3.1.8
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) Cordova Platforms : android 8.0.0 Cordova Plugins : cordova-plugin-ionic-webview 4.0.1, (and 28 other plugins)
System:
Android SDK Tools : 26.1.1 (/Users/user/Library/Android/sdk) ios-deploy : 2.0.0 ios-sim : 8.0.1 NodeJS : v10.8.0 (/usr/local/Cellar/node/10.8.0/bin/node) npm : 4.1.2 OS : macOS Xcode : Xcode 10.2.1 Build version 10E1001
btw @ThonyBG it's me too 👀
@dpa99c
1) I've deleted everything ( platform, plugins & package-lock.json, node_modules ). rm -rf package-lock.json platforms/ plugins/ node_modules/
2) I've deleted cordova-plugin-firebase from both, your package.json & config.xml
3) add the forked plugin cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
4) add a fresh platform & install the needed modules cordova platforms add android && npm install
But I got error
@harshkhandelwalcs There is no detail of the cause of the error in your screenshot. Re-run the command with the --verbose
option as suggested.
@harshkhandelwalcs run ./platforms/android/gradlew build --stacktrace
to see what happen
Fixes issues cause by Firebase SDK updates on 5 April 2019 which removed deprecated API features causing Android build failures.
Resolves https://github.com/arnesson/cordova-plugin-firebase/issues/1057.