My manifest is interpreting my xmlns:android as an error, saying that I should "add Xsi schema location for external resource":
Could someone please tell me what's going on with my projects' manifests, it's really confusing since I don't know when this even started happening.
Thanks in advance!
You need not worry about this file. On the top of the file, you see that is an auto-generated file. You need not modify it. If you modify it, then run your app, again it will be changed to what it was before. So you need not modify it.If you want the original manifest, below the code in the manifest, you will see two tabs named Merged Manifest and Text. The Text is the one you need to modify. See the image below
See the bottom of the image. Never ever bother about the Merged Manifest. If you do, you will waste your time
Related
I would like to rename all of my java classes and layouts that starts with the prefix tranp_ to event_. I can do that one by one using the combination Shift+F6 but it is taking too much time (there are more than 20 files). Is there a quicker way to do that in bulk?
Although is an old question, I feel it's worth answering as there is a valid solution.
Open the project with AndroidStudio, then right click on the main project's folder, select "replace in path" and enjoy it. I just replaced 400 occurrences in less than 40 seconds, just make sure you really need to replace all statements!
There seems to be no feature implemented to rename multiple files at once through refactoring provided within the Android Studio.
I also feel the need to have such feature as I keep changing my decision to name elements of certain category to some specific manner and thus have to tediously do it one by one. Which in many cases causes the bug.
I hope the future version will have it but till then what I am doing best at the moment is use the 'ctrl+r' feature to search all the occurrences of the item and replace it with what I want to rename to. And then do it again on all places where the element has been referenced. And then at last to make sure that there are no errors caused by the recent renaming I just run it. If any errors like "resources not found" then the Android Studio does point me to the location of the error, which generally is the place I left to rename.
Although this is not a sure way but it has helped me quite a lot when you have to rename lots of elements instead of 'shift+f6'.
So since I have tried the reply before me and it didn't help, I actually did find useful to open the direct path of the files I want to change, selected all of them and just pressed on rename(On MAC). It gave me the option to replace specific letters in all of the files. Made my life much easier after changing about 30 files, and noticing I have another 250 to change at least.
I was wondering why AndroidManifest.xml is named like this and not simply Manifest.xml and if this means that there are different types of Manifests? I was reading the information about AndroidManifest but could not find anything. Or do they only want to emphasize that the coupling between the Manifest and Android (OS) is super tight?
Except for some included settings or icons which make a distinction about android built-in things and the option to include your own I have not seen Android name as a prefix except in the Manifest file. For example: the directories in the res folder have special meaning in android but also don't have the Android prefix or something alike, that makes me wonder even more why they decided to name it AndroidManifest instead of just Manifest.xml.
there are different types of Manifests?
There are many things in Java development that are manifests, such as WEB.XML in a Java servlet, JAR manifests, etc.
Can you write manifest like files yourself with a different name?
You are welcome to write your own framework that has its own manifest-style file structure for whatever purposes you want.
It almost seems by the way they named it that there could be other Manifests as well.
Not in Android. However, Android is not the only framework in existence, either.
Second if it's not possible to create your own Manifests like files I wonder why it was named this way.
Historical reasons, most likely. The name choice was made close to a decade ago. If you own a time machine, hop back in time, figure out where Android Inc. was based, head over there, and ask them.
On the whole, Google (let alone the old Android Inc. firm they bought) has not provided much in the way of detail about why things are named the way that they are.
Every android app has just single AndroidManifeset.xml file. As for why this specific name was chosen, I have no idea, but if you look at it the name kind of makes sense.
So I'm trying to make myself a little alarm clock app to learn android. Just to do some things that I've always wanted in an alarm clock, and have it be my own. Motivations aside, after coding the interface and a bunch of other functions, I've decided to borrow a bunch of the code, if not most, of the android alarm clock source.
I've already brought in all the res stuff, and I've included all the src files under their original com.android.alarmclock namespace so that they can still reference each other properly. However it refuses to generate the R file for the new files.
When I clean and rebuild and all that, it still generates a build file and an R file for the stuff in my package (com.nathantempelman.alarmapp) but I still get an error on all the android AlarmClock files.
Should I be changing the AlarmClock files so that they reference the R from my package somehow? Or did I miss something when I updated the AndroidManifest file that is stopping another R from building or something?
Or is it something else entirely? Is it a stupid idea to try to drag another application's source into mine? Should I open it up in an external project and try to reference it somehow?
I'd love to hear some ideas, if anyone has had a similar situation.
Thanks for reading.
That is not how it's done. You want your Alarmapp to extend ALarmClock or extend the ALarmCLock classes or interfacces you want or need.
You can't drag source code in like that without re-factoring and tieing up all the loose ends, hence alarmApp extends AlarmClock.
Take a look here Hope this helps
I tried the library method, but that didn't work. In the end, I ended up just dropping the smaller project into the bigger project, combining the strings xml and android manifest, changing the intent classes of the activities in the android manifest, and dragging all the relevant pictures in. Quite a bit of work in the end, but it can be done.
Quick checklist:
Splice android manifest files
- if the package names are different, make sure the package name at the top of your manifest only extends as far as both packages are the same
Make sure all the resources make it over
Splice the strings.xml, styles.xml, and anything else that is common
between the two projects
Thought I'd post this in case someone else tries to do the same thing eventually. Best of luck
I have been working on a bunch of utility activities. The goal is that the user simply can reuse the source code and there is no need for any layout xml files. Hence, all the layouts are created programmatically. There is no reference to any layout xml file.
The only problem I am running into is that the user is forced to enter the activities in the manifest file.
I am wondering if there is a way to bypass this step by the user. Perhaps the user can call some Init() method in my code that will programmatically add activities to the "manifest" object. There must be some notion of manifest object as Android is looking it up when a new activity is created.
Thank you in advance for your help.
The goal is that the user simply can reuse the source code and there is no need for any layout xml files. Hence, all the layouts are created programmatically. There is no reference to any layout xml file.
This hardly seems like a good thing. Now you are preventing your reusers from readily modifying matters, to tweak for different device characteristics that you are not yet supporting, etc. Android library projects allow you to create reusable components that contain layout files and other resources.
I am wondering if there is a way to bypass this step by the user.
No, sorry, that is impossible.
Eventually, I think Android library projects will support merging of manifests to help deal with this.
I'm sure you can help such a newbie like I am.
I created a project in android and I want to use it as a model for next 10 and more apps, just changing the raw sources.
I mean I want to make some products i.e. 10 videocharts about norway, I make one project with the needed activity and resources so each app will differ only for the content value.
I will keep of course the same file name too if needed.
How can I save the project?
Cause I tried to make a new project from resource but I get an error on top of the tab saying Manifest is not present in the folder while manifest is actually there, and I cannot proceed further.
Thank you
ANgelo
This sounds like a place to use an Android library project.