解决:Application package 'AndroidManifest.xml' must have a minimum of 2 segments.
来源:互联网 发布:sass node.js 编辑:程序博客网 时间:2024/05/18 02:20
在移植J2ME API测试项目时,一直碰到一个问题得不到解决就是AndroidManifest.xml下的package参数值问题,在Android开发环境中要求package包名必须是二级以上否则编译时
Application package 'AndroidManifest.xml' must have a minimum of 2 segments.这个问题一直让我头疼,因为大量J2ME项目中其主类可能只是一级包名,刚开始只能忍着利用Eclipse重构包名,还好这个方便
可毕竟只能治标不治本,后来想到一个方法:先写个启动的有二级包名的主Activity,然后利用Intent机制在这个Activity去启动另外一个,理论上是通的,可是绕来绕去有回到了这个package参数值问题,因为测
试中发现要想通Intent成功启动另外一个Activity,首先必须在AndroidManifest.xml(可以本应用的也可以是另外一个应用的)下定义这个Activity,如果你不定义那就去见一大堆的:
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?
后来实在没招:就硬硬生生的在AndroidManifest.xml定义了全名Activity没想OK了,原来其实可以这样定义,只能怪自己理解有误,没仔细看API文档
A typical manifest would look like:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.native_activity"
android:versionCode="1"
android:versionName="1.0">
<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="8" />
<!-- This .apk has no Java code itself, so set hasCode to false. -->
<application android: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. -->
<activity android:name="android.app.NativeActivity"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<!-- Tell NativeActivity the name of or .so -->
<meta-data android:name="android.app.lib_name"
android:value="native-activity" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
- 解决:Application package 'AndroidManifest.xml' must have a minimum of 2 segments.
- 解决:Application package 'AndroidManifest.xml' must have a minimum of 2 segments.
- 解决:Application package 'AndroidManifest.xml' must have a minimum of 2 segments.
- Application package 'AndroidManifest.xml' must have a minimum of 2 segments.
- Application package 'AndroidManifest.xml' must have a minimum of 2 segments错误
- Android Application package 'AndroidManifest.xml' must have a minimum of 2 segments.
- 已解决的问题——Application package 'AndroidManifest.xml' must have a minimum of 2 segments.
- Application windows are expected to have a root view controller at the end of application launch 的解决
- A Couple of Must-have PeopleCode Coding Standards
- The parent project must have a packaging type of POM
- The parent project must have a packaging type of POM
- The parent project must have a packaging type of POM
- ViewStub报错:must have a valid layoutResource解决
- AndroidManifest.xml里加入多个package
- You must perform a full uninstall of the application
- you must have a uni
- AndroidManifest.xml文件详解--application
- AndroidManifest.xml——application
- VBA中如何获取当前登录用户名
- Oracle Data guard 物理standby 测试
- SVG 例子
- Asterisk 1.8 meetme 改进
- 图像处理的基本算法
- 解决:Application package 'AndroidManifest.xml' must have a minimum of 2 segments.
- 对于"杯具"的解决
- OpenGL多边形顺逆时针问题
- VB2008:数据绑定
- 文本文件和二进制文件区别及java中字节流和字符流归纳
- linuxkernel map
- Fast I/O
- table边框
- VC++ 6.0切分窗口