This is my manifest file and I don't know why am I getting this error . Please help me out with this error. Everything is working fine, but the problem is the meta tags inside the applciation tags, if I write them outside the application tags then it crashes the app, and if I write them inside the application tags then I get the error "INSTALL_PARSE_FAILED_MANIFEST_MALFORMED".
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.nadeemahmad.guitest">
<!--Permissions-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<permission android:name="com.example.nadeemahmad.guitest.MAPS.RECIEVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.example.nadeemahmad.guitest.MAPS.RECIEVE"/>
<uses-permission android:name="com.google.android.providers.gsf.permissions.READ_GSERVICES"/>
<uses-feature android:glEsVersion="0x0020000" android:required="true"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".splash"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:noHistory="true" />
<activity
android:name=".profile"
android:noHistory="true" />
<activity
android:name=".profile_update"
android:noHistory="true" />
<activity
android:name=".sync_contacts"
android:noHistory="true" />
<activity
android:name=".settings"
android:noHistory="true" />
<activity android:name=".synced_contacts_list"></activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_android_map_api_key" />
<meta-data android:name="come.google.android.gms.version"/>
</application>
</manifest>
Rectify Your meta-data TAG . It should be com instead of come .
Wrong
<meta-data android:name="come.google.android.gms.version"/>
Perfect
<meta-data android:name="com.google.android.gms.version"/>
After that Clean-Rebuild and Run .
Related
I am somewhat confused by an error showing up in an Android app, where I want to use MobileAds.
Here is the Kotlin code:
val adRequest = AdRequest.Builder().build()
adView.loadAd(adRequest)
The AndroidManifest.xml file contains these three lines:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
And these are the errors I get:
Missing permissions required by BaseAdView.loadAd: android.permission.INTERNET
Missing permissions required by FusedLocationProviderClient.getLastLocation: android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION
Is there anyone out there who has an idea of what is going on?
Any relevant tip or explanation would be more than welcome.
Just in case this is the complete AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="me.soft.app">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:dataExtractionRules="#xml/data_extraction_rules"
android:fullBackupContent="#xml/backup_rules"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.App"
tools:targetApi="31">
<activity
android:name=".WorldExposureActivity"
android:exported="false"
android:parentActivityName=".ShopDetailActivity"
android:screenOrientation="portrait" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="XXXXXXX" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-1234567890012345~1234567890"/>
<activity
android:name=".ShopMapActivity"
android:exported="false"
android:label="#string/title_activity_shop_map"
android:parentActivityName=".MainActivity" />
<activity
android:name=".ShopDetailActivity"
android:exported="false"
android:parentActivityName=".MainActivity"
android:screenOrientation="portrait" />
<activity
android:name=".MainActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
what permissions should i add in mainfest.xml of adroid studio for following app. Please help me. i am new developer.
https://play.google.com/store/apps/details?id=aa.bb.waqas.myapplication&hl=en
tell me about all permissions that i need to add it.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="aa1.bb.waqas.myapplication">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="IELTS Preparation In One Day"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".t1" />
<activity android:name=".MainActivity" />
<activity android:name=".t2" />
<activity android:name=".t3" />
<activity android:name=".t4" />
<activity android:name=".t5" />
<activity android:name=".t6" /><activity android:name=".t7" />
</application>
</manifest>
As you shared the link of application, there are only two permissions are needed
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
and You may need to add more permissions as per your requirements.
This is my code
<?xml version="1.0" encoding="utf-8"?>
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<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=".RegisterActivity"/>
<activity
android:name=".SplashActivity"
android:exported="true" />
<activity
android:name=".LoginActivity"/>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" />
</application>
At the beginning, my project exported property is in the LoginActivity section.
But after I change exported="true" to SplashActivity it's not work...
I tried to change to RegisterActivity section and got the same error.
Event log is "Error running app: The activity must be exported or contain an intent-filter"
my android studio version is 2.3.3 and project min SDK is 19
Is there anyone have the same problem?..
Updare:
This is my latest code
<?xml version="1.0" encoding="utf-8"?>
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<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=".RegisterActivity"/>
<activity
android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".LoginActivity" />
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" />
</application>
But I got the
same problem
...
try defining your Splash activity like this :
<activity
android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
In the Manifest file you must have an Activity that is set as Main so the app will know what to launch first.
By adding the following intent-filters you set the following Activity as main.
<activity
android:name=".Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
My Android emulators not taking internet permission.
My Manifest File;
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.codework.myapplication">
<permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:label="#string/app_name" />
</application>
</manifest>
LogCat Error;
AndroidManifest Error: WebView login requires INTERNET permission
In Settings - No permissions requested;
Replace
<permission android:name="android.permission.INTERNET" />
With
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.INTERNET">
NOT
permission ...
I made a copy of one of my working projects for another project. Ever since I can't get the AndroidManifest.xml to work properly. I get the error The element must be a direct child of the <application> element or The element type "manifest" must be terminated by the matching end-tag "</manifest>"error. I have refactored everything else and don't see any errors in my classes. Just the xml file is being a pain. What is wrong with this file? It looks fine and looks like my working one. Eclipse seems to think there are errors.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package= "com.mydomain.qsd"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="17" />
<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="com.mydomain.qsd.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<permission
android:name="com.mydomain.qsd.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" />
<activity
android:name="com.mydomain.qsd.MainActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.mydomain.qsd.SplashScreen"
android:screenOrientation="portrait" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name="com.mydomain.qsd.gcm.GCMReceiver"
android:permission="com.google.android.c2dm.permission.SEND" />
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.mydomain.qsd" />
</intent-filter>
</receiver>
<service android:name="com.mydomain.qsd.gcm.GCMService"/>
<activity
android:name="com.mydomain.qsd.NotifyActivity"
android:screenOrientation="portrait"
android:label="#string/title_activity_notify" />
</activity>
</application>
</manifest>
You have directly close your application tag
Replace this :
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" />
by this :
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
EDIT :
You have to replace this :
<activity
android:name="com.mydomain.qsd.MainActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait"/>
by this :
<activity
android:name="com.mydomain.qsd.MainActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait" >
This :
<activity
android:name="com.mydomain.qsd.SplashScreen"
android:screenOrientation="portrait" />
by this :
<activity
android:name="com.mydomain.qsd.SplashScreen"
android:screenOrientation="portrait" >
This :
<receiver
android:name="com.mydomain.qsd.gcm.GCMReceiver"
android:permission="com.google.android.c2dm.permission.SEND" />
by this:
<receiver
android:name="com.mydomain.qsd.gcm.GCMReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
And finally this :
<activity
android:name="com.mydomain.qsd.NotifyActivity"
android:screenOrientation="portrait"
android:label="#string/title_activity_notify" />
</activity>
by this :
<activity
android:name="com.mydomain.qsd.NotifyActivity"
android:screenOrientation="portrait"
android:label="#string/title_activity_notify" />
Your application Tag and also Activity tags have self close so remove that
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" /> <----- remove /