capacitor: bug: gradle add dependency to some lib project instead of app
Bug Report
Capacitor Version
đ Capacitor Doctor đ
Latest Dependencies:
@capacitor/cli: 2.4.0
@capacitor/core: 2.4.0
@capacitor/android: 2.4.0
@capacitor/electron: 2.4.0
@capacitor/ios: 2.4.0
Installed Dependencies:
@capacitor/ios not installed
@capacitor/cli 2.4.0
@capacitor/core 2.4.0
@capacitor/android 2.4.0
@capacitor/electron not installed
[success] Android looking great! đ
Platform(s)
Android
Current Behavior
yarn add cordova-plugin-firebasex npx cap sync android npx cap open android -> return error
Applying the Firebase Crashlytics plugin to a library project is unsupported.
It should only be applied to the application module of your project to enable automatic upload of obfuscation mapping files for your application.
Expected Behavior
npm install cordova-plugin-firebasex npx cap sync android build app -> sucessful build
Code Reproduction
Other Technical Details
npx cap open android output: error in android studio
Additional Context
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 9
- Comments: 37 (6 by maintainers)
I successfully managed to fix it doing the following
go to file node_modules/cordova-plugin-firebasex/src/android/build.gradle and comment out line 10 and from line 20 to 36
go to android/build.gradle and add
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'in the dependenciesgo to android/app/capacitor.build.gradle and add the commented code from firebase plugin and change apply plugin to
apply plugin: 'com.google.firebase.crashlytics'copy google-services.json file to android/app
add accent color by creating color.xml file in android/app/main/res/values/
Build the project
Source: https://firebase.google.com/docs/crashlytics/get-started?platform=android
Is there any way to just make my code compile? I need to complete the migration. If you can suggest just a workaround Iâll be glad⌠at least for a while. Iâve migrated to the capacitor because the File API doesnât work as expected.
Thatâs the bad of taking a serious decision like that and depend on such a thing that is supposed to has a community!!
I donât know for how long people will suffer from such plugins and breaking changes!
Unlucky those who have a broken app right now. I donât know what to say!
Same problem after integrating FB login
Count me in for a solution to this. I love the firebaseX plugin, as Iâve worked with it on V3 apps, but on V5 with Capacitor is not working at all.
Another one that points to this problem, performing an installation with the latest versions and following the documentation step by step. Without adding any additional code, just adding FirebaseX (Capacitor) or Firebase or Firebase-authentication, this error appears.
I have no idea, I faced the same issue last week and found these two issues on Github.
Iâve faced the same problem. Iâm migrating an app from Ionic 3 to Ionic 5. So I did the following
cordova plugin remove cordova-plugin-firebasex npx cap syncIn Android Studio:
In this step Gradle synced and I had no errors.
So I did:
cordova plugin add cordova-plugin-firebasex npx cap syncSo i had:
`Executing tasks: [clean] in project /Users/fsmalaquias/projects/capacitor/vistorias-saphyr/android
AGPBI: {âkindâ:âwarningâ,âtextâ:âUsing flatDirs should be avoided because it doesnât support any meta-data formats.\nCurrently detected usages:\n- repository flatDir used in: project â:appâ, project â:capacitor-cordova-android-pluginsââ,âsourcesâ:[{}]} AGPBI: {âkindâ:âwarningâ,âtextâ:âPlease remove usages of
jcenter()Maven repository from your build scripts and migrate your build to other Maven repositories.\nThis repository is deprecated and it will be shut down in the future.\nSee http://developer.android.com/r/tools/jcenter-end-of-service for more information.\nCurrently detected usages in: root project âandroidâ, project â:appâ, project â:capacitor-androidâ, âŚâ,âsourcesâ:[{}]}BUILD SUCCESSFUL in 252ms 4 actionable tasks: 4 up-to-date
Build Analyzer results available`
With some warnings but it 's ok
Yes I do have the same issue and I initially ran out from cordova because of errors like thay, and I found capacitor has problems with Firebase too.
Why is there isnât staright forward official plugin for firebase that works well without any issues!
Same issue here too, starting from ionic blank app using Capacitor@latest and firebasex cordova plugin@latest+firebasex ionic native@latest âŚ
Same problem here.
Same issue for me trying move from Cordova to Capacitor. No problems in Cordova.