I am currently using android studio and I have put in my activities in the manifest file and I believe I am calling it correctly. I keep getting this error though:
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {/com.ca.android.easycall.customers1}; have you declared this activity in your AndroidManifest.xml?
This is my Call:
Intent actCustomers1 = new Intent(this, customers1.class);
startActivity(actCustomers1);
Here is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ca.android.easycall"
android:versionCode="1"
android:versionName="1.0" >
<permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.ca.android.easycall.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=".customers1"
android:label="#string/title_activity_customers1" >
</activity>
<activity
android:name=".customers2"
android:label="#string/title_activity_customers2" >
</activity>
</application>
</manifest>
From what you posted, it looks like your class customers1 is not declared in package com.ca.android.easycall
When you have something like android:name=".customers1", Android compiler will try to prepend it with package name package="com.ca.android.easycall", so it becomes com.ca.android.easycall.customers1
Quoted from Android official documentation:
android:name
The name of the class that implements the activity, a
subclass of Activity. The attribute value should be a fully qualified
class name (such as, "com.example.project.ExtracurricularActivity").
However, as a shorthand, if the first character of the name is a
period (for example, ".ExtracurricularActivity"), it is appended to
the package name specified in the element.
However because you got the error log:
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {/com.ca.android.easycall.customers1}; have you declared this activity in your AndroidManifest.xml?
So it must be either customers1 is not declared or customers1 is not in com.ca.android.easycall package
Try this one,
<activity
android:name="com.ca.android.easycall.customers1"
android:label="#string/title_activity_customers1" >
</activity>
<activity
android:name="com.ca.android.easycall.customers2"
android:label="#string/title_activity_customers2" >
</activity>
Please edit your Manifest.xml like this:
<activity
android:name="com.ca.android.easycall.customers1"
android:label="#string/title_activity_customers1" >
</activity>
<activity
android:name="com.ca.android.easycall.customers2"
android:label="#string/title_activity_customers2" >
</activity>
I hope this helps.
Check the package at the top of the activity file. Maybe the activities have a different package than your application.
If it is different change it to the one you have in your manifest com.ca.android.easycall
Related
I am moving from SDK version 30 to 31 and I add android:exported in intent-filter but still I am getting this error:
Merging Errors: Error: android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mycompany.webviewapp">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application
android:name=".App"
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">
<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
<activity android:name="com.mycompany.webviewapp.SplashActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.mycompany.webviewapp.MainActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.VIEW"></action>
</intent-filter>
</activity>
<service android:name="com.mycompany.webviewapp.FCM.MyFirebaseMessagingService">
</service>
<meta-data android:name="applovin.sdk.key"
android:value="sdk api here"/>
</application>
</manifest>
The reason is because some of the dependency libraries that you're using have elements which do not have "android:exported" attribute.
You need to do this:
Lower the version in your gradle to 30 and sync and build.
Go to your AndroidManifest.xml file and click on "Merged Manifest".
Find items such as Activity, Receiver, Service, etc that don't have "android:exported" attribute.
Then add them to your AndroidManifest.xml file in this way.
<activity
android:name="SomeActivity"
android:exported="false"
tools:node="merge"
tools:replace="android:exported" />
Now you can increase your version to 31.
I resolve my issue. I just check the merged manifest and look for reciver. In onesignal, I found out reciver with intent filter defined without android:exported. I just add android:exported="false".
I am trying to have a different app name for an Activity "My Profile Photo" but it does not seem to show up even when I have given android:label="My Profile Pic" to that particular activity
The Manifest File:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.aditya.myprofile">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity"
android:label="My Profile">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ProfilePhoto"
android:label="Profile Pic" ></activity>
</application>
</manifest>
The XML Design:
The Android App name space is empty
Where am I going wrong?
Try this add title through java code add this code in your activity like this
getSupportActionBar().setTitle("My Profile");
I think you need to set a theme to your activity in your manifest.
<activity android:name=".ProfilePhoto"
android:theme="#style/AppTheme"
android:label="#string/profilePicture></activity>
Another solution : in your activity in onCreate you need to call :
getSupportActionBar().setTitle("Your Activity Title");
Here's the error, referring to where I call startActivity(Intent):
`05-17 01:40:37.918: E/AndroidRuntime(12997):android.content.ActivityNotFoundException:
Unable to find explicit activity class {/com.rhombi.Menu}; have you declared
this activity in your AndroidManifest.xml?
Here's how I use startActivity(Intent) in com.rhombi.Intro:
startActivity(iMenu);
Here's how I declare it earlier, in the same class:
public Intent iMenu = new Intent(this, Menu.class);
Here's how I declare it all in my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rhombi"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen" >
<activity
android:name=".Intro"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Menu"
android:label="#string/app_name"
android:screenOrientation="portrait" >
</activity>
</application>
</manifest>
I've searched through a TON of other questions about this and I can't seem to figure out what the issue is. The one thing that makes my issue unique is that little forward slash when it tells me that it's unable to find the explicit activity class ("{/com.rhombi.Menu}"). That never showed up in my searches, but I appear to be doing everything right.
There was something wrong with the this you passed as a Context to the Intent constructor, as evidenced by the empty package name in ComponentInfo {/com.rhombi.Menu} - there's just the class name.
try changing
android:name=".Menu" to android:name="{package name}.Menu"
I have an Android xml file that includes splash and one another activity ım planıng to pass one to another while using ınytent in this context I created a default and launcher category
but eclipse is giving me error that: Tag <category> attribute has invalid character
(actually there is no invalid character)
here is my xml code
(boldline is the line that error occurred)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tesbih"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.tesbih.TesbihMainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
**<category android:name="android.intent.category.DEFAULT "** />
</intent-filter>
</activity>
<activity
android:name="com.tesbih.Splash"
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>
here is also my logcat
Description Resource Path Location Type
The value of the local variable timer is not used Splash.java /Tesbih/src/com/tesbih line 15 Java Problem
Tag attribute name has invalid character ' '. AndroidManifest.xml /Tesbih line 21 Android AAPT Problem
the reason of thıs problem is a bug that bundle has. if you save everythıng and exit
then when you open agaın you should go your xml fıle after makıng anychanges on the name of android name you can save and re exit again when you open your eclipse and android manifest your error sign will be lost
I get the following error but there is no problem in my manifest file.
I tried changing my project name but I got this error once I changed my project name. help me solving this error without changing the project name back to the old one.
My old project name was "radio" my new project name is "Msurvey"
My error:
[2014-02-15 17:35:02 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for H:\radio\AndroidManifest.xml: The element type "manifest" must be terminated by the matching end-tag "</manifest>".
[2014-02-15 17:35:02 - radio] Error in an XML file: aborting build.
This is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.radio"
android:versionCode="1"
android:versionName="1.0" >
<uses-feature android:glEsVersion="0x00020000" >
</uses-feature>
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/mobilesurvey"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.radio.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.example.radio.Res"
android:label="#string/title_activity_res" >
</activity>
<activity
android:name="com.example.radio.Admin"
android:label="#string/title_activity_admin" >
</activity>
<activity
android:name="com.example.radio.View"
android:label="#string/title_activity_view" >
</activity>
<activity
android:name="com.example.radio.View1"
android:label="#string/title_activity_view1" >
</activity>
<activity
android:name="com.example.radio.Answers"
android:label="#string/title_activity_answers" >
</activity>
<activity
android:name="com.example.radio.Data"
android:label="#string/title_activity_data" >
</activity>
<activity
android:name="com.example.radio.Food"
android:label="#string/title_activity_food" >
</activity>
<activity
android:name="com.example.radio.Service"
android:label="#string/title_activity_service" >
</activity>
<activity
android:name="com.example.radio.Services"
android:label="#string/title_activity_services" >
</activity>
<activity
android:name="com.example.radio.Places"
android:label="#string/title_activity_places" >
</activity>
<activity
android:name="com.example.radio.Adminmenu"
android:label="#string/title_activity_adminmenu" >
</activity>
<activity
android:name="com.example.radio.LoginActivity"
android:label="#string/title_activity_login"
android:windowSoftInputMode="adjustResize|stateVisible" >
</activity>
<activity
android:name="com.example.radio.FullscreenActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/title_activity_fullscreen"
android:theme="#style/FullscreenTheme" >
</activity>
<activity
android:name="com.example.radio.Adminlogin"
android:label="#string/title_activity_adminlogin" >
</activity>
<activity
android:name="com.example.radio.Report"
android:label="#string/title_activity_report" >
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
I tried all the similar questions in stackoverflow for this error but none solved my problem. Also all myactivities have their background changed to black as default from white. plz help me solve this color change mainly. Plz help me solve it.
It seems to pass XML validation. You said you did a clean, but what could possibly be the problem is that maybe you're modifying the wrong AndroidManifest.xml. (There are versions of it dynamically created in your bin and gen folders for instance). Check that you're modifying the AndroidManifest.xml in the topmost folder of your project.
remove the stating blank before xml-manifest, see The processing instruction target matching "[xX][mM][lL]" is not allowed
Also you need to place user-permission tags before appliction tag.
Regards,
Alex