简体   繁体   中英

Ionic won't build

I am fairly new to Ionic and android.

When trying to build my Ionic android app I get an error message.

: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

Does anyone have an idea how to fix this? Thanks in advance!

You're getting an error: cannot find symbol at compilation time. This error message was vastly discussed on this question .

Usually this means that you've misspelled some method name, or it doesn't exist at all.

In your specific case, the problem is on this method: Config.isUrlWhiteListed() .

Check if it's spelled correctly, if the cases are correct (eg Url or URL), and if the method you're trying to invoke does really exists, because if you're following a tutorial it might have been removed on some release.


EDIT: As @kuzyn said on the comments, you'll also have to check if you have everything correctly installed on your machine (ionic, cordova, etc).

You could also try the command he provided: ionic platform add android .

Double check Ionic page to see if you really installed everything.

I created a new Ionic app with the same name and then changed the numbers that was added in the widget id to match the numbers in the old app.

If you do this on a PC and want to create an IOS app you have to move the whole app to a MAC and build it with cordova there before publishing. Otherwiser the app will have the path of the old widget ID and you won't be able to work with (for example) files downloaded in the app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM