After app installation I can't open it - android

I have created an simple app with a few activities. After successful installation I can't open the app. I can just see it in device's apps.
Yes of course a read all the answers telling "You have to set launcher activity". But I set launcher activity.
Here is AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cz.jacon.davodani"
android:versionCode="0"
android:versionName="0.1">
<application
android:icon="#drawable/logo"
android:label="#string/app_name"
android:theme="#style/Theme">
</application>
<activity
android:name=".activities.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.SearchActivity"
android:label="#string/search_activity">
</activity>
<activity
android:name=".activities.CustomerActivity"
android:label="#string/customer_activity">
</activity>
<activity
android:name=".activities.CreditActivity"
android:label="#string/credit_activity">
</activity>
<activity
android:name=".activities.PrintReceiptActivity"
android:label="#string/print_receipt_activity">
</activity>
<activity
android:name=".activities.ProductActivity"
android:label="#string/product_activity">
</activity>
Never before happened to me... Can you give me some advice? Thanks a lot

All your activities are required to be defined within the <application> tag.
<application
android:icon="#drawable/logo"
android:label="#string/app_name"
android:theme="#style/Theme">
<!-- Add activites here -->
</application>

Your manifest should look like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="cz.jacon.davodani"
android:versionCode="0"
android:versionName="0.1">
<application
android:icon="#drawable/logo"
android:label="#string/app_name"
android:theme="#style/Theme">
<activity
android:name=".activities.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar">
<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="cz.jacon.davodani"
android:versionCode="0"
android:versionName="0.1">
<application
android:icon="#drawable/logo"
android:label="#string/app_name"
android:theme="#style/Theme">
<activity
android:name=".activities.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.SearchActivity"
android:label="#string/search_activity">
</activity>
<activity
android:name=".activities.CustomerActivity"
android:label="#string/customer_activity">
</activity>
<activity
android:name=".activities.CreditActivity"
android:label="#string/credit_activity">
</activity>
<activity
android:name=".activities.PrintReceiptActivity"
android:label="#string/print_receipt_activity">
</activity>
<activity
android:name=".activities.ProductActivity"
android:label="#string/product_activity">
</activity>
</application>
</manifest>
try Replacing your manifest with this..

Change your AndroidManifest.xml structure to -
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cz.jacon.davodani"
android:versionCode="0"
android:versionName="0.1">
<application
android:icon="#drawable/logo"
android:label="#string/app_name"
android:theme="#style/Theme">
<activity
android:name=".activities.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activities.SearchActivity"
android:label="#string/search_activity">
</activity>
<activity
android:name=".activities.CustomerActivity"
android:label="#string/customer_activity">
</activity>
<activity
android:name=".activities.CreditActivity"
android:label="#string/credit_activity">
</activity>
<activity
android:name=".activities.PrintReceiptActivity"
android:label="#string/print_receipt_activity">
</activity>
<activity
android:name=".activities.ProductActivity"
android:label="#string/product_activity">
</activity>
</application>
</manifest>
All activities tag must be placed inside <application> tag and it should be placed inside <manifest> tag.

Related

I can't see my app icon in my phone

I use Android Studio
I build the app and play in device.
but, in device's normal display(like when phone open state),
I can't see the icon
In device Setting, I find the app in application manager,
but I can't see in normal display
this is my androidmanifest.xml
<application
android:allowBackup="true"
android:icon="#drawable/imagebutton_on"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Activity.SplashActivity"
android:theme="#style/AppTheme"
android:icon="#drawable/imagebutton_on"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="roid.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I embrassed of that
please help me
this is my full android-manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.thewell_dev.fourscompany">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.BROADCAST_STICKY"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#mipmap/imagebutton_on"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Activity.SplashActivity"
android:theme="#style/AppTheme"
android:icon="#mipmap/imagebutton_on"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="roid.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:host="example.com"></data>
<data android:scheme="http"></data>
<data android:pathPattern="/.*"></data>
</intent-filter>
</activity>
<activity android:name=".Activity.LoginActivity">
</activity>
<activity android:name=".Activity.JoinActivity"
android:theme="#style/SplashTheme"
>
</activity>
<activity android:name=".Activity.MainActivity"
android:theme="#style/ListTheme"
android:icon="#mipmap/imagebutton_on"
>
</activity>
<activity android:name=".Activity.CompanyActivity"
android:theme="#style/CompanyTheme"
android:configChanges="orientation|keyboardHidden|screenLayout|screenSize"
>
</activity>
<activity android:name=".Activity.CardActivity"
android:theme="#style/SplashTheme"
>
</activity>
<activity android:name=".Activity.CardListActivity"
android:theme="#style/SplashTheme"
>
</activity>
<activity android:name=".Activity.CardPreviewActivity">
</activity>
<activity android:name=".Activity.ManagementActivity">
</activity>
<activity android:name=".Activity.BeaconActivity">
</activity>
<activity android:name=".Activity.CompanyCardActivity"
android:theme="#style/SplashTheme"
>
</activity>
<activity android:name=".Activity.PreferencActivity"
android:theme="#style/SplashTheme"
>
</activity>
<activity android:name=".Activity.FileListActivity">
</activity>
<activity android:name=".Activity.PasswordChangeActivity"
android:theme="#style/SplashTheme"
>
</activity>
<activity android:name=".Activity.RemoveUserActivity"
android:theme="#style/SplashTheme"
>
</activity>
<activity android:name=".Activity.ProvisionActivity">
</activity>
<activity android:name=".Activity.QuestionActivity">
</activity>
<activity android:name=".Activity.ExpandActivity">
</activity>
<activity android:name=".Activity.CardPrecaptureActivity"
android:theme="#style/SplashTheme"
>
</activity>
<activity android:name=".Activity.BookMarkActivity"
android:theme="#style/SplashTheme"
>
</activity>
<activity android:name=".Activity.FindPasswordActivity"
android:theme="#style/SplashTheme"
>
</activity>
<activity android:name=".Activity.CardListDetailActivity">
</activity>
<activity android:name=".Activity.UploadCertificationActivity">
</activity>
<activity android:name=".Activity.UploadRewardActivity">
</activity>
<activity android:name=".Activity.OnOffProductActivity"
>
</activity>
<activity android:name=".Activity.OnOffCompanyActivity"
>
</activity>
</application>
</manifest>
App Icon should be placed in mipmap folder. Move your imagebutton_on in res\mipmap\ and Replace below code from application tag:
android:icon="#drawable/imagebutton_on">
With:
android:icon="#mipmap/imagebutton_on"
And resolve the following issue, as Markus Kauppinen mentioned:
<category android:name="roid.intent.category.LAUNCHER" />
To:
<category android:name="aroid.intent.category.LAUNCHER" />
Hope this helps.
Try by removing following lines from all activity tags
android:icon="#mipmap/imagebutton_on"
Keep it in only application tag.

