baronha / react-native-multiple-image-picker

🏞 react-native-multiple-image-picker enables applications to pick images and videos from multiple smart albums in iOS/Android, similar to the current Facebook app.
MIT License
393 stars 106 forks source link

npm run android: Manifest merger failed error on task ':app:processDebugManifest' #4

Closed mparramont closed 3 years ago

mparramont commented 3 years ago

Hi!

I'm integrating this library on our app, www.abillion.com. On iOS it works great, but trying to run it on Android gives me the following error:

Error log

```shell ▶ npm run android > abvmobile@2.0.0 android > react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 4266 file(s) to forward-jetify. Using 12 workers... info JS server already running. info Installing the app... Starting a Gradle Daemon (subsequent builds will be faster) > Configure project :react-native-firebase_analytics :react-native-firebase_analytics package.json found at /Users/mparramon/projects/mobile/node_modules/@react-native-firebase/analytics/package.json :react-native-firebase_app package.json found at /Users/mparramon/projects/mobile/node_modules/@react-native-firebase/app/package.json :react-native-firebase_analytics:firebase.bom using default value: 26.6.0 :react-native-firebase_analytics package.json found at /Users/mparramon/projects/mobile/node_modules/@react-native-firebase/analytics/package.json :react-native-firebase_analytics:version set from package.json: 11.0.0 (11,0,0 - 11000000) :react-native-firebase_analytics:android.compileSdk using custom value: 29 :react-native-firebase_analytics:android.targetSdk using custom value: 29 :react-native-firebase_analytics:android.minSdk using custom value: 16 :react-native-firebase_analytics:reactNativeAndroidDir /Users/mparramon/projects/mobile/node_modules/react-native/android > Configure project :react-native-firebase_app :react-native-firebase_app package.json found at /Users/mparramon/projects/mobile/node_modules/@react-native-firebase/app/package.json :react-native-firebase_app:firebase.bom using default value: 26.6.0 :react-native-firebase_app:play.play-services-auth using default value: 19.0.0 :react-native-firebase_app package.json found at /Users/mparramon/projects/mobile/node_modules/@react-native-firebase/app/package.json :react-native-firebase_app:version set from package.json: 11.0.0 (11,0,0 - 11000000) :react-native-firebase_app:android.compileSdk using custom value: 29 :react-native-firebase_app:android.targetSdk using custom value: 29 :react-native-firebase_app:android.minSdk using custom value: 16 :react-native-firebase_app:reactNativeAndroidDir /Users/mparramon/projects/mobile/node_modules/react-native/android > Configure project :react-native-firebase_iid :react-native-firebase_iid package.json found at /Users/mparramon/projects/mobile/node_modules/@react-native-firebase/iid/package.json :react-native-firebase_app package.json found at /Users/mparramon/projects/mobile/node_modules/@react-native-firebase/app/package.json :react-native-firebase_iid:firebase.bom using default value: 26.6.0 :react-native-firebase_iid package.json found at /Users/mparramon/projects/mobile/node_modules/@react-native-firebase/iid/package.json :react-native-firebase_iid:version set from package.json: 11.2.0 (11,2,0 - 11002000) :react-native-firebase_iid:android.compileSdk using custom value: 29 :react-native-firebase_iid:android.targetSdk using custom value: 29 :react-native-firebase_iid:android.minSdk using custom value: 16 :react-native-firebase_iid:reactNativeAndroidDir /Users/mparramon/projects/mobile/node_modules/react-native/android > Configure project :react-native-firebase_remote-config :react-native-firebase_remote-config package.json found at /Users/mparramon/projects/mobile/node_modules/@react-native-firebase/remote-config/package.json :react-native-firebase_app package.json found at /Users/mparramon/projects/mobile/node_modules/@react-native-firebase/app/package.json :react-native-firebase_remote-config:firebase.bom using default value: 26.6.0 :react-native-firebase_remote-config package.json found at /Users/mparramon/projects/mobile/node_modules/@react-native-firebase/remote-config/package.json :react-native-firebase_remote-config:version set from package.json: 11.0.0 (11,0,0 - 11000000) :react-native-firebase_remote-config:android.compileSdk using custom value: 29 :react-native-firebase_remote-config:android.targetSdk using custom value: 29 :react-native-firebase_remote-config:android.minSdk using custom value: 16 :react-native-firebase_remote-config:reactNativeAndroidDir /Users/mparramon/projects/mobile/node_modules/react-native/android > Configure project :react-native-push-notification WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed in version 5.0 of the Android Gradle plugin. For more information, see http://d.android.com/r/tools/update-dependency-configurations.html. WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'. It will be removed in version 5.0 of the Android Gradle plugin. For more information, see http://d.android.com/r/tools/update-dependency-configurations.html. WARNING: The specified Android SDK Build Tools version (28.0.3) is ignored, as it is below the minimum supported version (29.0.2) for Android Gradle Plugin 4.0.1. Android SDK Build Tools 29.0.2 will be used. To suppress this warning, remove "buildToolsVersion '28.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools. The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build. This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal. Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects. If the parent project does not need the plugin, add 'apply false' to the plugin line. See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl The Kotlin plugin was loaded in the following projects: ':baronha_react-native-multiple-image-picker', ':react-native-webview' > Task :app:processDebugManifest FAILED See http://g.co/androidstudio/manifest-merger for more information about the manifest merger. ReactNativeFirebase WARNING: NPM package '@react-native-firebase/iid' depends on '@react-native-firebase/app' v11.2.0 but found v11.0.0, this might cause build issues or runtime crashes. Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings 240 actionable tasks: 235 executed, 5 up-to-date /Users/mparramon/projects/mobile/android/app/src/main/AndroidManifest.xml:31:13-69 Error: Attribute activity#com.yalantis.ucrop.UCropActivity@theme value=(@style/Theme.AppCompat.Light.NoActionBar) from [:react-native-image-crop-picker] AndroidManifest.xml:31:13-69 is also present at [com.github.LuckSiege.PictureSelector:picture_library:v2.6.0] AndroidManifest.xml:66:13-58 value=(@style/Base.Theme.NoActionBar). Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:29:9-31:72 to override. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : Attribute activity#com.yalantis.ucrop.UCropActivity@theme value=(@style/Theme.AppCompat.Light.NoActionBar) from [:react-native-image-crop-picker] AndroidManifest.xml:31:13-69 is also present at [com.github.LuckSiege.PictureSelector:picture_library:v2.6.0] AndroidManifest.xml:66:13-58 value=(@style/Base.Theme.NoActionBar). Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:29:9-31:72 to override. * 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 47s error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 /Users/mparramon/projects/mobile/android/app/src/main/AndroidManifest.xml:31:13-69 Error: npm ERR! code 1 npm ERR! path /Users/mparramon/projects/mobile npm ERR! command failed npm ERR! command sh -c react-native run-android npm ERR! A complete log of this run can be found in: npm ERR! /Users/mparramon/.npm/_logs/2021-04-15T04_18_32_056Z-debug.log ```

