I have this error: Google Maps Android APIļ¹ Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors)
I must say that I have requested API key with the debug keystore and I do have the needed permissions. Here is my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tripin.corinaracasan.tripin"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="com.example.googlemaps.permission.MAPS_RECEIVE" />
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="17" />
<permission
android:name="com.tripin.corinaracasan.tripin.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<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/AppTheme" >
<activity
android:name=".MyActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:label="#string/app_name" android:name=".MarkItemClass"/>
<uses-library android:name="com.google.android.maps" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="................................." />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
Related
Hi can anyone help me I just follow the instruction here: developer.android.com/about/versions/12/behavior-changes-12#exported
but still I am getting the same error " You uploaded an APK or Android App Bundle which has an activity, activity alias, service or broadcast receiver with intent filter, but without 'android:exported' property set. This file can't be installed on Android 12 or higher. See: developer.android.com/about/versions/12/behavior-changes-12#exported"
when uploading the file to google play consule App bundles release
<?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="com.Space.Web">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.MICROPHONE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature
android:name="android.hardware.audio.low_latency"
android:required="false" />
<uses-feature
android:name="android.hardware.audio.pro"
android:required="false" />
<uses-feature
android:name="android.hardware.microphone"
android:required="false" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="false" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<application
android:name=".Utilities.MainLanguageApplication"
android:allowBackup="true"
android:icon="#drawable/app_icon"
android:label="#string/your_app_name"
android:networkSecurityConfig="#xml/network_security_config"
android:roundIcon="#drawable/app_icon"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="AllowBackup"
tools:targetApi="n">
<activity
android:name=".Activity.NoInternetConnectionActivity"
android:screenOrientation="portrait" />
<activity
android:name=".Activity.AppIntroActivity"
android:screenOrientation="portrait" />
<activity
android:name=".Activity.Splash"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Activity.WebViewActivity"
android:exported="true"
android:hardwareAccelerated="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="your_host"
android:scheme="https" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="#string/AdMob_app_ID" />
</application>
</manifest>
I am trying to call an activity from a library module in my application. I keep getting the error
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.nextgis.mobile/com.nextgis.mobile.activity.MainActivity}; have you declared this activity in your AndroidManifest.xml?
I am calling the activity as
Intent intentGIS = new Intent(android.content.Intent.ACTION_VIEW);
intentGIS.setComponent(new ComponentName("com.nextgis.mobile",
"com.nextgis.mobile.activity.MainActivity"));
startActivity(intentGIS);
App manifest :
<?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="com.disarm.sanna.pdm">
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission-sdk-23 android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<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_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.READ_SYNC_STATS"/>
<uses-permission android:name="android.permission.USE_CREDENTIALS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<!--
<uses-permission android:name="android.permission.CAMERA"/>
-->
<uses-feature
android:name="android.hardware.location"
android:required="true"
/>
<uses-feature
android:name="android.hardware.telephony"
android:required="false"
/>
<uses-feature
android:name="android.hardware.wifi"
android:required="false"
/>
<!--
<uses-feature
android:name="android.hardware.camera"
android:required="false"
/>
<uses-feature
android:name="android.hardware.compass"
android:required="false"
/>
-->
<supports-screens
android:largeScreens="true"
android:smallScreens="true"
android:anyDensity="true"
android:normalScreens="true"
android:xlargeScreens="true"
android:resizeable="true"
/>
<application
android:allowBackup="true"
android:icon="#drawable/logo"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:node="replace">
<activity
android:name=".SplashActivity"
android:windowSoftInputMode="stateHidden|adjustUnspecified"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.disarm.sanna.pdm.ShareActivity"
android:label="#string/app_name">
</activity>
<activity android:name=".SelectCategoryActivity"
android:label="#string/app_name">
</activity>
<activity android:name=".SocialShareActivity"
android:label="#string/app_name">
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
</activity>
<activity
android:name=".ActivityList"
android:windowSoftInputMode="stateHidden|adjustPan"
android:theme="#style/Theme.AppCompat.DayNight.NoActionBar">
</activity>
<activity
android:name=".Capture.Photo"
android:theme="#style/AppCompatAlertDialogStyle"
>
</activity>
<activity
android:name=".Capture.Video"
android:theme="#style/AppCompatAlertDialogStyle"
>
</activity>
<activity
android:label="Record Audio"
android:name=".Capture.AudioCapture"
android:theme="#style/Theme.AppCompat.Light.Dialog"
>
</activity>
<activity
android:label="#string/allow_setting"
android:name=".WriteSettingActivity"
android:theme="#style/AppTheme"
>
</activity>
<service
android:name=".Service.SyncService"
android:enabled="true"
android:exported="true" />
<service android:name=".DisarmConnect.MyService" />
</application>
</manifest>
Library manifest :
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Project: NextGIS Mobile
~ Purpose: Mobile GIS for Android.
~ Author: Dmitry Baryshnikov (aka Bishop), bishop.dev#gmail.com
~ Author: NikitaFeodonit, nfeodonit#yandex.com
~ Author: Stanislav Petriakov, becomeglory#gmail.com
~ ******************************************************************************
~ Copyright (c) 2012-2016 NextGIS, info#nextgis.com
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nextgis.mobile"
>
<application
android:allowBackup="true"
android:label="#string/app_name"
>
<activity
android:name=".activity.MainActivity"
android:label="#string/app_name"
>
</activity>
<activity
android:name=".activity.SettingsActivity"
android:label="#string/action_settings"
/>
<activity
android:name=".activity.NGWSettingsActivityProxy"
android:label="#string/ngw_settings"
/>
<activity
android:name=".activity.AboutActivity"
android:label="#string/action_help"
/>
<activity
android:name=".activity.CreateVectorLayerActivity"
android:label="#string/create_layer"
android:screenOrientation="portrait"
/>
<service
android:name="com.nextgis.mobile.datasource.SyncService"
>
<intent-filter>
<action
android:name="android.content.SyncAdapter"
/>
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="#xml/syncadapter"
/>
</service>
<provider
android:name="com.nextgis.maplib.datasource.LayerContentProvider"
android:authorities="com.nextgis.mobile.provider"
android:exported="false"
android:syncable="true"
/>
</application>
</manifest>
I have added compile project(':gisapp') in the gradle file for the module app. I know gradle does manifest merging automatically but I could be wrong.
What am I doing wrong here ?
Note : This is the project which I am using as library.
I'm making an application integrated to gcm and I'm keep getting error at this point.
String regid = gcm.register(Common.getSenderId());
Where the word "register" is covered with horizontal line in middle requesting permission com.google.android.c2dm.permission.RECEIVE
I have that permission on my android manifest file but still it keep showing horizontal line and requires permission.
I'm following this tutorial : http://www.appsrox.com/android/instachat/
This is my manifest file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.heylo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="15" />
<permission
android:name="com.example.heylo.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.heylo.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" >
</uses-permission>
<uses-permission android:name="android.permission.WAKE_LOCK" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" >
</uses-permission>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<application
android:name="com.example.heylo.Common"
android:allowBackup="true"
android:icon="#drawable/ic_splash"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
</activity>
<activity android:name=".SplashScreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name="com.example.gcm.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.example.heylo" />
</intent-filter>
</receiver>
<provider
android:name="com.example.heylo.DataProvider"
android:authorities="com.example.heylo.provider"
android:exported="false" >
</provider>
<activity
android:name=".Message_List"
android:label="#string/title_activity_message__list" >
</activity>
<activity
android:name=".SettingsActivity"
android:label="#string/title_activity_settings" >
</activity>
</application>
</manifest>
I am busy with an Android project with the android-support-v7-appcompat library for ActionBar, I have followed the description on Android Developer
but I have got every time NoClassDefFoundError: eu.definecontent.fazilet.HomeFragment.
I can not find where is wrong in the code or configuration, maybe you can find it, I would be glad if you could help me:
MainActivity:
public class MainActivity extends ActionBarActivity {
...
Fragment fragment = new HomeFragment();
...
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.definecontent.fazilet"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
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_FINE_LOCATION" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" >
</uses-permission>
<application
android:name=".FaziletApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat" >
<activity
android:name="eu.definecontent.fazilet.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>
<service android:name=".service.FillDailyTimetableService" />
<activity
android:name=".helper.DownloadManager"
android:theme="#android:style/Theme.Dialog" />
<activity android:name=".CitySettingActivity" />
<activity android:name=".LocationSettingActivity" />
</application>
and configuration are:
Thanks to G V have Finally fixed that!
just added a try catch statement to initialize a static class and everythings works now!
for more info plz see this article:
javareferencegv.blogspot.com
When I'm trying running my app:
No Launcher activity found!
The launch will only sync the application package on the device!
I've readed all questions about similar problems, I changed my manifest.xml but every time I get same error. I stucked for an hour trying to solve this and nothing works.
Here's my manifest fragment:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mosbin"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" >
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="YOUR_OWN_KEY" />
/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.mosbin.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>
<activity
android:name="com.example.mosbin.Run"
android:label="#string/title_activity_run"
android:parentActivityName="com.example.mosbin" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.mosbin" />
</activity>
<activity
android:name=".Stats"
android:label="#string/title_activity_stats"
android:parentActivityName="com.example.mosbin" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.mosbin" />
</activity>
</application>
</uses-sdk>
What's wrong with this code?
Before it appears I just wanted to add new activity ...
< /uses-sdk > clear this tag at the end of your manifest and change this
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" > missing / here
to :
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
Also take these into your application tag :
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="YOUR_OWN_KEY" />
https://developers.google.com/maps/documentation/android/start.
Check the link and the topic under Adding the API Key to your application
This is what you Manifest should look like:
Do note how the various tags have been opened and closed. And nested where required.
Also, read up on the Android Manifest Docs. That will ensure there is no confusion in the future. ;-)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mosbin"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" >
</uses-sdk>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="YOUR_OWN_KEY" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.mosbin.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>
<activity
android:name="com.example.mosbin.Run"
android:label="#string/title_activity_run"
android:parentActivityName="com.example.mosbin" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.mosbin" />
</activity>
<activity
android:name=".Stats"
android:label="#string/title_activity_stats"
android:parentActivityName="com.example.mosbin" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.mosbin" />
</activity>
</application>
</manifest>