android开发遇到的问题

来源:互联网 发布:js弹出遮罩层 编辑:程序博客网 时间:2024/05/16 12:05

一、error opening trace file: No such file or directory (2)

问题原因:字面翻译是“没有这类文件或者是目录“,文件本身存在。其实系统是找不到文件或者是目录!写了很多class文件后,在AndroidMainfest.xml中声明,后来又修改或者加了新的class,然后把之前的class删掉了,但是AndroidMainfest.xml中的声明却没有修改或删除。 解决办法:把AndroidMainfest.xml中的声明修改或删除已改的配置就好了;

二、No Launcher activity found!

问题原因:找不到启动项 解决办法:AndroidManifest.xml主配置文件里面没有配置启动项(原因多种多样),在<application></application>添加

<activity android:name="com.example.t.MainActivity" android:label="@string/hello_activity_text_text">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
 </activity>

片段,其中.MainActivity就是你的项目的主Activity

三、This text field does not specify an inputType or a hint

问题原因:没有给EditText编辑设置inputtype属性(输入框的类型)

解决办法:在EditText标签里加上android:inputType="none"

<EditText
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
           
android:inputType="none"/>

四、Buttons in button bars should be borderless

问题原因两个 Buttons 放在一个布局里会被判断为按钮栏,需要添加样式取消它的边框

解决办法在 Buttons 上添加属性 style="?android:attr/buttonBarButtonStyle" 

<Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/btn1_name" 
           
style="?android:attr/buttonBarButtonStyle"/>

五、the project was not built due to "a resource exists with a different case'项目位置',",fix the problem,then try refreshing this project and building it since it may be inconsistent

问题原因資源存在不同的大小写

解决办法发现自己的项目中有两个包:Hygl...和HyGl.... 将HyGl这个包改了其他一个名字后,重新加载项目解决!

来源:http://blog.sina.com.cn/s/blog_6c1da70601011stf.html;

0 0