Solution: Application Package 'androidmanifest. xml' must have a minimum of 2 segments.

Source: Internet
Author: User
Solution: Application Package 'androidmanifest. xml' must have a minimum of 2 segments.
Androidmanifest has always encountered a problem that cannot be solved when porting the j2_api test project. the package parameter value in XML is incorrect. In the android development environment, the package name must be Level 2 or above.
Application Package 'androidmanifest. XML 'ust have a minimum of 2 segments. this problem has always been a headache for me, because the main class of a large number of j2s projects may only have a first-level package name. At the beginning, I had to use eclipse to reconstruct the package name.
After all, we can only cure the symptoms and never cure the problem. Then we thought of a method: first write a primary activity with a second-level package name, and then use the intent mechanism to start another activity, theoretically, this is acceptable, but the package parameter value is returned because
In the test, we found that to successfully start another activity through intent, you must first start the activity in androidmanifest. this activity can be defined in XML (this application can be another application). If you do not define this activity, you can see a lot of things:
Error/androidruntime (1550): Android. content. activitynotfoundexception: unable to find explicit activity class {finger. mobeasy/test. CJM. report}; have you declared this activity in your androidmanifest. XML?
Later, I did not do anything: it was hard to find it in androidmanifest. XML defines the full name activity and does not think OK. It can be defined in this way. I can only blame myself for understanding the error. I did not take a closer look at the API documentation: from the introduction of nativeactivity in Android API

A typical manifest wowould look like:

<Manifest xmlns: Android = "http://schemas.android.com/apk/res/android"
Package = "com. example. native_activity"
Android: versioncode = "1"
Android: versionname = "1.0" type = "codeph" text = "/codeph">

<! -- This is the platform API where nativeactivity was introduced. -->
<Uses-sdkandroid: minsdkversion = "8"/>

<! -- This. APK has no Java code itself, so set hascode to false. -->
<Applicationandroid: Label = "@ string/app_name" Android: hascode = "false">

<! -- Our activity is the built-in nativeactivity framework class.
This will take care of integrating with our ndk code. -->
<Activityandroid: Name = "android. App. nativeactivity"
Android: Label = "@ string/app_name"
Android: configchanges = "orientation | keyboardhidden">
<! -- Tell nativeactivity the name of or. So -->
<Meta-dataandroid: Name = "android. App. lib_name"
Android: value = "Native-activity"/>
<Intent-filter>
<Actionandroid: Name = "android. Intent. Action. Main"/>
<Categoryandroid: Name = "android. Intent. Category. launcher"/>
</Intent-filter>
</Activity>
</Application>

</Manifest>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.