Android Google Analytics - adding to which xml? - android

I was instructed to add the following to some file but not sure which one, please help me.
Mark application entry – Manifest
Add Analytics as application name on Manifest entry as below :
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:name=".Analytics">
but my current project manifest already have the following:
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
What should it become now?

This means you have Analytics application class in your app
android:name=".Analytics"
will consider as your application base class.
for more info please refer this link http://developer.android.com/reference/android/app/Application.html

Assuming you are using SDK v4, use the link
The documentation is very straight forward so you shouldn't have any issues integrating it.

Related

Error compiling after AndroidX installation

I recently installed the AndroidX libraries. My problem now:
Didn't find class "androidx.core.app.CoreComponentFactory"
I get an error message. My Mobile App closes after opening screen.
Have you tried this?
Go to Manifest, then add inside the application.
<application
android:allowBackup="true"
android:appComponentFactory="anystrings be placeholder"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="android:appComponentFactory">
Perhaps this is one of the reasons!

Multiple application android:name tags in manifest caused by Configuration my app for multidex

first I'm just a beginner, I'm using android studio and I try to import an Eclipse project, I get this:
"Error:The number of method references in a .dex file cannot exceed
64K"
I try to solve it but I get a duplicate attribute name, is there a way to fix it?
<application
android:name="android.support.multidex.MultiDexApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:name=".App" android:largeHeap="true"
tools:replace="android:icon,android:label,android:theme">
Error:L'attribut "name" lié à l'espace de noms "http://schemas.android.com/apk/res/android" a déjà été spécifié pour l'élément "application".
You must have only one android:name entry, which error message clearly tells you about. Not sure what you wanted to achieve by adding this:
android:name="android.support.multidex.MultiDexApplication"
but if that's your way of doing inheritance, then it's wrong and must be removed. You need to have one android:name pointing to your application class subclass. If you do not provide custom application class then remove all android:name from your <application>
Try remove this from manifest file:
android:name=".App"
So your code be like this:
<application
android:name="android.support.multidex.MultiDexApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:largeHeap="true"
tools:replace="android:icon,android:label,android:theme">

No resource identifier found for attribute 'fullBackupContent' in package 'android'

part of my AndroidManifest.xml
<application
android:allowBackup="true"
android:fullBackupContent="false"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppThemeCompat"
android:largeHeap="true" >
I'm newbie in android developer, i use eclipse mars with sdk 25.1.3 and i get this error. they are no '/xml' folder under 'res/' in my project.
what should i do to fix this issue?
sorry for my english.
Does your manifest tag look like this?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.my.appexample">
I never used "fullBackupContent" but every attribute needs to be declared with the xmlns to use it.
Also, if you say you are new to android development. Why do you need "fullBackupContent" and "largeHeap"? Did you copy that from somewhere or is it on purpose?

Modfiying Android Manifest

So I have been following a tutorial titled 31 days of Android. I am having an issue with one of the tutorials. It calls for me to modify the androidmanifest.xml file but when I do but it doesn't work. Everytime I run the application it crushes after I press button 2. Here is the code they wanted me to add
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:name="MyApplication">
and here is the code looks after I have added that code to my file.
<application android:icon="#drawable/icon" android:label="#string/app_name" android:name="MyApplication">
I did not add the android:icon="#drawable/ic_launcher" because it gave me an error which read "no resoucre found that matches the given name". Any help would be appreciated.
The error is because there is no icon in your project,
Look in Project/res/drawable/ ...
The ic_launcher is the default icon, so just replace
android:icon="#drawable/icon"
By :
android:icon="#drawable/ic_launcher"

Error with <uses-library android:name="com.google.android.maps"/>

I'm trying to develop an app using google maps, but don't know why it still gives me the error, I recheck my manifest file all seems to be ok. here is the manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.interstars"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps"/>
<activity
android:name="com.example.interstars.InterMainActivity"
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>
</manifest>
Error
2 08:47:06 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for C:\Users\uchman\Documents\Work place\InterStars\AndroidManifest.xml: Attribute name "uses-library" associated with an element type "application" must be followed by the ' = ' character.
What sort of thing I missing? I'm still a beginner in android programming.
try put
<uses-library android:name="com.google.android.maps"/>
this line after all activity tags and before the end of application Tag
thanks for all your help..
After stressing myself too much, i decieded to use GoogleMaps API V2. And thanks to the tutorials in https://developers.google.com/maps/documentation/android/ i was able to fix google maps to my app.
P.S GoogleMaps API V2 is much easier for both the user and programmer And no need for the uses-library. All that is required is the Google Play lib..
Try this:
<uses-library android:required="true" android:name="com.google.android.maps"></uses-library>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
The Target of your code must be set on Google API and not Android API.
Your project folder --> properties --> android --> In the project build target select the Google API for your API level.
Please try this :
Right click your projects and click "Android Tools"
Click "Add support Library" and directly add the library
Afterward run this.
I am not Sure but i have faced Same error Once i have started mapview.
the Way i got work around is as below:
if you have copy and paste below line
<uses-library android:name=”com.google.android.maps” />
then the quote("") got turned into a different ASCII VALUE quote character.
You Should Retype the quote characters.
Similar question

Categories

Resources