简体   繁体   English

导入com.android.datetimepicker无法解析

[英]The import com.android.datetimepicker cannot be resolved

I've imported an existing Android project to Eclipse, but I'm getting errors on the following imports: 我已经将现有的Android项目导入Eclipse,但是在以下导入中出现错误:

import com.android.datetimepicker.time.RadialPickerLayout;
import com.android.datetimepicker.time.TimePickerDialog;

I already have the android-support-v4.jar library added to the build path. 我已经将android-support-v4.jar库添加到了构建路径。 Could anybody help me to figure out what is missing? 有人可以帮我弄清楚缺少什么吗?

Neither of those classes exist in the Android SDK. 这些类都不存在于Android SDK中。 There is a TimePickerDialog , as others have noted, in a different package . 正如其他人所指出的,在另一个包中有一个TimePickerDialog There is a RadialPickerLayout in the Android source code , and you are welcome to try to use it. Android源代码中有一个RadialPickerLayout ,欢迎您尝试使用它。

Really, you should be talking to whoever wrote this Android project and asking them where they were planning on getting those classes from. 确实,您应该与编写此Android项目的任何人交谈,并询问他们计划从中获取这些类的地方。

If you have added the datetimepicker library where you have the package com.android.datetimepicker palced, please add the following to main project's build.gradle dependencies section: 如果您在其中放置了com.android.datetimepicker包的地方添加了datetimepicker库,请在主项目的build.gradle依赖项部分中添加以下内容:

compile project(':library')

This worked for me. 这对我有用。 Please let me know your comments. 请让我知道您的评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM