Android和QUOT;时钟和QUOT;来源git的克隆,导入错误 [英] Android "Clock" Source git clone, import Error

查看:183
本文介绍了Android和QUOT;时钟和QUOT;来源git的克隆,导入错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这混帐闹钟的克隆Android源。
进口到我的日食发现以下错误:

Cloned android source of Alarm clock from git. imported to my eclipse found following errors:

Alarms.java: 
Line 463: Intent alarmChanged = new Intent(Intent.ACTION_ALARM_CHANGED);
Error: ACTION_ALARM_CHANGED cannot be resolved or is not a field.
---------------------------------------

AlarmKlaxon.java
Line 89: mVibrator = new Vibrator();
Error: Cannot instantiate the type Vibrator
-----------------------------------

DigitalClock.java
Line 184: CharSequence newTime = DateFormat.format(mFormat, mCalendar);
Error: Call requires API level 3 (current min is 1):android.text.format.DateFormat#format

Line 167: mContext.unregisterReceiver(mIntentReceiver);
Error: mContext cannot be resolved
-----------------------------------

SetAlarm.java
Line 115: FrameLayout content = (FrameLayout) getWindow().getDecorView()
            .findViewById(com.android.internal.R.id.content);
Error:com.android.internal.R cannot be resolved to a variable

-----------------------------------

这是不这个应用程序,我从git的Andr​​oid的树克隆任何aplication ...我收到的一些错误或其他。
我不知道我做错了。
我打靶果冻豆。
我还检查了使构建目标作为谷歌的API,但也没有用。

It is just not this application , any aplication that i clone from git android tree ... i am getting some error or the other. I dont know what i am doing wrong . I am targetting for jelly bean. and i also checked making build target as google API also but no use.

推荐答案

下面是你应该做的:


  • 重新开始,所以删除该项目并关闭Eclipse。

  • Start fresh, so delete that project and close Eclipse.

再次下载源

打开Eclipse,preSS 按Ctrl + N 。这将打开新的项目向导。

Open Eclipse, press Ctrl + N. This will open new project wizard.

选择的Andr​​oid 然后 Android项目从现有code

根目录来的DeskClock中源。考虑检查复制项目进入工作区。这样,当你编辑文件,你会不会编辑您下载的原始来源,但它在工作区的副本。

Point the Root Directory to the DeskClock source. Consider checking Copy projects into workspace. This way when you edit the files, you won't edit the original source you downloaded, but the copy of it in your workspace.

打开清单并设置的minSdkVersion

这很可能会是这样的:

<uses-sdk
    android:minSdkVersion="15"
    android:targetSdkVersion="17" />


  • 您将需要添加 Android的支持-V13 库。这可以在SDK找到。

    • You'll need to add the android-support-v13 library. This can be found in the SDK.
    • 该路径将是这样的:

      PATH_TO_YOUR_SDK\extras\android\support\v13
      

      一旦你有了这个,折腾了文件夹中的项目。如果它不存在,创建一个。

      Once you have this, toss it in the libs folder in your project. If it isn't there, create one.

      您已经做了一切之后,你应该如果仍然有任何错误清理项目。你也应该考虑突出自己的项目,pressing Alt + Enter键选择的Andr​​oid 和改变项目建设目标来最新的源代码。

      After you've done all that, you should clean your project if there are still any errors. You should also consider highlighting your project, pressing Alt+Enter selecting Android and changing the Project Build Target to the latest source.

      请确保你使用正确的链接,当您克隆回购:

      Make sure you're using the right link when you clone the repo:

      git clone https://android.googlesource.com/platform/packages/apps/DeskClock
      

      此外,还要确保你指着Eclipse来正确的Andr​​oid SDK中的目录。转到窗口 - > 的Andr​​oid 并确保 SDK位置指向正确的路径。

      Also, make sure you're pointing Eclipse to the right Android SDK directory. Go to Window --> Android and make sure the SDK Location is pointed to the correct path.

      这篇关于Android和QUOT;时钟和QUOT;来源git的克隆,导入错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