Android Manifest Attribute "name" File Error - java

I was following the Dev guide on Vunglee:
https://github.com/Vungle/vungle-resources/blob/master/English/Android/3.2.x/android-dev-guide.md
Eclipse gives me this error in my manifest file
Attribute "name" bound to namespace "http://schemas.android.com/apk/res/android" was already specified for element "activity".
My code is :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kilobolt.FlyingJesus"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="5"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.kilobolt.ZombieBird.MainActivity"
android:name="com.vungle.publisher.FullScreenAdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Please help me, what is the problem. And i'm newbie in java.

can't give two names to same activity. Error is in below lines
android:name="com.kilobolt.ZombieBird.MainActivity"
android:name="com.vungle.publisher.FullScreenAdActivity"
As kalyan pvs mentioned in comment, check for other duplicate attributes also.

Do not use same tag to declare two Activity in AndroidManifest file,
Make 2 different tag to declare it like this:
<activity android:name="com.kilobolt.ZombieBird.MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.vungle.publisher.FullScreenAdActivity"
android:configChanges="keyboardHidden|orientation|screenSize">
</activity>

Related

Android icon missing when uploading to playstore

When I install my application it's working fine, the icon is displayed and have no issues, however when installing the application on the device from the apk it does not show the application name, it shows the package with no icon, when uploading to playstore it gives me an error stating I should add an icon to the application.
This use to work until recently.
ic_launcher icon file does exist.
my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.package">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:name="android.support.multidex.MultiDexApplication">
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name="com.my.package.MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="com.my.package.LoginActivity"
android:label="#string/title_activity_login"
android:theme="#style/Theme.CustomTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.my.package.NotificationsActivity"
android:label="#string/title_activity_login"
android:theme="#style/AppThemeNoti"></activity>
<service android:name="com.my.package.FirebaseService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name="com.my.package.FirebaseToken">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="keyhere" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
I found the problem:
<application
android:name="android.support.multidex.MultiDexApplication">
I removed the > after MultiDexApplication. Figured the android:icon was greyed out and hence not working.
Thanks.

Android Studio Not Finding Main Activity

I created a new class in my project called UserTypeSelection.java and wanted to set it as the main activity which launches when I run the app. I've changed the manifest file to contain an intent filter and also tried editing the configurations to set it as the default activity, however I keep receiving the error:
Error running app: The activity must be exported or contain an intent-filter
My manifest file is as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.XXXXX.computerscienceinduction">
<uses-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">
<activity android:name=".UserTypeSelection" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<activity android:name=".RegistrationActivity"></activity>
<activity android:name=".MainActivity" />
<activity android:name=".LoginActivity" />
<activity android:name=".ProfileActivity" />
</application>
</manifest>
How can I resolve this issue. Any help is appreciated, thank you.
You are closing your activity xml tag before you have specified the IntentFilter.
Change your declaration to this.
<activity android:name=".UserTypeSelection" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
UserTypeSelection must be activity and it must be using intent filters you have not closed activity after intent filter it is closed before.
Try this,
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.XXXXX.computerscienceinduction">
<uses-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">
<activity android:name=".UserTypeSelection">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".RegistrationActivity"/>
<activity android:name=".MainActivity" />
<activity android:name=".LoginActivity" />
<activity android:name=".ProfileActivity" />
</application>
</manifest>

Android No Launcher Icon

I am developing an app and somehow after fixing up some things in the manifest file there is no app icon so I cannot launch the app from the app drawer anymore :/ I was looking at some other threads but they gave me no luck
Here is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.emiliogaines.fuelfinder" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<data android:scheme="db-XXX" />
<meta-data
android:largeHeap="true"
android:name="com.google.android.maps.v2.API_KEY"
android:value="XXX-XXX" />
<activity
android:name="com.dropbox.client2.android.AuthActivity"
android:launchMode="singleTask"
android:configChanges="orientation|keyboard">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
first make sure your folder 4 mipmap folders exists in folder res, and...
<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>
You have this in your code:
android:icon="#mipmap/ic_launcher"
You have to check if this path is correct (If you have an Android Studio's project, you have to go to your project's folder, go to "app>src>main>res>mipmap" and check if there is a image file called "ic_launcher" -probably a PNG-).
Good look
app icon determine from here android:icon="#mipmap/ic_launcher"
make sure this path is not Empty and make sure you have ic_launcher in all other drawable folers
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >

Error message with code: “URL scheme in your app's manifest is not set up correctly.” [duplicate]

I am trying to upload a text file to my Dropbox, but it shows an error in manifest.
This is my Manifest file and the logcat error, what am I doing wrong can anyone help me please...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ondropbox"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.ondropbox.MainActivity"
android:launchMode="singleTask"
android:configChanges="orientation|keyboard" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<data android:scheme="db-5qiq4z06ikagxfb" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
The Error is:
**java.lang.IllegalStateException: URI scheme in your app's manifest is not set up correctly. You should have a com.dropbox.client2.android.AuthActivity with the scheme: db-5qiq4z06ikagxfb**
What should I do?
Thanks for any kind of help.
because you are missing to add activity,,,
<activity
android:name="com.example.ondropbox.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.dropbox.client2.android.AuthActivity"
android:configChanges="orientation|keyboard"
android:launchMode="singleTask" >
<intent-filter>
<data android:scheme="db-5qiq4z06ikagxfb" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
and you are done.
I had a very similar issue after migrating my app from Dropbox API v1 to v2. I used an official tutorial for migration - https://www.dropbox.com/developers/reference/migration-guide, but there are no word about Android, only basic examples in Java. So I opened this GitHub repo and used it as reference - https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android.
But in new API they changed a package of AuthActivity and I forgot to check, so had a Runtime crash - Unable to find com.dropbox.core.android.AuthActivity.
The solution is to change old package to new one - com.dropbox.client2.android.AuthActivity to com.dropbox.core.android.AuthActivity.

Android virtual KeyBord and Edit Text

I have a problem with my virtual keyboard, it hides the text boxes in which I want to write
my xml manifest, I added code to try but nothing works (Still the keyboard hides text boxes ):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="
http://schemas.android.com/apk/res/android"
package="com.example.Pointage"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:windowSoftInputMode="adjustPan"
>
<activity
android:name="com.example.test.MainActivity"
android:label="#string/app_name"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.test.Activity2"
android:label="#string/title_activity_activity2"
>
</activity>
<activity
android:name="com.example.test.Bdd"
android:label="#string/title_activity_bdd" >
</activity>
</application>
</manifest>
try this:
android:windowSoftInputMode="stateVisible|adjustPan"
or
android:windowSoftInputMode="stateVisible|adjustResize">
Reference link
This should work
android:windowSoftInputMode="adjustPan"

Categories

Resources