Google Maps API Android build gradle parse failing with Google Services integration - android

So I am developing a map using Google Maps API for Android Studio. I can get a running build on my phone (Android 28.0) but it has no data on it, it's just a blank map. As soon as I start adding google services it gives me new errors.
ERROR: Failed to parse XML in C:\Users\Madzp\Desktop\MapsRedo\app\src\main\AndroidManifest.xml
ParseError at [row,col]:[11,5]
Message: expected start or end tag
Affected Modules: app
This directs me to my manifest which edits the <application> tag with
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:hardwareAccelerated ="true"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MapsActivity"
android:label="#string/title_activity_maps">
<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.geo.API_KEY"
android:value="#string/google_maps_key" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<uses-library
android:name="org.apache.http.legacy"
android:required="false"/>
</application>
How do I sort this parsing error as it always makes my project gradle sync fail?
Thanks,

Related

Unable to launch android app from launcher

I am launching my android app from android studio, the app is working fine but unable to launch it from the launcher as it is not showing up there. Looking at other posts it seems that this issue could be because of incorrect AndroidManifest.xml, but mine seems to fine based on other answers.
Below is AndroidManifest.xml from my project.
Full file is here -> https://pastebin.com/E7KMxQZD
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
<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>
</application>

Failed to add play-services to android studio

I want to do a practice project that i can find my location by google map. at first i installed google play service lib :
second, I add FINE permission and mate tag on manifest :
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<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">
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version"/>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
third, I have added this lib on build.gradle:
compile 'com.google.android.gms:play-services:11.0.1'
but when i am syncing project< i got this error:
Error:(29, 13) Failed to resolve: com.google.android.gms:play-services:11.0.1
and Avoid using bundled version of Google Play services SDK.
what can i do? what any dependency i need?
Implement separate lib of google play services, that is more efficient than using the whole package. Use only required lib.
https://developers.google.com/android/guides/setup

Installing app debug but not able to open

Here is my android manifest file. I can install the apk, but I cannot open it. How do I allow it to open?
`
<application
android:allowBackup="true"
android:icon="#drawable/lockicon"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- ATTENTION: This was auto-generated to add Google Play services to your project for
App Indexing. See https://g.co/AppIndexing/AndroidStudio for more information. -->
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
`
No Activity is registered in your manifest file. Register your activities in manifest and also initialize launcher screen. For more read https://developer.android.com/reference/android/app/Activity.html

Read_gservices permission not found in android

I am trying to integrate Google maps in my android project. I have installed latest Google play services in my emulator and given all the necessary permissions in the manifest file. It still shows that G_services not found.
Your metadata tag is inside the tag. Remove and place it right after the application tag:
<application
android:allowBackup="true"
android:icon="#drawable/logo"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBOhdOOMI_ZMYlvSyi7DVeRe_bo9ckxehM" />
<meta-data
android:name="android.app.searchable"
android:resource="#layout/searchable" />
</application>

Google Play Services: Can't solve the SIGN_IN_REQUIRED error

Before I back-pedalled into using the clean template activity, I had manually created an app that uses the GoogleAPIClient, which resulted in the app working (probably) on my device, but not on any other.
From creating the template Google Play activity, I only changed the manifest to include the app_id that I have registered with my Google Play Service account. When launching the app it shows a brief "Logging in" popup from Google Play, then continually tries to reconnect. Have tried with different devices on different computers. Have tried with both the owner's and assigned tester accounts. Same result.
I can't use any invite or room creating services.
Here is my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.kai.twincrawler" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".TwinCrawlerActivity"
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.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="#string/app_id"/>
<meta-data android:name="com.google.android.gms.appstate.APP_ID"
android:value="#string/app_id"/>
</application>
</manifest>
Thanks for any help you can provide.

Categories

Resources