I am currently using this AndroidManifest in my project: Current Manifest, however I am trying to use this other AndroidManifest from a website in order to implement an image upload service : Manifest to add
I have been searching for answers but I haven't been able to merge these 2 files successfully. The Current Manifest picture of course is not the entirety of it, but I simply showed you the most important parts. Am I able to merge both packages, with both applications and activities?
current manifest
<manifest
package="org.briarproject.briar"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-feature android:name="android.hardware.bluetooth"/>
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_LOGS"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission-sdk-23 android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<application
android:name="org.briarproject.briar.android.BriarApplicationImpl"
android:allowBackup="false"
android:icon="#mipmap/ic_launcher_round"
android:label="#string/app_name"
android:logo="#mipmap/ic_launcher_round"
android:theme="#style/BriarTheme">
<activity
android:name="org.briarproject.briar.android.reporting.DevReportActivity"
android:excludeFromRecents="true"
android:exported="false"
manifest to add
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.simplifiedlearning.volleymysqlexample">
<!-- the internet permission -->
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Do you still want to merge them (or still are wondering how to do it, after reading other peoples comments) ?.
If so (you could have used a separate module or make a library), one way is like this:
I kept your old package name as the external main one
I made sure I had all permissions of both manifest's
I kept the new Activity's intent-filter (so it's the first Activity on launch)
You need to physically copy the new source code (directory/s) into your current source code
("net.simplifiedlearning.volleymysqlexample.MainActivity" meaning physically "...\net\simplifiedlearning\volleymysqlexample\MainActivity" {windows path convention})
Merging manifest's is quite a simple operation, merging resources can be a lot of work. Questions you have to ask yourself:
Do I need resources from the new project and copy/merge them into the current ?
(They may be many and incompatible, strings,layouts, styles and themes in particular but many more ...).
Is the build system of the new project merged into your project ?
Example resource directories (not to mention all the files):
res +
+---drawable-hdpi
+---drawable-land-hdpi
+---drawable-land-ldpi
+---drawable-land-mdpi
+---drawable-land-xhdpi
+---drawable-land-xxhdpi
+---drawable-land-xxxhdpi
+---drawable-mdpi
+---drawable-port-hdpi
+---drawable-port-ldpi
+---drawable-port-mdpi
+---drawable-port-xhdpi
+---drawable-port-xxhdpi
+---drawable-port-xxxhdpi
+---drawable-xhdpi
+---drawable-xxhdpi
+---layout
+---menu
+---mipmap-hdpi
+---mipmap-ldpi
+---mipmap-mdpi
+---mipmap-xhdpi
+---mipmap-xxhdpi
+---mipmap-xxxhdpi
+---values
+---xml
The merged manifest:
<manifest
package="org.briarproject.briar"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-feature android:name="android.hardware.bluetooth"/>
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_LOGS"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission-sdk-23 android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<application
android:name="org.briarproject.briar.android.BriarApplicationImpl"
android:allowBackup="false"
android:icon="#mipmap/ic_launcher_round"
android:label="#string/app_name"
android:logo="#mipmap/ic_launcher_round"
android:theme="#style/BriarTheme">
<activity android:name="org.briarproject.briar.android.reporting.DevReportActivity">
android:label="#string/crash_report_title"
</activity>
<activity android:name="net.simplifiedlearning.volleymysqlexample.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
your code shows two differentes packages, anyway, merge several manifest is a gradle or IDE task:
"Your APK file can contain just one AndroidManifest.xml file, but your Android Studio project may contain several—provided by the main source set, build variants, and imported libraries. So when building your app, the Gradle build merges all manifest files into a single manifest file that's packaged into your APK."
source: https://developer.android.com/studio/build/manifest-merge.html
Related
I had my existing android project going unmanageable due to unnecessary research codes, so I decided to create a new project with only necessary code that's required for the app. I uploaded the same on play store's beta environment. As the app got updated on my phone, the already existing app icon on home screen got removed. Did I make any mistake in the code development?
Please help
EDIT: Added Manifest File
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.abc"
android:installLocation="preferExternal"
android:versionCode="52"
android:versionName="5.0.004" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:name="com.example.abc.Appname"
android:allowBackup="true"
android:icon="#drawable/launcher"
android:label="#string/app_name"
android:theme="#style/Theme.CustomTheme" >
<activity
android:name="com.example.abc.SplashScreen"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/title_activity_app_name"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="stateHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
...
</manifest>
Reverted back the application name to old file name (java class) and the same in manifest file. The launcher icon was created while installing via Google play store's beta environment.
Still unsure why the application name and java class names had an impact on the launcher icons. Any idea?
All,
Trying to use google v2 map api in my android application and can't get it to work, it keeps displaying a blank white page!
I even tried running samples from https://github.com/commonsguy/cw-omnibus/tree/master/MapsV2 and got the BasicMap application compiled and installed on my device but exactly same issue!
Since this is happening both for my code and this code that all I heard is a valid source I assume this is not the Key issue as these two use two different keys.
I've done all I could, here is manifest file from the sample:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.commonsware.android.mapsv2.basic"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16"/>
<permission
android:name="com.commonsware.android.mapsv2.basic.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.SET_DEBUG_APP" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.Sherlock.Light.DarkActionBar">
<uses-library android:name="com.google.android.maps" />
<activity
android:name="MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyC4iyT46cB00IdKGcy5EmAxK5uCOQX2Oy8"/>
<activity android:name="LegalNoticesActivity">
</activity>
</application>
</manifest>
Any idea what this could be?
Try to follow the following guide I wrote for adding a Google Map Api V2:
Google Map API V2
and please share you logcat stack trace with us so we could understand more clearly what is your problem.
I am developing some app for android which worked well untill this evening.
However the app is working well in emulator but on Archos 80 G9 tablet with android 3.2.80 I got this error
The application Package installer (process com.android.packageinstaller) has stopped unexpectedly. Please try again.
Also here is my manifest XML
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="oni.dani"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="13"
/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:debuggable="true"
>
<activity
android:label="#string/app_name"
android:screenOrientation="portrait"
android:name="com.android.onidani.Dashboard" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.android.onidani.KlasaPrikazBaze"></activity>
<activity android:name="com.android.onidani.Dashboard"></activity>
<activity android:name="com.android.onidani.OniDaniActivity"></activity>
</application>
</manifest>
This error is occuring because you have declared your Dashboard activity twice.
<activity android:name="com.android.onidani.Dashboard"></activity>
You should add permission declaration in your manifest file. E.g
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
error: 'unfortunately package installer has stopped'. This happens when application needs permissions like location, phone call, Read external storage, write external storage etc. If permission is not defined in the manifest file then i get this kind of error message.
Add permission in manifest file according to your need
i need read/write file so i added below permission (outside of application)
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
in my situation i was passing empty array to requestPermissions. so check if your array is'not empty (String[] permissions)
My application is available in Android market and supported Android version 2.2+. But when i open Android market using Samsung SPH-M820 device. It doesn't show application in there. But when i enter full url and try to download app, It shows error message "app not compatible with your device". While device specifications are here.
What is the issue?
Update: Manifest file is added:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="packageName"
android:installLocation="auto"
android:versionName="Version1"
android:versionCode="10">
<uses-sdk android:minSdkVersion="8" />
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true" />
<!-- permissions -->
<permission android:name="packageName.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="packageName.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- This app has permission to register and receive message -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>
<application android:icon="#drawable/icon" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" android:debuggable="false">
<receiver android:name=".PushIncidentReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<!-- Receive the actual message -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="packageName" />
</intent-filter>
<!-- Receive the registration id -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="packageName" />
</intent-filter>
</receiver>
<activity android:name=".SplashActivity" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-library android:name="com.google.android.maps" />
</application>
</manifest>
That link doesn't look like it leads to any device specifications, but rather forum boards. In addition, what we really need is your AndroidManifest.xml file. While this response doesn't answer your question directly since we don't have access to your AndroidManifest.xml, hopefully this will help guide you or others to figure out what's wrong.
You can see what devices your application supports by logging on to your developer account at http://market.android.com/publish. Choose your application, and you will see the following section on the next page underneath "Publishing options":
That shows you requirements you have set up in the AndroidManifest.xml file of your application. In addition, you can even click "Show devices," and you will see a list of supported and unsupported devices for your application, such as the following:
You can see that my application doesn't support two HTC phones. In addition, you can even prevent specific phones that do meet your requirements by choosing to exclude them in the list.
If you want your application to work on a specific phone, you will have to modify your AndroidManifest.xml or application itself to have more lenient requirements so your phone can satisfy them.
I'm new to Android development. I'm trying to get a simple HelloWorld app going on my (rooted) phone - and the app is trying to enable Bluetooth.
I've set the Bluetooth permissions in my manifest is as follows, but I'm getting a Permission Denial exception when I try to run the application on my phone via Eclipse:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloandroid"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name" android:debuggable="true" android:permission="android.permission.BLUETOOTH_ADMIN">
<activity android:name=".HelloAndroid"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-sdk android:targetSdkVersion="7" android:minSdkVersion="5"></uses-sdk>
</manifest>
Is there something obvious I'm missing?
The answer about what to include in your manifest.xml for bluetooth activity includes
<uses-feature android:name="android.hardware.bluetooth" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
The first three are of greater priority and as I'm sure you're aware there are different cases when each dependency may be required. Hope it helps with your setup!
I'm not quite sure what the problem was here.
All I can say is that I reinstalled Eclipse and its plugins and now everything is working fine. Thanks for your help Mayra - I'll up-mark your answer because of your helpful and friendly approach.
The element types in the manifest are ordered. I think the uses-permission needs to be first under the tag.