我在使用 eclipse 和运行我的应用程序时遇到了一些困难。首先,当我尝试运行在设置菜单中选择了默认活动的代码时,它会打开 alltravelsview 而不是登录视图。如果我选择要启动的特定视图,则视图中的登录是唯一出现的视图。然后它会正确启动。
其次,如果我尝试在我的手机上安装该应用程序,它似乎安装正确,但是当我单击按钮(启动器)时,我收到消息应用程序未安装。我使用了 eclipse/adt 的导出功能,它是用私钥签名的。
这是一个代码片段,我排除了一些活动,这些活动只是为了缩短它的声明。这段代码来自 manifest.xml 我想是错误的地方。在我的活动中,我夸大了相应的观点。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.kit.teco.easyTravel.view"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/CustomTheme"
android:permission="android.permission.INJECT_EVENTS"
>
<activity
android:name="de.kit.teco.easyTravel.view.LoginView"
android:label="@string/app_name" >
<!-- Four lines for login -->
<!-- Start Login -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<!-- End Login -->
</activity>
<activity
android:name="de.kit.teco.easyTravel.view.MainMenuView"
android:label="@string/title_activity_main_menu_view" >
</activity>
<activity
android:name="de.kit.teco.easyTravel.view.AllTravelsView"
android:label="@string/title_activity_all_travels_view" >
</activity>
<--- a few more activities ---->
</application>
</manifest>
编辑:
proguard-project.txt:
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
项目属性:
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-17
两者看起来都很空,没有对它们做任何事情,所以它只是自动生成的文件。对于我正在使用的第三方库:db40 sidemenu restlet 和另外三个与 restlet 一起使用