UndCover/PyramidStore

按照tutorial.md修改后编译报错。

Closed this issue · 6 comments

参照教程在原版与https://github.com/q215613905/TVBoxOS版中修改后编译均报错。错误信息如下:
2022-08-27T14:14:46.3694376Z > Task :player:assembleRelease
2022-08-27T14:14:48.6703899Z /home/runner/work/TVBoxDIY/TVBoxDIY/TVBoxOS-J/app/src/main/java/com/github/tvbox/osc/base/App.java:47: error: cannot find symbol
2022-08-27T14:14:48.6704323Z
2022-08-27T14:14:48.6705067Z PythonLoader.getInstance().setApplication(this);
2022-08-27T14:14:48.6705696Z ^
2022-08-27T14:14:48.6885297Z symbol: variable PythonLoader
2022-08-27T14:14:48.6885782Z > Task :app:compileReleaseJavaWithJavac
2022-08-27T14:14:48.6891835Z location: class App
2022-08-27T14:14:49.3694888Z /home/runner/work/TVBoxDIY/TVBoxDIY/TVBoxOS-J/app/src/main/java/com/github/tvbox/osc/api/ApiConfig.java:229: error: cannot find symbol
2022-08-27T14:14:49.3703857Z PythonLoader.getInstance().setConfig(jsonStr);
2022-08-27T14:14:49.3704171Z ^
2022-08-27T14:14:49.3704380Z symbol: variable PythonLoader
2022-08-27T14:14:49.3704626Z location: class ApiConfig
2022-08-27T14:14:49.4693794Z /home/runner/work/TVBoxDIY/TVBoxDIY/TVBoxOS-J/app/src/main/java/com/github/tvbox/osc/api/ApiConfig.java:405: error: cannot find symbol
2022-08-27T14:14:49.4694869Z return PythonLoader.getInstance().getSpider(sourceBean.getKey(), sourceBean.getExt());
2022-08-27T14:14:49.4695406Z ^
2022-08-27T14:14:49.4695733Z
2022-08-27T14:14:49.4794131Z symbol: variable PythonLoader
2022-08-27T14:14:49.4794549Z > Task :app:compileReleaseJavaWithJavac FAILED
2022-08-27T14:14:49.4794875Z 47 actionable tasks: 44 executed, 3 from cache
2022-08-27T14:14:49.4795747Z location: class ApiConfig
2022-08-27T14:14:49.4796516Z /home/runner/work/TVBoxDIY/TVBoxDIY/TVBoxOS-J/app/src/main/java/com/github/tvbox/osc/api/ApiConfig.java:408: error: cannot find symbol
2022-08-27T14:14:49.4797167Z return new SpiderNull();
2022-08-27T14:14:49.4797397Z ^
2022-08-27T14:14:49.4797603Z symbol: class SpiderNull
2022-08-27T14:14:49.4797839Z location: class ApiConfig
2022-08-27T14:14:49.4798375Z /home/runner/work/TVBoxDIY/TVBoxDIY/TVBoxOS-J/app/src/main/java/com/github/tvbox/osc/api/ApiConfig.java:419: error: cannot find symbol
2022-08-27T14:14:49.4798803Z return PythonLoader.getInstance().proxyLocal("","",param);
2022-08-27T14:14:49.4799082Z ^
2022-08-27T14:14:49.4799307Z symbol: variable PythonLoader
2022-08-27T14:14:49.4799537Z location: class ApiConfig
2022-08-27T14:14:49.4800064Z /home/runner/work/TVBoxDIY/TVBoxDIY/TVBoxOS-J/app/src/main/java/com/github/tvbox/osc/api/ApiConfig.java:422: error: cannot find symbol
2022-08-27T14:14:49.4800550Z return PythonLoader.getInstance().proxyLocal(sourceBean.getKey(),sourceBean.getExt(),param);
2022-08-27T14:14:49.4800878Z ^
2022-08-27T14:14:49.4801086Z symbol: variable PythonLoader
2022-08-27T14:14:49.4801324Z location: class ApiConfig
2022-08-27T14:14:49.4801599Z Note: Some input files use or override a deprecated API.
2022-08-27T14:14:49.4802118Z Note: Recompile with -Xlint:deprecation for details.
2022-08-27T14:14:49.4802442Z Note: Some input files use unchecked or unsafe operations.
2022-08-27T14:14:49.4802823Z Note: Recompile with -Xlint:unchecked for details.
2022-08-27T14:14:49.4803051Z 6 errors
2022-08-27T14:14:49.4803181Z
2022-08-27T14:14:49.4803305Z FAILURE: Build failed with an exception.
2022-08-27T14:14:49.4803469Z
2022-08-27T14:14:49.4803554Z * What went wrong:
2022-08-27T14:14:49.4804070Z Execution failed for task ':app:compileReleaseJavaWithJavac'.
2022-08-27T14:14:49.4804418Z > Compilation failed; see the compiler error output for details.
2022-08-27T14:14:49.4804610Z
2022-08-27T14:14:49.4804685Z * Try:
2022-08-27T14:14:49.4805210Z Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
2022-08-27T14:14:49.4805502Z
2022-08-27T14:14:49.4805636Z * Get more help at https://help.gradle.org
2022-08-27T14:14:49.4805806Z
2022-08-27T14:14:49.4805895Z BUILD FAILED in 1m 13s
2022-08-27T14:14:50.0291651Z ##[error]Process completed with exit code 1.

你有没有import

能指导下import后面填什么吗?之前想到是没有import了,但是不知道import后面填什么,刚接触java和python。
是在App.java和ApiConfig.java中分别import PythonLoader?
那请问有关SpiderNull的错误怎么解决呢,ApiConfig.java中已经存在import com.github.catvod.crawler.Spider,可是编译过程中依然存在symbol: class SpiderNull的报错信息,是由于没有import PythonLoader导致return PythonLoader.getInstance().getSpider(sourceBean.getKey(), sourceBean.getExt());这样出错吗?

App.java 和 ApiConfig.java 都需要
import com.undcover.freedom.pyramid.PythonLoader;

已经百度、谷歌,发现是没有import问题,但是能力有限,实在不知道 import PythonLoader怎么填写。
厚颜向您请教,还请指导。

分别添加import com.undcover.freedom.pyramid.PythonLoader;后还是有1个报错, SpiderNull();相关。
2022-08-27T14:14:49.4797167Z return new SpiderNull();
2022-08-27T14:14:49.4797397Z ^
2022-08-27T14:14:49.4797603Z symbol: class SpiderNull
2022-08-27T14:14:49.4797839Z location: class ApiConfig

解决方法:
App.java中添加import com.undcover.freedom.pyramid.PythonLoader;
ApiConfig.java中添加import com.undcover.freedom.pyramid.PythonLoader;与import com.github.catvod.crawler.SpiderNull;