简体   繁体   English

无法解析android.net.SntpClient类

[英]Cannot resolve android.net.SntpClient class

I am trying to use the class SntpClient that should be in the android.net package, but Android Studio is telling me it cannot find it. 我正在尝试使用应该在android.net软件包中的SntpClient类,但是Android Studio告诉我找不到它。 Indeed when I look through the source jars (of both API 19 and API 21), the class is not there. 确实,当我浏览(API 19和API 21的)源jar时,该类不存在。 However according to grepcode it should be. 但是根据grepcode它应该是。

http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.4_r1/android/net/SntpClient.java http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4.4_r1/android/net/SntpClient.java

What am I doing wrong? 我究竟做错了什么?

Google has chosen not to make all public classes available as part of the SDK. Google选择不将所有公共类作为SDK的一部分提供。 Visibility is controlled by the @hide comment tag as described here . 能见度由@hide注释标记控制此处描述

I'm not sure why they chose to hide SntpClient particularly, but provided you respect the terms of the Apache license you can copy the source into your application without much modification. 我不确定他们为什么选择特别隐藏SntpClient,但是只要您尊重Apache许可的条款,就可以在不做太多修改的情况下将源代码复制到应用程序中。

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

相关问题 Android SDK缺少android.net.SntpClient - android.net.SntpClient is missing from Android SDK 无法在Android上解析MapActivity类 - Cannot resolve MapActivity class on Android DEBUG/SntpClient(70):请求时间失败:java.net.SocketException:Android 上的协议不支持地址系列 - DEBUG/SntpClient(70): request time failed: java.net.SocketException: Address family not supported by protocol on Android Android Studio 无法解析 MapView 类 - Android Studio Cannot Resolve MapView Class 安卓 @RunWith(AndroidJUnit4.class)-无法在包“ androidTest”中解析 - Android. @RunWith(AndroidJUnit4.class) - cannot resolve in package “androidTest” Android Espresso:无法解析符号AndroidJUnit4.class - Android Espresso : cannot resolve symbol AndroidJUnit4.class android R.java:无法解析类id中的符号 - android R.java: cannot resolve symbol in class id 如何解决“无法解析导入的android.net.rtp”? - How to resolve “The import android.net.rtp cannot be resolved”? 无法解析同一包中的类,使用eclipse异步进行android开发 - Cannot resolve class in same package, async android development using eclipse DEBUG / SntpClient(71):请求时间失败:java.net.SocketException - DEBUG/SntpClient(71): request time failed: java.net.SocketException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM