Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11408

Android build fails when cordova-plugin-file is installed

    XMLWordPrintableJSON

Details

    Description

      Repro steps:

      cordova create android-file-repro
      cd android-file-repro
      cordova platform add android@https://github.com/apache/cordova-android
      cordova plugin add https://github.com/apache/cordova-plugin-file
      cordova build
      

      Build output:

      Warning: using prerelease version 6.2.1-dev (cordova-lib@6.2.1-dev)
      ANDROID_HOME=C:\Android\android-sdk
      JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_55
      Observed package id 'system-images;android-23;google_apis;x86' in inconsistent location 'C:\Android\android-sdk\system-images\addon-google_apis-google-23\x86' (Expected 'C:\Android\android-sdk\system-images\android-23\google_apis\x86')
      Incremental java compilation is an incubating feature.
      :preBuild UP-TO-DATE
      :preDebugBuild UP-TO-DATE
      :checkDebugManifest
      :CordovaLib:preBuild UP-TO-DATE
      :CordovaLib:preDebugBuild UP-TO-DATE
      :CordovaLib:compileDebugNdk UP-TO-DATE
      :CordovaLib:compileLint
      :CordovaLib:copyDebugLint UP-TO-DATE
      :CordovaLib:mergeDebugProguardFiles
      :CordovaLib:packageDebugRenderscript UP-TO-DATE
      :CordovaLib:checkDebugManifest
      :CordovaLib:prepareDebugDependencies
      :CordovaLib:compileDebugRenderscript
      :CordovaLib:generateDebugResValues
      :CordovaLib:generateDebugResources
      :CordovaLib:packageDebugResources
      :CordovaLib:compileDebugAidl
      :CordovaLib:generateDebugBuildConfig
      :CordovaLib:mergeDebugShaders
      :CordovaLib:compileDebugShaders
      :CordovaLib:generateDebugAssets
      :CordovaLib:mergeDebugAssets
      :CordovaLib:processDebugManifest
      :CordovaLib:processDebugResources
      :CordovaLib:generateDebugSources
      :CordovaLib:incrementalDebugJavaCompilationSafeguard
      :CordovaLib:compileDebugJavaWithJavac
      :CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
      Note: Some input files use or override a deprecated API.
      Note: Recompile with -Xlint:deprecation for details.
      :CordovaLib:processDebugJavaRes UP-TO-DATE
      :CordovaLib:transformResourcesWithMergeJavaResForDebug
      :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
      :CordovaLib:mergeDebugJniLibFolders
      :CordovaLib:transformNative_libsWithMergeJniLibsForDebug
      :CordovaLib:transformNative_libsWithSyncJniLibsForDebug
      :CordovaLib:bundleDebug
      :prepareAndroidCordovaLibUnspecifiedDebugLibrary
      :prepareDebugDependencies
      :compileDebugAidl
      :compileDebugRenderscript
      :generateDebugBuildConfig
      :mergeDebugShaders
      :compileDebugShaders
      :generateDebugAssets
      :mergeDebugAssets
      :generateDebugResValues
      :generateDebugResources
      :mergeDebugResources
      :processDebugManifest
      :processDebugResources
      :generateDebugSources
      :incrementalDebugJavaCompilationSafeguard
      :compileDebugJavaWithJavac
      :compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
      C:\Cordova\androtest\android-file-repro\platforms\android\src\org\apache\cordova\file\LocalFilesystem.java:387: error: cannot find symbol
                  rawData = data.getBytes(Charset.defaultCharset());
                                          ^
        symbol:   variable Charset
        location: class LocalFilesystem
      Note: C:\Cordova\androtest\android-file-repro\platforms\android\src\org\apache\cordova\file\DirectoryManager.java uses or overrides a deprecated API.
      Note: Recompile with -Xlint:deprecation for details.
      Note: C:\Cordova\androtest\android-file-repro\platforms\android\src\org\apache\cordova\file\AssetFilesystem.java uses unchecked or unsafe operations.
      Note: Recompile with -Xlint:unchecked for details.
      1 error
      :compileDebugJavaWithJavac FAILED
      
      FAILURE: Build failed with an exception.
      
      * What went wrong:
      Execution failed for task ':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.
      
      BUILD FAILED
      
      Total time: 14.221 secs
      Error: cmd: Command failed with exit code 1 Error output:
      Note: Some input files use or override a deprecated API.
      Note: Recompile with -Xlint:deprecation for details.
      C:\Cordova\androtest\android-file-repro\platforms\android\src\org\apache\cordova\file\LocalFilesystem.java:387: error: cannot find symbol
                  rawData = data.getBytes(Charset.defaultCharset());
                                          ^
        symbol:   variable Charset
        location: class LocalFilesystem
      Note: C:\Cordova\androtest\android-file-repro\platforms\android\src\org\apache\cordova\file\DirectoryManager.java uses or overrides a deprecated API.
      Note: Recompile with -Xlint:deprecation for details.
      Note: C:\Cordova\androtest\android-file-repro\platforms\android\src\org\apache\cordova\file\AssetFilesystem.java uses 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 ':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.
      Picked up _JAVA_OPTIONS: -Xmx512M
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            alsorokin Alexander Sorokin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: