Uploading MonoDroid app to Android Market - android

I am trying to load an app to the Android Market. Below are the instructions I am using from the following website to prepare my application for submission:
http://android.xamarin.com/Documentation/Guides/Preparing_Package_for_Android_Marketplace
This following message is at the beginning of the instructions. But no instructions on how to add this to the AndroidManifest.xml file.
In order for the Android Market to accept your application, it must
define an application level icon. Ensure a line like this
exists in your AndroidManifest.xml:
<application android:label="MyApplication" android:icon="#drawable/icon">
A future release will provide better support for setting this.
The very first item has me stumped because I am getting the following error when I try to upload my application to the Market.
"The icon path specified by the manifest is not in the apk."
My question is, how do I add the application level icon statement to the manifest file?
Thanks.
p.s. The app deploys to both the emulator and local Android device in debug and release modes with no errors.

You can add a manifest file to your project by bringing up the property pages for your project, going to the Android Manifest tab, and doing the 'add AndroidManifest.xml' link.
Now there should be a file called "AndroidManifest.xml" in the Properties folder in your project.
Add the line specified to this file, replacing any existing element.

I had the same issue and it had nothing to do with the icon. I had an application class (GlobalVars extends Applications) and this was defined in the manifest as different: <application android:name=".GlobalVars" /> I deleted this and added android:name="com.example.myapp.GlobalVars" to the application declaration.
If it is the icon you may have drawable-hdpi, -ldpi, -mdpi folders, and no drawable folder. Or have a drawable folder but the icon is not in it.

Can you post the relevant snippet from your AndroidManifest.xml file? Whatever you have as the android:icon attribute ("#drawable/icon" in the example) is what the apk will be looking for. You can set this manually in the xml file, or by using the wizard in the ADT plugin for Eclipse. If this is set correctly, this means you should have a file called icon.png in one of your drawable folders. If you don't have an icon.png, can you post your folder structure?
In an app I've uploaded to the market, I have the same attribute - #drawable/icon - in my manifest, and therefore I am required to have a file called icon.png in my project. In my case, I have three different icon.png files in my various density-based drawable folders (res/drawable-hdpi, res/drawable-mdpi, res/drawable-ldpi). In your case, you need to at least have res/drawable/icon.png.

This error can also be generated if the manifest xml includes more than one < application > node.

Related

Flutter: AndroidManifest.xml various issues

Just trying to get my app ready for publishing and the resources online are absolutely awful.
In my AndroidManifest.xml file I have my
<application
android:name="io.flutter.app.FlutterApplication"
android:label="My App"
android:icon="#mipmap/ic_launcher">
The compiler is having a tantrum because it doesn't understand "#mipmap/ic_launcher". I have followed all the documentation for this and my ic_launcher.png file is in every one of the mipmap folders under android\app\src\main\res. I even created a new folder just called mipmap, but nothing works.
There is no other information about this so I am at a loss. Can anyone assist?
What you did is fine, when you use the #mipmap/ path it means all folders for the Android buckets sizes. So, unless you use "svg" assets, that's the way to go for the icon (and other bitmap assets).
Maybe by accident you removed a line from the xml, or delete a file...
My advise: start a new project, and use a tool like appicon to generate those files for you.
Run the default Flutter project (to check that it works), replace the files with the ones from the exported zip, and test this default app in --profile or --release mode to see if it compiles and shows the correct icons/splashes.
Then, if you made a lot of work in your current (broken) project, put back the pubspec.yaml, lib/ and assets folder in this new project.
Good luck!

Android Studio - Access resources from another package in manifest file

I am implementing an Android application that has both live and office packages other then the main package. The manifest file is included inside the main package. The ic_launcher and app_name resources are included in both live and office for production and development versions, respectively.
When I try to access ic_launcher and app_name from the manifest file, it fails to read them - as show in this screen shot -.
This is the hierarchy of my app:
The resources I try to access are included under both live and office directories.
Is there anything I should add to be able to access them from manifest file?

how to change manifest in debug folder

I did clone android project from GitHub and i wanted to change it.
the app got permission for .ACCESS_COARSE_LOCATION. but there isn't any permission like that.
I searched that permission in the app folder and i found it in another manifest with this path AppName/build/intermediates/manifests/full/debug
I tried to remove this permission but when i open project in android studio the permission come back!
what should i do to remove this?
consider there isn't any permission like that in the main manifest in android studio.
As Code-Apprentice said all the files under the build folder are auto-generated when you compile your app. Editing it won't have any effect, rather you should try to analyse from where this permission is coming!
Manifest is getting merged with libraries and other modules and then merged manifest actually goes into the apk. You can always analyse merged manifest apk by checking "Merged Manifest" tab and click on permission or any components to see from which modules/libraries it is exactly coming!
All files under the build folder are generated when you compile your app. Editing these files directly will have no effect. Instead, you need to edit the source that these files are generated from. Some of the generated AndroidManifest.xml comes from the app/build.gradle file and the rest comes from app/src/main/AndroidManifest.xml. You should edit these as needed.

How to package and send an android app

I have used Android Studio to build my Android App. I have found numerous tutorials for generating the apk file, but now that I have done that how do I send my app to somebody? The apk file is called app-release.apk. It doesn't even show the name of my app. Can I change the name? Can I package it somehow and add an image?
The APK is the file that you use to install an app in some Android device. If you have an APK file, it is already packaged, just send it to your friend.
And yes, you can change the file name, but that will not have any kind of effect on the app, it is just changing the file name...
What do you mean by package it??
You can surely change the name by RENAMING it . And as for the icon you can add an image to the drawable folder and then set the icon for it.
The icon can be set in the ActivityManifest file. Here is how to do it--
In the android manifest file there is a android:icon just set the location of your image .
https://i.stack.imgur.com/1x30x.png
The name of the application is stored in your AndroidManifest.xml file
<application
android:label="NAME OF APPLICATION"
You can rename the .APK file to anything you like, it does not change the name of the application.
The APK file can be sent to others for installation.
The apk file is only recognized on an android system. Any other system (Windows for example) wouldn't bother trying to show the app's icon even if you set it properly in the manifest. As for renaming it, you can rename it to whatever you want as long as you keep the apk extension. The real app name that will show when installed is set in your manifest file. And packaging it? you already done that by generating the apk! However if the person receiving your app wants to install it, it has to enable "Unknown sources" in Setting > Security > Unknown sources as your application is not coming from the play store.

How to create an android library project with no resources

I want to create a library project with just java/Android classes - but no resources. Basically it will contain helpers for IO etc. I have manually deleted the resources etc - the project is here - but I wonder if this can be done out of the box - or is my way not proper
NB: I need Android classes - so creating a regular java project is not an option (?)
Edit : if there is no out of the box way is there any catch in deleting the (edit: contents of the) res/ folder and the support library ? I would appreciate a 1-2-3 procedure
You need to keep project structure, incl. having res/ foder with drawable/ etc, but these folders can be empty. There's no requirement for your library to reference any drawable.
Others suggest it's mandatory for "app icon" but your library does not need any <application> entry in manifest, so it does not need any icon. The same applies to values/ and layout/ folders. Your library project have to have these folders (as required by build process), but having no file in them (so basically keeping them empty) is perfectly fine and valid and meets your requirements.
I believe you should keep all the required folders (including res) but you can leave them empty. Here is a guide for it.
http://developer.android.com/tools/projects/projects-eclipse.html#SettingUpLibraryProject
I believe you cannot delete the res folder completely since the app icon is contained in it. However you can delete the default layout if you do not need it and any other content that is required for the app to work.
If you would like to access the Android classes you will have to create an Android project.
I hope this helps.
I have created a git repository to illustrate - I created a vanilla eclipse android library project (screens) added a git ignore (bin/) and then proceeded to delete unneeded resources (all the contents of the res/ folder) along with libs/ and assets/ and edit the manifest. The changes are in this commit for reference. Cleaning the project removed R.java along.
Will be adding more (.gitattributes and eclipse settings for android) but this is for now.

Categories

Resources