[英]Ionic won't build
我对Ionic和android很陌生。
尝试构建我的Ionic android应用程序时,出现错误消息。
:compileDebugJavaC:\Temp\Projekt\test\platforms\android\src\org\apache\cordova\filetransfer\FileTransfer.java:692: error: cannot find symbol
if (!isLocalTransfer && !Config.isUrlWhiteListed(source)) {
^
symbol: method isUrlWhiteListed(String)
location: class Config
Note: Some input files use or override a deprecated API.
FAILED
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.974 secs
C:\Temp\Projekt\test\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c ""C:\Temp\Projekt\test\platforms\\android\gradlew" cdvBuildDebug -b "C:\Temp\Projekt\test\platforms\android\build.gradle" -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
有谁知道如何解决这个问题? 提前致谢!
您遇到error: cannot find symbol
在编译时error: cannot find symbol
。 关于这个问题,对该错误消息进行了广泛的讨论。
通常,这意味着您拼错了一些方法名称,或者根本不存在该名称。
在您的特定情况下,问题出在以下方法上: Config.isUrlWhiteListed()
。
检查它的拼写是否正确,大小写是否正确(例如Url或URL),以及您尝试调用的方法是否确实存在,因为如果您遵循的是某个教程,则该方法可能已在某些发行版中删除。
编辑:正如@kuzyn在评论中说的那样,您还必须检查计算机上是否正确安装了所有组件(离子,科尔多瓦等)。
您还可以尝试他提供的命令: ionic platform add android
。
仔细检查Ionic页面 ,看看您是否真的安装了所有东西。
我用相同的名称创建了一个新的Ionic应用程序,然后更改了在小部件ID中添加的数字以匹配旧应用程序中的数字。
如果在PC上执行此操作并想要创建IOS应用程序,则必须在发布之前将整个应用程序移至MAC并在其中使用cordova进行构建。 否则,该应用程序将具有旧窗口小部件ID的路径,并且您将无法使用(例如)在该应用程序中下载的文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.