I have some problems with manifest in android java programming. I do not know how to fix it. Any help is appreciated.
It says The processing instructions goal match........ is not allowed. And in the beginning: Serious: null = SERIOUS : null – .
And: Error:Cannot read packageName from C:\Users\arnpet\AndroidStudioProjects\UltimateHogskoleprovet\app\src\main\AndroidManifest.xml
Here is the manifext file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.arnpet.ultimatehogskoleprovet" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<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>
<activity
android:name=".pageBeforeAction"
android:label="#string/title_activity_page_before_action" >
</activity>
<activity
android:name=".toppLista"
android:label="#string/title_activity_topp_lista" >
</activity>
<activity
android:name=".information"
android:label="#string/title_activity_information" >
</activity>
<activity
android:name=".GameAction"
android:label="#string/title_activity_game_action" >
</activity>
<activity
android:name=".QuestionBox"
android:label="#string/title_activity_question_box" >
</activity>
</application>
It seems like your AndroidManifest.xml is malformed. Its missing the opening & closing tags.
Try to create a new project and look at its AndroidManifest.xml.
The beginning of an Android Manifest usually looks like:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xyz"
android:versionCode="229"
android:versionName="2.2.9" >
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="15" />
<uses-permission ... />
<application>...</application>
</manifest>
Inside your <manifest> tag set attribute package = "[your package]".
First of all: Is this the whole AndroidManifest.xml? Because you missing the manifest tag. In this tag, there is a attribute package defining the packagename of your app.
See the documentation for more information and example of a complete manifest file.
Related
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.fikriapp"
android:versionCode="1"
android:versionName="1.0">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="FikriApp"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity"/>
<activity android:name="View.SplashScreen" android:theme="#style/FullScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
This is my manifest code, I want to change the main launcher from MainActivity to my SplashScreen but after I change it, I am not able to debug it because of an error from the manifest. It's Kotlin, not java
<activity android:name="View.SplashScreen"
This is a problem. The package parser that decodes the manifest at installation time expects the package names to be in lowercase, for example view.SplashScreen. The java class name can be in UpperCamelCase.
If you want the package name be relative to your top-level package com.example.fikriapp, then also add a . prefix like .view.SplashScreen.
I have a problem: I want to start an Activity from another application and for that I did the following:
public void startMyActivity(View view){
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("com.package", "com.package.MyActivity"));
startActivity(intent);
}
But I get the error: Unable to find explicit activity com.package/com.package.MyActivity. Also I declared the MyActivity as activity in the manifest file and I still get the same error. What am I doing wrong? Thanks!
Manifest file of the application A(from which I want to start the activity):
<?xml version="1.0" encoding="utf-8"?>
package="com.example.appA"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
and this is the Manifest file of the application B(which contains the activity that should be started):
<?xml version="1.0" encoding="utf-8"?>
package="com.mypackage.package.appB"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="16" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name="com.package.MyPackage"
android:label="#string/title" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Ok so I found my solution. It is a bit frustrating. So.. I tried all the thinks that you guys suggested(I appreciate that) but nothing worked. So my thoughts guided me to use the adb shell to see how it is my application B named and I found out that it is not only com.package, but it's com.mypackage.package(the name mypackage/pakcage are not relevant, only for example purposes). After that I checked the manifest for the application B and saw that the "package" attribute has as value com.mypackage.package. Thank you again!
I want to add another project to my app. But it uses its own "application tag" in AndroidManifest file. And one of its class extends Application
So the problem is I use my own "application" preferences. How can I integrate this new project's "application" preferences to mine ? Will I change somethings on "class extends Application" ?
<activity android:name="com.my.other.project.package.name.MyClassName">
by this you could add your other project activity.
Only the <manifest> and <application> elements are required, they each must be present and can occur only once.
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.animal.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="myOtherPackageName.MyClassName"/> // here where you put your other package name.
</application>
I installed BB tools for Eclipse, just added and removed BB Nature to one of my projects.
And now, I can't compile it (for Android).
Eclipse told me about some troubles in AndroidManifest.xml:
native-code: armeabi AndroidManifest.xml /VitocarsAndroidApp AndroidManifest.xml BlackBerry Verifying Problem
But the manifest is OK, no one line is highlighted:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.asap.vitocarsandroidapp"
android:versionCode="5"
android:versionName="1.04" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:name="com.asap.vitocarsandroidapp.system.VitocarsApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.asap.vitocarsandroidapp.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="com.asap.vitocarsandroidapp.TableViewActivity"
android:label="#string/title_activity_table_view" >
</activity>
<activity
android:name="com.asap.vitocarsandroidapp.PartActivity"
android:label="#string/title_activity_part" >
</activity>
<activity
android:name="com.asap.vitocarsandroidapp.PhotoViewActivity"
android:label="#string/title_activity_photo_view" >
</activity>
<activity
android:name="com.asap.vitocarsandroidapp.UserRegisterActivity"
android:label="#string/title_activity_user_register" >
</activity>
<activity
android:name="com.asap.vitocarsandroidapp.ConfirmPhoneActivity"
android:label="#string/title_activity_confirm_phone" >
</activity>
<activity
android:name="com.asap.vitocarsandroidapp.OfficeActivity"
android:label="#string/title_activity_office" >
</activity>
<activity
android:name="com.asap.vitocarsandroidapp.PriceOfferActivity"
android:label="#string/title_activity_price_offer" >
</activity>
<activity
android:name="com.asap.vitocarsandroidapp.RegionOrderActivity"
android:label="#string/title_activity_region_order" >
</activity>
<activity
android:name="com.asap.vitocarsandroidapp.MapView"
android:label="#string/title_activity_map_view" >
</activity>
</application>
</manifest>
I already spent a lot of time, trying to solve it.
Maybe, somebody can help me?
Had the exact same issue.
Only uninstalling the Blackberry plugin solved it for me.
I guess that the Blcackberry plugin still left some remainders in the validation process of Eclipse, even though I removed the Blackberry nature from the project.
Check the .project file and remove all the * rim * stuff.
A build command and nature was leftover when i ran into this problem.
I was making a simple text field and 'send' button to display whatever the user typed in the text field. The program is completely illustrated in the Android training tutorials by android.com.
Whenever I'm adding the Activity DisplayMessageActivity, I'm getting "Duplicate attribute" as an error. Here's the code:
<application
<activity android.name="DroidStart"/>
<activity
android:name="com.start.droidstart.DisplayMessageActivity"
android:label="#string/title_activity_droid" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Update: I fixed the problems that were pointed out, but I'm still getting the error. Here's my current AndroidMainfest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.start.droidstart"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="DroidStart"
android:name="com.start.droidstart.DisplayMessageActivity"
android:label="#string/title_activity_droid" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
The error looks like this
Error parsing XML; duplicate attribute. type Android AAPT problem.
My problem was the tools:replace duplicated.
Fixed easy:
tools:replace="android:label,android:theme">
You have at least two errors:
Be sure to close your <application> tag.
Use android:name, not android.name.
So the first 3 lines should change from:
<application
<activity android.name="DroidStart"/>
to
<application>
<activity android:name="DroidStart"/>
Update:
In your updated code, you have:
<activity
android:name="DroidStart"
android:name="com.start.droidstart.DisplayMessageActivity"
You are using android:name twice, which is why you are getting this error. You should probably change this to:
<activity
android:name=".DisplayMessageActivity"
assuming DisplayMessageActivity is the class name of the Activity you which to refer to.
Last, you forgot your manifest end tag: you should have </manifest> at the very end of your file.
change
android.name
into
android:name
on the first line...
For instantapp project also check that you have
xmlns:android = "http://schemas.android.com/apk/res/android"
in app AndroidManifest.xml in manifest tag.
use
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.start.droidstart"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/title_activity_droid" >
<activity
android:name=".DisplayMessageActivity"
android:label="#string/title_activity_droid" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".DroidStart"/>
</application>
</manifest>
instead of
<application
<activity android.name="DroidStart"/>
you are using "android.name" instead of "android:name" for declaring activity in manifest and also close first application tag as <application>