Cannot change intent filter in android manifest

I have 3 activities in this android studio project. I'm tasked with starting them each separately by moving the intent filter into the activity, however I'm unable to start one of my activities. The same activity doesn't have a /activity> closing tag and I'm not sure why. Any help would be greatly appreciated.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sean.lab1">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".StartActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".LoginActivity"
android:label="#string/title_activity_login"
android:theme="#style/AppTheme.NoActionBar" />
<activity android:name=".ListItemsActivity"></activity>
</application>
</manifest>
I am able to move the intent tag to my ListItemsActivity and it will start, but I am not able to move the intent filter tag to my LoginActivity, nor does LoginActivity have a closing </activity> tag.
Here is what you want to do
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".StartActivity">
</activity>
<activity
android:name=".LoginActivity"
android:label="#string/title_activity_login"
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=".ListItemsActivity"></activity>
</application>
Try this.
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".StartActivity"></activity>
<activity
android:name=".LoginActivity"
android:label="#string/title_activity_login"
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=".ListItemsActivity"></activity>
</application>

show 2 apps when debugging in android

When I debug and install app in device, it's show 2 apps install in device (one open with Splashscreen & another open without Splashscreen ) . Guide me, what I'm doing wrong.
here is my manifest file.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.soft.prmk.alle"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:hardwareAccelerated="true"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
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=".SplashScreen"
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>
You have two Launcher Activities: MainActivity and SplashScreen. Remove one of those. Try this:
<?xml version="1.0" encoding="utf-8"?>
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:hardwareAccelerated="true"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".SplashScreen"
android:label="#string/app_name"
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=".MainActivity"
</activity>
</application>
You have two LAUNCHER thats the issue
<category android:name="android.intent.category.LAUNCHER" />
Make it DEFAULT in MainActivity.
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
You have 2 launcher activities, remove intent-filter from one. I think SplashScreen should be launcher activity so remove from MainActivity
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

Error:Cannot read packageName from app/src/main/AndroidManifest.xml

These are the errors that pop up when running my app for splash screen.
Error:The markup in the document preceding the root element must be well-formed.
Error:Cannot read packageName from /Users/akellavamsimeher/AndroidStudioProjects/WILM/app/src/main/AndroidManifest.xml
I tried to resolve seeing posts from stackoverflow but I'm still stuck at that. Please help me fix these errors.
Here is the code.
<?xml version="1.0" encoding="utf-8"?>
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pratyuvamgmail.wilm">
<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"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
android:name="com.pratyuvamgmail.wilm.Splash" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action
android:name="com.coderefer.androidsplashscreenexample.MAINACTIVITY"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>
Below is my code...
<?xml version="1.0" encoding="utf-8"?>
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pratyuvamgmail.wilm">
<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"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
android:name="com.pratyuvamgmail.wilm.Splash" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.coderefer.androidsplashscreenexample.MAINACTIVITY"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>
First impression is that you manifest file (src/main/AndroidManifest.xml) does not start like follows:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.package.name" >
...
</manifest>
Or it has a invalid format...
Share your manifest file and then, we will be able to see exact error
Answer from here is checking that the applicationId is set in the defaultConfig in build.gradle ,
because the applicationId in build.gradle overrides the package in <manifest>.
Your manifest is wrong, you have duplicate the tag close manifest and some tags have wrong open/close tags.
A simple example could be:
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<application>
<activity>
<intent-filter>
<action />
<category />
<data />
</intent-filter>
<meta-data />
</activity>
<activity-alias>
<intent-filter> . . . </intent-filter>
<meta-data />
</activity-alias>
<service>
<intent-filter> . . . </intent-filter>
<meta-data/>
</service>
<receiver>
<intent-filter> . . . </intent-filter>
<meta-data />
</receiver>
<provider>
<grant-uri-permission />
<meta-data />
<path-permission />
</provider>
<uses-library />
</application>
</manifest>
Check android documentation for more info:
https://developer.android.com/guide/topics/manifest/manifest-intro.html
Check if works this code for you:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pratyuvamgmail.wilm">
<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"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>

Android Studio Apps Launcher missing but installed

I have read some other question about this problem and after trying,editing and inspecting my manifest , my Apps Launcher still doesnt appear
here is my manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.common.myappname">
<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"
android:label="#string/app_name"
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=".MerchantActivity"
android:label="#string/title_activity_merchant"
android:theme="#style/AppTheme.NoActionBar">
</activity>
<activity
android:name=".SlidingTabsActivity"
android:label="#string/title_activity_voucher"
android:theme="#style/AppTheme.NoActionBar">
</activity>
</application>
</manifest>
Thanks, i appreciate any help offered.

Categories

Resources