bug: gradle add dependency to some lib project instead of app
See original GitHub issueBug 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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:37 (6 by maintainers)
Top Results From Across the Web
bug: gradle add dependency to some lib project instead of ...
bug : gradle add dependency to some lib project instead of app · Issue #3376 · ionic-team/capacitor · Bug Report Capacitor Version Capacitor...
Read more >Add build dependencies - Android Developers
Gradle declares dependencies on JAR files inside your project's module_name /libs/ directory (because Gradle reads paths relative to the build.gradle file).
Read more >How do I add a library project to Android Studio?
Right click on the app folder -> Open Module settings -> go to the dependencies tab -> Click on the '+' button ->...
Read more >Declaring dependencies - Gradle User Manual
Every dependency declared for a Gradle project applies to a specific scope. For example some dependencies should be used for compiling source code...
Read more >Downgrading versions and excluding dependencies
Gradle resolves any dependency version conflicts by selecting the latest version found in the dependency graph. Some projects might need to divert from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.