Error in AndroidManifest.xml “must have a minimum of 2 segments”

三世轮回 提交于 2019-12-23 19:55:46

问题


I tried change my package name like com.project_name but it didn't figure out. What is the real problem in my project?

I'm getting the following error:

Error in AndroidManifest.XML file "Application package 'AndroidManifest.xml' must have a minimum of 2 segments"

AndroidManifest.XML file;

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.rssreader"
    android:versionCode="2"
    android:versionName="1.01" >

    <uses-sdk
        android:maxSdkVersion="15"
        android:minSdkVersion="7" />

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true" />

    <application
        android:icon="@drawable/icon"
        android:label="@string/app_name" >
        <activity
            android:name=".splash"
            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>

回答1:


This may be a red herring. I've never got it because I've always used full corporate hierarchy (which has certainly been longer than two levels deep). You do not show (why would you know to show it?) the package name of your main ListActivity code. Let's say this is RssReader.java: This must be at com.rssreader.RssReader.java. That should do it. If you find your main activity isn't at that place, fix it. If it still doesn't work, then add an additional level of hierarchy to your package name and try that too, which surely should solve it. Hope this helps.




回答2:


At least when I started my project creation starting from this page
http://docs.phonegap.com/en/2.3.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android

I got exactly same problem. That was solved by using the following command to create a project.

.\create c:\html\myapp **com.**my_package my_app

In the original instructions, com. was missing.
This solved my problem



来源:https://stackoverflow.com/questions/13417302/error-in-androidmanifest-xml-must-have-a-minimum-of-2-segments

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!