在Gradle构建过程中NativeScript获取错误(编码)(compileDebugJavaWithJavac)

时间:2018-08-30 23:09:25

标签: java android gradle nativescript-plugin nativescript-cli

在尝试使用第三方私有插件构建项目时遇到问题。

当我运行命令tns run android时,构建开始,它将准备所有插件,然后构建所需的aar包,执行预准备的钩子,然后启动gradle进程,ir穿过50%然后抛出许多错误提示生成的Java源上的非法字符指向导致问题的行和文件。这是一个编码问题,因为我使用notepad ++观察到,引起问题的文件已被ANSI编码,其余的Java源文件都已以UTF-8编码。

在将Java源代码发送到Java编译器之前,如何纠正其编码?

PS D:\WorkGit\keetup\ba-mascotas-mobile> tns run android
Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder.
Searching for devices...
Executing before-liveSync hook from D:\WorkGit\keetup\ba-mascotas-mobile\hooks\before-liveSync\nativescript-angular-sync.js
Executing before-watch hook from D:\WorkGit\keetup\ba-mascotas-mobile\hooks\before-watch\nativescript-dev-sass.js
Found peer node-sass
Executing before-watch hook from D:\WorkGit\keetup\ba-mascotas-mobile\hooks\before-watch\nativescript-dev-typescript.js
Found peer TypeScript 2.4.2
18:43:38 - Compilation complete. Watching for file changes.



Executing before-prepare hook from D:\WorkGit\keetup\ba-mascotas-mobile\hooks\before-prepare\nativescript-dev-sass.js
Executing before-prepare hook from D:\WorkGit\keetup\ba-mascotas-mobile\hooks\before-prepare\nativescript-dev-typescript.js
Hook skipped because either bundling or livesync is in progress.
Executing before-prepare hook from D:\WorkGit\keetup\ba-mascotas-mobile\hooks\before-prepare\nativescript-localize.js
Executing before-prepare hook from D:\WorkGit\keetup\ba-mascotas-mobile\hooks\before-prepare\nativescript-miba-login.js
Configure google Services Version
D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\nativescript-miba-login\lib
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\build.gradle
Preparing project...
Executing before-prepareJSApp hook from D:\WorkGit\keetup\ba-mascotas-mobile\hooks\before-prepareJSApp\nativescript-dev-webpack.js
Successfully prepared plugin nativescript-angular for android.
Successfully prepared plugin nativescript-bitmap-factory for android.
Successfully prepared plugin nativescript-calendar for android.
Successfully prepared plugin nativescript-camera for android.
Successfully prepared plugin nativescript-cardview for android.
Successfully prepared plugin nativescript-checkbox for android.
Successfully prepared plugin nativescript-geolocation for android.
Successfully prepared plugin nativescript-image-cache for android.
Successfully prepared plugin nativescript-imagepicker for android.
nativescript-iqkeyboardmanager is not supported for android.
Successfully prepared plugin nativescript-iqkeyboardmanager for android.
Successfully prepared plugin nativescript-localize for android.
Successfully prepared plugin nativescript-miba-login for android.
Successfully prepared plugin nativescript-permissions for android.
Successfully prepared plugin nativescript-phone for android.
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin nativescript-toast for android.
Successfully prepared plugin nativescript-ui-listview for android.
Successfully prepared plugin nativescript-ui-sidedrawer for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin nativescript-intl for android.
Successfully prepared plugin nativescript-ui-core for android.
Successfully prepared plugin tns-core-modules-widgets for android.
Built aar for nativescript-camera
Built aar for nativescript-geolocation
Built aar for nativescript-imagepicker
Built aar for nativescript-miba-login
Project successfully prepared (Android)
Executing after-prepare hook from D:\WorkGit\keetup\ba-mascotas-mobile\hooks\after-prepare\nativescript-dev-sass.js
Executing after-prepare hook from D:\WorkGit\keetup\ba-mascotas-mobile\hooks\after-prepare\nativescript-dev-webpack.js
Executing after-prepare hook from D:\WorkGit\keetup\ba-mascotas-mobile\hooks\after-prepare\nativescript-miba-login.js
Copying google Services Configuration
Copy D:\WorkGit\keetup\ba-mascotas-mobile\app\App_Resources\Android\google-services.json to D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\google-services.json.
Building project...
Gradle build...
         + setting applicationId
         + applying user-defined configuration from D:\WorkGit\keetup\ba-mascotas-mobile\app\App_Resources\Android\app.gradle
         Applying settings from D:\WorkGit\keetup\ba-mascotas-mobile\app\App_Resources\Android\settings.json
         + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
         + adding aar plugin dependency: D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\nativescript-calendar\platforms\android\nativescript_calendar.aar
         + adding aar plugin dependency: D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\nativescript-camera\platforms\android\nativescript_camera.aar
         + adding aar plugin dependency: D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\nativescript-geolocation\platforms\android\nativescript_geolocation.aar
         + adding aar plugin dependency: D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\nativescript-imagepicker\platforms\android\nativescript_imagepicker.aar
         + adding aar plugin dependency: D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\nativescript-miba-login\platforms\android\baidsdk.aar
         + adding aar plugin dependency: D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\nativescript-miba-login\platforms\android\callejerogcba.aar
         + adding aar plugin dependency: D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\nativescript-miba-login\platforms\android\nativescript_miba_login.aar
         + adding aar plugin dependency: D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\nativescript-phone\platforms\android\nativescript_phone.aar
         + adding aar plugin dependency: D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\nativescript-ui-listview\platforms\android\TNSListView-release.aar
         + adding aar plugin dependency: D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\nativescript-ui-sidedrawer\platforms\android\TNSSideDrawer-release.aar
         + adding aar plugin dependency: D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\nativescript-ui-core\platforms\android\TNSCore-release.aar
         + adding aar plugin dependency: D:\WorkGit\keetup\ba-mascotas-mobile\node_modules\tns-core-modules-widgets\platforms\android\widgets-release.aar
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:3731: error: illegal character: '\u00b1'
    public static final int recupera_contrase├▒a_padding_left=0x7f07011c;
                                              ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:3731: error: <identifier> expected
    public static final int recupera_contrase├▒a_padding_left=0x7f07011c;
                                                             ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4306: error: illegal character: '\u00b1'
    public static final int recupera_contrase├▒a_enviar_button_id=0x7f0900e2;
                                              ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4306: error: <identifier> expected
    public static final int recupera_contrase├▒a_enviar_button_id=0x7f0900e2;
                                                                 ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4307: error: illegal character: '\u00b1'
    public static final int recupera_contrase├▒a_error_message_id=0x7f0900e3;
                                              ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4307: error: <identifier> expected
    public static final int recupera_contrase├▒a_error_message_id=0x7f0900e3;
                                                                 ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4308: error: illegal character: '\u00b1'
    public static final int recupera_contrase├▒a_ingresa_email_id=0x7f0900e4;
                                              ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4308: error: <identifier> expected
    public static final int recupera_contrase├▒a_ingresa_email_id=0x7f0900e4;
                                                                 ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4566: error: illegal character: '\u2018'
    public static final int ACTIVITY_CREATE_ACCOUNT_CONTRASEÑA=0x7f0e0001;
                                                             ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4566: error: <identifier> expected
    public static final int ACTIVITY_CREATE_ACCOUNT_CONTRASEÑA=0x7f0e0001;
                                                               ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4569: error: illegal character: '\u2018'
    public static final int ACTIVITY_CREATE_ACCOUNT_RPETIR_CONTRASEÑA=0x7f0e0004;
                                                                    ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4569: error: <identifier> expected
    public static final int ACTIVITY_CREATE_ACCOUNT_RPETIR_CONTRASEÑA=0x7f0e0004;
                                                                      ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4627: error: illegal character: '\u2018'
    public static final int OLVIDASTE_CONTRASEÑA=0x7f0e003e;
                                               ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4627: error: <identifier> expected
    public static final int OLVIDASTE_CONTRASEÑA=0x7f0e003e;
                                                 ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4628: error: illegal character: '\u2018'
    public static final int OLVIDASTE_CONTRASEÑA_UNDERLINE=0x7f0e003f;
                                               ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4628: error: <identifier> expected
    public static final int OLVIDASTE_CONTRASEÑA_UNDERLINE=0x7f0e003f;
                                                           ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4634: error: illegal character: '\u2018'
    public static final int RECUPERA_TU_CONTRASEÑA=0x7f0e0045;
                                                 ^
D:\WorkGit\keetup\ba-mascotas-mobile\platforms\android\app\build\generated\source\r\debug\ar\gob\buenosaires\mascotas\R.java:4634: error: <identifier> expected
    public static final int RECUPERA_TU_CONTRASEÑA=0x7f0e0045;
                                                   ^
18 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> 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. Run with --scan to get full insights.s.

* Get more help at https://help.gradle.org

BUILD FAILED in 53s

0 个答案:

没有答案