android - Why do I get "Unresolved reference" for a class that the project does allow to reach?
问题描述
Background
I've made a tiny library that I've published on Github, which allows you to have auto-switching of texts every X ms :
https://github.com/AndroidDeveloperLB/AutomatedTextSwitcher
The project has a library and a sample modules. The sample uses the library, and the library has a single class (currently), called "AutomatedTextSwitcher".
The problem
For some reason, the project doesn't seem to be able to be built, as the IDE shows these errors:
C:\Users\User\Desktop\AutomatedTextSwitcher\app\src\main\java\com\example\user\automated_text_switcher\MainActivity.kt: (5, 47): Unresolved reference: AutomatedTextSwitcher C:\Users\User\Desktop\AutomatedTextSwitcher\app\src\main\java\com\example\user\automated_text_switcher\MainActivity.kt: (21, 35): Unresolved reference: setTextsToShow
What I've tried
The errors appear here even though when I use CTRL+mouse-left-click, the IDE reaches to the correct place in code.
The class exists, and the function of setTextsToShow
also exists and is public.
Copying the code to an existing project seem to have it work fine.
Since I suspect this is a bug on the IDE, I've also reported about this here.
The question
How come I have this issue? Why does it occur? How can I fix it?
解决方案
推荐阅读
- php - 为什么 authorize() 不能像在开发环境中那样在生产环境中工作?
- numpy - 如何用 numpy 制作一个简单的 Vandermonde 矩阵?
- c - 问题:奖学金捐赠基金第 2 部分 (fund2.c)
- javascript - 如何保存和加载没有画布元素的艺术作品?
- go - 如何使用 go.mod 强制指定特定的包版本?
- ruby - 大小读写文件和条件语句
- php - 允许特定用户访问 php/mysql 中的特定管理页面
- python - Django:如何将用户传递给models.py
- r - 如何在 lappy 中合并向量和数据框的 colSums
- mysql - 在单个 SQL 查询中获取关注者数量和“我是否关注”