Intent activity class not working - java

hey guys so im having a problem when trying to run the emulator of my application on android studio. this is the error im getting:
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.dre.appli/com.example.dre.appli_app.LoginActivity }
Error type 3
Error: Activity class {com.example.dre.appli/com.example.dre.appli_app.LoginActivity} does not exist.
ive tried everything that people have suggested to no avail. here is my manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.wheretas.appli_app">
<!-- To auto-complete the email text field in the login form with the user's emails -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".LoginActivity"
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=".CreateAccount"
android:label="#string/title_activity_create_account"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="app.createaccount" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

I suppose your LoginActivity has a package com.example.dre.appli_app.LoginActivity
But your manifest's package is different:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.wheretas.appli_app">
...
Try to set it com.example.dre.appli_app

Related

how to fit xml file for all screen size of android phone?

I have created an android application. my app is currently working fine. but when i install this app to other device like 3.7" display size phone, some of activity's text view, button etc will cut. i want to make this auto for every screen size.
can you please inform me that how can i do that easily without bugs?
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.gurujibd.bornomala.alphabet">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<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=".MainActivity"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SorBorno"
android:screenOrientation="landscape" />
<activity
android:name=".BenjonBorno"
android:screenOrientation="landscape" />
<activity
android:name=".ShongKha"
android:screenOrientation="landscape" />
<activity
android:name=".PoriChiti"
android:screenOrientation="landscape" />
</application>
</manifest>

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 app don't run on the device or emulator?

This is my manifest file that my issue is with. Apk installed on the device but I don't see it in the apps and it doesn't launch as it supposed to. I bought this project for 79 dollars but the supplier is now unreachable.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.electricpunch.wallpaper"
android:versionCode="1"
android:versionName="1"
android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="7" />
<uses-feature android:name="android.software.live_wallpaper" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<service
android:name="com.electricpunch.wallpaper.PlanetWallpaper"
android:label="#string/app_name"
android:permission="android.permission.BIND_WALLPAPER" >
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="#xml/wallpaper" />
</service>
<activity
android:label="#string/settings"
android:name="com.electricpunch.wallpaper.PlanetSettings"
android:exported="true"
>
</activity>
<!-- Ads Using Google Play Services SDK -->
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|u iMode|screenSize|smallestScreenSize" />
</application>
</manifest>
It's difficult to answer without knowing which Activity was meant to be the launcher activity in the first place.
But you could try modifying this portion of your manifest,
<activity
android:label="#string/settings"
android:name="com.electricpunch.wallpaper.PlanetSettings"
android:exported="true"
>
</activity>
to,
<activity
android:label="#string/settings"
android:name="com.electricpunch.wallpaper.PlanetSettings"
android:exported="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Though your best bet is to contact the person you got the app from.
Your app does not launch because no activtity is decalred to be launch in your manifest.
I don't know which activity you want to use but to be launch from laucher your app should have an activty declared like this :
<activity android:name="your.package.YourActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Android Manifest Attribute "name" File Error

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>

Categories

Resources