Here is our package.json:

package.json

```json { "name": "abvmobile", "version": "2.0.0", "private": true, "devDependencies": { "@abillionveg/eslint-config": "^1.4.2", "@babel/core": "^7.8.4", "@babel/plugin-proposal-class-properties": "^7.10.4", "@babel/plugin-transform-flow-strip-types": "^7.10.4", "@babel/runtime": "^7.8.4", "@expo/vector-icons": "^6.3.1", "@react-native-firebase/iid": "11.2.0", "@sentry/cli": "^1.63.1", "@testing-library/jest-native": "^3.4.3", "@testing-library/react-native": "^7.0.2", "babel-jest": "^25.1.0", "babel-preset-react-native-stage-0": "^1.0.1", "bdd-lazy-var": "^2.6.0", "eslint": "7.21.0", "eslint_d": "7.3.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jest": "^24.3.4", "eslint-plugin-react": "^7.13.0", "eslint-plugin-react-native": "^3.7.0", "expo": "^25.0.0", "husky": "^6.0.0", "jest": "26.4.2", "jest-react-native": "^18.0.0", "jetifier": "^1.6.4", "lint-staged": "^10.5.4", "metro-react-native-babel-preset": "^0.63.0", "prettier": "^2.2.1", "prompts": "^2.4.1", "react-devtools": "^3.6.0", "react-native-performance-monitor": "^1.2.1", "react-test-renderer": "16.13.1" }, "scripts": { "android": "react-native run-android", "build:android": "react-native bundle --entry-file='index.js' --bundle-output='./android/app/src/main/assets/index.android.bundle' --sourcemap-output='./android/app/src/main/assets/index.android.bundle.map'", "build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --sourcemap-output='./ios/main.jsbundle.map' --dev=false --platform='ios'", "bump:build": "bundle exec fastlane bump_build", "bump:major": "npm version major --no-git-tag-version && bundle exec fastlane bump", "bump:minor": "npm version minor --no-git-tag-version && bundle exec fastlane bump", "bump:patch": "npm version patch --no-git-tag-version && bundle exec fastlane bump", "codepush": "node scripts/codepush.js", "ios": "react-native run-ios", "ios:small": "react-native run-ios --simulator=\"iPhone SE (2nd generation)\"", "lint": "eslint --ext .js --ext .jsx .", "postinstall": "patch-package && jetifier", "prepare": "husky install", "prettier:check": "prettier --check .", "prettier:fix": "prettier --write .", "react-devtool": "react-devtools", "sourcemap:upload": "scripts/upload_sourcemap.sh", "start": "react-native start --reset-cache", "test": "jest", "test:coverage": "jest --coverage", "test:coverage:summary": "jest --coverage --coverageReporters=\"text-summary\"" }, "jest": { "preset": "react-native", "verbose": true, "setupFiles": [ "/jest/jest.setup.js" ], "setupFilesAfterEnv": [ "@testing-library/jest-native/extend-expect", "bdd-lazy-var/global" ], "transform": { "^.+\\.js$": "/node_modules/react-native/jest/preprocessor.js" }, "collectCoverageFrom": [ "**/*.{js,jsx}", "!**/node_modules/**", "!**/android/**", "!**/ios/**" ] }, "dependencies": { "@baronha/react-native-multiple-image-picker": "^0.2.9", "@react-native-community/art": "1.2.0", "@react-native-community/async-storage": "1.11.0", "@react-native-community/cameraroll": "1.7.0", "@react-native-community/masked-view": "0.1.10", "@react-native-community/progress-bar-android": "1.0.3", "@react-native-community/progress-view": "1.1.0", "@react-native-firebase/analytics": "11.0.0", "@react-native-firebase/app": "11.0.0", "@react-native-firebase/remote-config": "11.0.0", "@sentry/react-native": "2.3.0", "@welldone-software/why-did-you-render": "6.0.5", "algoliasearch": "3.35.1", "appcenter": "4.0.2", "appcenter-analytics": "4.0.2", "appcenter-crashes": "4.0.2", "axios": "0.19.2", "lodash": "4.17.20", "patch-package": "^6.2.2", "prettier": "^2.2.1", "prop-types": "15.7.2", "querystring": "0.2.0", "react": "16.13.1", "react-native": "0.63.2", "react-native-amplitude-analytics": "0.2.8", "react-native-android-open-settings": "1.3.0", "react-native-appsflyer": "6.2.30", "react-native-camera": "3.40.0", "react-native-code-push": "7.0.0", "react-native-communications": "2.2.1", "react-native-device-info": "6.2.1", "react-native-dotenv": "2.4.1", "react-native-exception-handler": "2.10.8", "react-native-fast-image": "8.3.2", "react-native-fbsdk": "3.0.0", "react-native-flash-message": "github:imouto2005/react-native-flash-message", "react-native-geolocation-service": "5.2.0", "react-native-gesture-handler": "1.7.0", "react-native-haptic-feedback": "1.11.0", "react-native-image-crop-picker": "0.35.2", "react-native-image-resizer": "1.2.3", "react-native-keyboard-aware-scroll-view": "0.9.3", "react-native-linear-gradient": "2.5.6", "react-native-localize": "1.4.0", "react-native-maps": "0.27.1", "react-native-markdown-renderer": "3.2.8", "react-native-moengage": "7.0.0", "react-native-open-maps": "0.3.5", "react-native-pdf": "6.2.0", "react-native-permissions": "3.0.0", "react-native-push-notification": "3.1.2", "react-native-rate": "1.2.1", "react-native-reanimated": "1.10.1", "react-native-restart": "0.0.17", "react-native-safe-area-context": "3.1.9", "react-native-screens": "1.0.0-alpha.23", "react-native-splash-screen": "3.2.0", "react-native-svg": "^12.1.0", "react-native-url-polyfill": "1.2.0", "react-native-vector-icons": "7.0.0", "react-native-webview": "10.3.3", "react-navigation": "4.4.3", "react-navigation-stack": "1.10.3", "react-navigation-tabs": "2.10.1", "react-redux": "7.2.0", "react-string-replace": "0.4.4", "redux": "4.0.5", "redux-devtools-extension": "^2.13.9", "redux-thunk": "2.3.0", "rn-fetch-blob": "0.12.0", "rn-sliding-up-panel": "2.4.3", "url": "0.11.0", "use-count-up": "2.3.0" }, "lint-staged": { "*.{js,css,md}": "prettier --write", "*.{js,jsx}": "eslint --cache --fix" } } ```

Could you give some help please? Thanks!

Natanaelvich commented 3 years ago

the same here, I'm not sure, but it looks like a conflict of native configurations of the react-native-image-crop-picker that I see is on your premises

baronha commented 3 years ago

try adding:

 <activity
            android:name="com.yalantis.ucrop.UCropActivity"
            tools:replace="android:theme"
            android:theme="@style/AppTheme" />

in the application tag in your AndroidManifest file.