Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The prefix "tools" for attribute "tools:replace" associated with an element type "activity" is not bound. #233

Closed
PhpGuyZim opened this issue Apr 11, 2017 · 10 comments

Comments

@PhpGuyZim
Copy link

Hi,
Followed android installation instructions. All looks good, until I try to build.

I get the "tools" error and everything stops:

[Fatal Error] :37:65: The prefix "tools" for attribute "tools:replace" associated with an element type "activit
y" is not bound.

FAILURE: Build failed with an exception.

  • What went wrong:
    Exception while parsing the supplied manifest file D:_mobidev\app\android\app\src\main\AndroidManifest.xml

The prefix "tools" for attribute "tools:replace" associated with an element type "activity" is not bound.

In manifest, I have this, which is the referenced line in the error:

<activity tools:replace="android:theme"
			android:name="com.facebook.FacebookActivity"
			android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
			android:label="@string/app_name"
			android:theme="@android:style/Theme.Translucent.NoTitleBar"/>

Any ideas?
System: Win 10, RN 43

@pmadruga
Copy link

Did you add the xmlns:tools="http://schemas.android.com/tools" inside AndroidManifest.xml?

Specifically,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.YOUR_APP_NAME"
    android:versionCode="2"
    android:versionName="2.0.1">

@PhpGuyZim
Copy link
Author

Hmm... I uninstalled react-native-facebook-login and left it for later after struggling for several hours. I can't specifically answer yes or no to that question except to say I had followed all the steps as per instructions. If I run into the same issue when I reinstall I will comment. Thanks.

@pmadruga
Copy link

I tried to replicate again and I believe my solution is wrong. What made it build, after having the same error as you, was to just remove the line

tools:replace="android:theme"

Hope this helps.

@lwhiteley
Copy link
Contributor

lwhiteley commented Apr 12, 2017

please use master and not the version on npm. should resolve issue as well as using @pmadruga original solution.

Also see deprecation notice in readme

@PhpGuyZim
Copy link
Author

Just reporting back to help others. I did try to install again, and this time, from master. "Worked" out of the box in the sense that I wasn't getting the error anymore. Instead other issues, namely: #64 finally got me to just uninstall and move on to other modules.
I will try https://github.com/facebook/react-native-fbsdk instead.
Thanks for the help.

@SelaO
Copy link

SelaO commented Aug 22, 2017

@lwhiteley is this still what you recommend? To not install from npm?

@pmadruga I get an error that tools:replace="android:theme" is needed.

@Kosai106
Copy link

@SelaO To fix this, add xmlns:tools="http://schemas.android.com/tools" to the <manifest> header.

@belrvn
Copy link

belrvn commented Dec 5, 2017

This works for me.
https://stackoverflow.com/a/28106780/6026222

Add tools:node="replace" to <application/> tag.

@tsher004
Copy link

I'm having a similar problem while trying to create a checklist app.

In my build.gradle (Module:app) I was instructed to add

implementation 'androidx.recyclerview:recyclerview:1.1.0'
&
implementation 'com.google.android.material: material:1.1.0'

This gave me error Manifest merger failed and suggested that I add

tools:replace="android:app component factory"

to my element in my AndroidManifest.xml. I also added

xmlns:tools="http://schemas.android.com/tools"

to my element to make it work, but now I'm getting several log errors that primarily focus on "Couldn't load memtrack module".

@waqadArshad
Copy link

waqadArshad commented Dec 27, 2023

I think it is worth mentioning here that this line should be added inside the starting manifest tag.
My mistake was that I added it after the starting manifest tag was closed.

xmlns:tools="http://schemas.android.com/tools"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants