簡體   English   中英

離子不會建立

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM