解决Intellij Idea,Android(安卓)Stuido的“Ambiguous method call getClass()” bug
16lz
2022-03-30
Rather than modify your application code, you can avoid this bug by patching your Android SDK's source code.
When you come across the getClass() error, go to the declaration of the method (⌘B on Mac). This will navigate to $ANDROID_HOME/sources/android-DD/java/lang/Object.java. From within IntelliJ, make the following edit which removes the unbounded wildcard:
(If you do this from within IntelliJ, you may be prompted to remove the Read-Only flag from the Object.java file.)
reference:[url]http://stackoverflow.com/questions/18505973/android-studio-ambiguous-method-call-getclass[/url]
When you come across the getClass() error, go to the declaration of the method (⌘B on Mac). This will navigate to $ANDROID_HOME/sources/android-DD/java/lang/Object.java. From within IntelliJ, make the following edit which removes the unbounded wildcard:
// Removed unbounded wildcard (Class<?>) to avoid http://youtrack.jetbrains.com/issue/IDEA-72835
public final native Class getClass();
(If you do this from within IntelliJ, you may be prompted to remove the Read-Only flag from the Object.java file.)
reference:[url]http://stackoverflow.com/questions/18505973/android-studio-ambiguous-method-call-getclass[/url]
更多相关文章
- 代码中设置drawableleft
- android 3.0 隐藏 系统标题栏
- Android开发中activity切换动画的实现
- Android(安卓)学习 笔记_05. 文件下载
- Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
- 技术博客汇总
- android 2.3 wifi (一)
- AndRoid Notification的清空和修改
- Android中的Chronometer