Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

AndroidManifest merger error on run #295

Open
tayfunyasar opened this issue Aug 23, 2019 · 9 comments
Open

AndroidManifest merger error on run #295

tayfunyasar opened this issue Aug 23, 2019 · 9 comments

Comments

@tayfunyasar
Copy link

I have started new project from scratch.

I'm having error during run.

tayfun@tayfun-G3-3579:~/dev/gitlab/instaton$ react-native run-android
info Starting JS server...
info Building and installing the app on the device (cd android && ./gradlew app:installDebug)...

Task :react-native-device-info:compileDebugJavaWithJavac
Note: /home/tayfun/dev/gitlab/instaton/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Task :react-native-gesture-handler:compileDebugJavaWithJavac
Note: /home/tayfun/dev/gitlab/instaton/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Task :react-native-i18n:compileDebugJavaWithJavac
Note: /home/tayfun/dev/gitlab/instaton/node_modules/react-native-i18n/android/src/main/java/com/AlexanderZaytsev/RNI18n/RNI18nModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Task :app:processDebugManifest FAILED
/home/tayfun/dev/gitlab/instaton/android/app/src/debug/AndroidManifest.xml:22:18-91 Error:
Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:7:5-117 to override.

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:7:5-117 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5s
40 actionable tasks: 36 executed, 4 up-to-date
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: ./gradlew app:installDebug. Run CLI with --verbose flag for more details.

Here it is my doctor result.

tayfun@tayfun-G3-3579:~/dev/gitlab/instaton$ ignite doctor
System
platform linux

arch x64
cpu 12 cores Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
directory /home/tayfun/dev/gitlab/instaton

JavaScript
node 8.10.0 /usr/bin/node
npm 6.11.2 /usr/local/bin/npm
yarn 1.17.3 /usr/local/bin/yarn

React Native
react-native-cli 2.0.1
app rn version 0.59.9

Ignite
ignite-cli 3.1.6 /usr/local/bin/ignite
createdWith 3.1.6
boilerplate ignite-andross
examples classic
navigation react-navigation
askToOverwrite true
generators {"component":"ignite-andross","container":"ignite-andross","listview":"ignite-andross","list":"ignite-andross","redux":"ignite-andross","saga":"ignite-andross","screen":"ignite-andross"}
boilerplateVersion 4.1.0

Android
java 1.8.0_222 /usr/bin/java
android home - /home/tayfun/Android/Sdk
tayfun@tayfun-G3-3579:~/dev/gitlab/instaton$

I executed these commands below. And nothing changed.

cd android
./gradlew clean
cd ..
rm -rf node_modules
npm i
react-native run-android

@tayfunyasar tayfunyasar changed the title AndroidManifest merger error on first run AndroidManifest merger error on run Aug 23, 2019
@tayfunyasar
Copy link
Author

I have added props below after read material-components/material-components-android#193 (comment) but i got another errors.

added into "gradle.properties"

android.useAndroidX=true
android.enableJetifier=true

errors:

tayfun@tayfun-G3-3579:~/dev/gitlab/instaton-mobile$ react-native run-android
info Starting JS server...
info Building and installing the app on the device (cd android && ./gradlew app:installDebug)...

Task :react-native-device-info:compileDebugJavaWithJavac
Note: /home/tayfun/dev/gitlab/instaton-mobile/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Task :react-native-gesture-handler:compileDebugJavaWithJavac FAILED
/home/tayfun/dev/gitlab/instaton-mobile/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
^
/home/tayfun/dev/gitlab/instaton-mobile/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:19: error: package Pools does not exist
private static final Pools.SynchronizedPool EVENTS_POOL =
^
/home/tayfun/dev/gitlab/instaton-mobile/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:3: error: package android.support.v4.util does not exist
import android.support.v4.util.Pools;
^
/home/tayfun/dev/gitlab/instaton-mobile/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:19: error: package Pools does not exist
private static final Pools.SynchronizedPool EVENTS_POOL =
^
/home/tayfun/dev/gitlab/instaton-mobile/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerStateChangeEvent.java:20: error: package Pools does not exist
new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
^
/home/tayfun/dev/gitlab/instaton-mobile/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.java:20: error: package Pools does not exist
new Pools.SynchronizedPool<>(TOUCH_EVENTS_POOL_SIZE);
^
Note: /home/tayfun/dev/gitlab/instaton-mobile/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
6 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-gesture-handler:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s
25 actionable tasks: 22 executed, 3 up-to-date
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: ./gradlew app:installDebug. Run CLI with --verbose flag for more details.
tayfun@tayfun-G3-3579:~/dev/gitlab/instaton-mobile$

@tayfunyasar
Copy link
Author

tayfunyasar commented Aug 23, 2019

I have added "jetifier" as dev dependency and script command. It worked but is this the right solution for ignite?

software-mansion/react-native-gesture-handler#647 (comment)

@sahilvicesoftware
Copy link

Getting the same error

@moss1mo
Copy link

moss1mo commented Sep 2, 2019

I'm getting the same error, hopefully someone can help us with this error.

@paulvales
Copy link

Getting the same error

@milesmeow
Copy link

I'm getting the same error. It happens when I add the Dev Screens to my project. If you don't have Dev Screens it builds okay.

@jamonholmgren
Copy link
Member

Is this an Andross-specific bug? It seems to be. If so, we can move this issue over to the ignite-andross repo.

@milesmeow
Copy link

I've actually had to do the following in order to build for Andross...
material-components/material-components-android#193 (comment)

@RamyEl-basyouni
Copy link

Hey all, as @tayfunyasar said, It worked for me:
if you generate ignite solution with dev screens, you will gave to add to "gradle.properties" file

android.useAndroidX=true
android.enableJetifier=true

and running:

npm i jetifier
npx jetifier

@jamonholmgren jamonholmgren transferred this issue from infinitered/ignite Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants