android:allowBackup="true" error on "true" - android

I have one problem my code has android:allowBackup="true" error on "true"
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dsadas.bottombardmo">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
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>
</manifest>
I used calculate distance project but there are many projects, when I create a project then error generate of in manifest file.
<application android:allowBackup="true">
Please tell me answer

That's because in some of your libraries, there's at least one that uses allowBackup set explicitly to false. You can use tools:replace in your manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dsadas.bottombardmo"
xmlns:tools="http://schemas.android.com/tools">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="allowBackup">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Related

The activity must be exported or contain an intent-filter - even though there's an intent filter

IDK why it's happening, there's an intent filter in there.
I think I'm missing a tiny problem, that another point of view can detect faster/
thanks!
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.caloriecalculator">
<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=".Login"></activity>
<activity android:name=".MainActivity" />
<activity
android:name=".Register"
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>

Remove MainActivity created by Android Studio

How can edit the manifest so the MainActivity is removed?
I've been following some tutorials to learn to create android apps and I've got stuck in the Activity subject.
When I create a project the Software gives me an deafult activity called MainActivity. I've deleted it so I could name my class as I wish.
However, even after deleting the files the activity still presents on the Manifest. I've tried to play around, deleting some words, but with no success.
This is the current manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidedx.example.activitylifecycle">
<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=".Activity1"></activity>
<activity android:name=".Activity2" />
<activity android:name=".MainActivity">-------<<<<<<0!!!!!!!!!!!!!
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
It has this row of content that the android studio warns me about, that I'm poiting with -------<<<<<<0!!!!!!!!!!!!!.
I recall my question: How can edit the manifest so the MainActivity is removed?
Remove the MainActivity Java file and Manifest Declaration and activity1 set as a LAUNCHER Activity
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidedx.example.activitylifecycle">
<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=".Activity1">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activity2" />
</application>
</manifest>
You can create manifest like this if you want to use other activity
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidedx.example.activitylifecycle">
<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=".Activity1">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activity2" />
</application>
</manifest>
This below code make activity as Main and first launched :
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

I can not run my application Android Studio

Can you help me please?
When I try to run, the compiler show me this. Some idea? Thanks
This is the AndroidManifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.cyrax.rocas">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
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>
<activity android:name=".Infoclase"></activity>
</application>
</manifest>
Clean your project and rebuild it.

I keep getting this error "multiple root tags" and "unexpected end of file"

I keep getting this error "multiple root tags" and "unexpected end of file"
I'm following a book about Android Studio and its telling to write this code. (Down)I've followed what the book said and I just don't get it. Beginning of 1st line bolded and end of 2nd line bolded
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.congruency.bookguide">
<application
android:allowBackup="true"
android:icon="#drawable/cool"
android:label="#string/app_name"
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>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
**Manifest xmlns:android="http://schemas.android.com/apk/res/android"**
package="com.example.activitydemo"
android:versionCode="1"
**android:versionName="1.0"**
Why do you have anything after your closing </manifest> tag? That is the issue.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.activitydemo"
android:versionCode="1">
<application
android:allowBackup="true"
android:icon="#drawable/cool"
android:label="#string/app_name"
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>
</manifest>

The element type "activity" must be terminated by the matching end-tag "</activity>"

I have been trying to find out what went wrong with my mainfest file.
Can't fix it
any comments?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="au.com.itview.shell">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label=""
android:supportsRtl="true"/>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
You are closing your application tag with a / in the opening tag itself. Do this:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label=""
android:supportsRtl="true">
you miss application name in Lable tag this was the mistake in your manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="au.com.itview.shell">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="Your App Name"
android:supportsRtl="true"/>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Proplem is you closed Application tag before Activity.Activity must be inside the Application tag.
use code
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label=""
android:supportsRtl="true">
instead of
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label=""
android:supportsRtl="true"/>

Categories

Resources