mjwheatley / cordova-plugin-android-fingerprint-auth

A cordova plugin for fingerprint authentication using the hardware fingerprint scanner on devices running Android 6+
Apache License 2.0
168 stars 131 forks source link

Error in Building app #26

Closed rushabh138 closed 7 years ago

rushabh138 commented 7 years ago

We are trying to build the app and publish on Google Play with fingerprint plugin. We also updated plugin with version 0.3.1. However, we are getting below error:

` error : Server build failed. Server output: Project "CargoTrak.tmp.proj" (default targets): android Build Tooling revision 2016.10.19.7r Build Tooling Hostname ab-linuxbpc-2 Warning: Error during processing of action! Attempting to revert... Warning: Failed to install 'cordova-plugin-android-fingerprint-auth':Error: Uh oh! "/tmp/builds/madNITBPlm677RfnFM/app/Plugins/android-fingerprint/res/android/values-ru" not found! at Object.module.exports.common.copyFile (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/plugman/platforms/common.js:38:40) at Object.module.exports.common.copyNewFile (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/plugman/platforms/common.js:69:16) at module.exports.source-file.install (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/plugman/platforms/android.js:78:20) at /home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/platforms/PlatformApiPoly.js:662:27 at Object.ActionStack.process (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-common/src/ActionStack.js:56:25) at PlatformApiPoly.addPlugin (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/platforms/PlatformApiPoly.js:262:20) at handleInstall (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/plugman/install.js:605:6) at /home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/cordova-lib/cordova-lib/src/plugman/install.js:394:24 at _fulfilled (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/q/q.js:787:54) at self.promiseDispatch.done (/home/builder/BpcTooling/Cordova3/pm-5.0-/node_modules/q/q.js:816:30) Warning: Uh oh! "/tmp/builds/madNITBPlm677RfnFM/app/Plugins/android-fingerprint/res/android/values-ru" not found! Warning: /home/builder/BpcTooling/Cordova3/node_modules/cordova-build-utils/bin/install-plugins-3.js:190 throw Error("exit code: " + code); ^

Error: exit code: 1 at Error (native) at ChildProcess. (/home/builder/BpcTooling/Cordova3/node_modules/cordova-build-utils/bin/install-plugins-3.js:190:14) at emitTwo (events.js:87:13) at ChildProcess.emit (events.js:172:7) at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) Error: Build failed during execution Error: 'Build failed with error code 1' Done building project "CargoTrak.tmp.proj" -- FAILED. . Done building project "CargoTrak.iceproj" -- FAILED.

Build FAILED. `

rushabh138 commented 7 years ago

Missing files. Added plugin again and work.

mjwheatley commented 7 years ago

If your build is not copying the language string files from the plugin to your project then you may need to manually add them to your project in the appropriate directory.

mjwheatley commented 7 years ago

Ok, glad you got it working.

rushabh138 commented 7 years ago

Sorry, now we are getting another error when we build our project. We are using latest version downloaded from github today.

`error : Server build failed. Server output: Project "CargoTrak.tmp.proj" (default targets): android Build Tooling revision 2016.10.19.7r Build Tooling Hostname ab-linuxbpc-2 Warning: Note: Some input files use or override a deprecated API. Warning: Note: Recompile with -Xlint:deprecation for details. Warning: Note: Some input files use or override a deprecated API. Warning: Note: Recompile with -Xlint:deprecation for details. Warning: Note: Some input files use or override a deprecated API. Warning: Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Warning: /tmp/builds/EL9JKFtkyhJu8CfrZ0/app/res/values/strings.xml:3: Error: "app_name" is not translated in "es" (Spanish), "fr" (French), "no" (Norwegian), "ru" (Russian), "zh" (Chinese), "zh-CN" (Chinese: China), "zh-HK" (Chinese: Hong Kong SAR China), "zh-MO" (Chinese: Macau SAR China), "zh-SG" (Chinese: Singapore), "zh-TW" (Chinese: Taiwan) [MissingTranslation] Warning: "CaminCargo Control"


    Warning: Explanation for issues of type "MissingTranslation":
   If an application has more than one locale, then all the strings declared
    Warning: in one language should also be translated in all other languages.
    Warning: If the string should not be translated, you can add the attribute
    Warning: translatable="false" on the <string> element, or you can define all your
   non-translatable strings in a resource file called donottranslate.xml. Or,
    Warning: you can ignore the issue with a tools:ignore="MissingTranslation"
    Warning: attribute.
    Warning: By default this detector allows regions of a language to just provide a
    Warning: subset of the strings and fall back to the standard language strings. You
    Warning: can require all regions to provide a full translation by setting the
    Warning: environment variable ANDROID_LINT_COMPLETE_REGIONS.
    Warning: You can tell lint (and other tools) which language is the default language
    Warning: in your res/values/ folder by specifying tools:locale="languageCode" for
    Warning: the root <resources> element in your resource file. (The tools prefix
   refers to the namespace declaration http://schemas.android.com/tools.)
    Warning: 1 errors, 0 warnings
    Warning: FAILURE:
    Warning: Build failed with an exception.
    Warning: \* What went wrong:
    Warning: Execution failed for task ':lintVitalArmv7Release'.

> Lint found fatal errors while assembling a release target.

  To proceed, either fix the issues identified by lint, or modify your build script as follows:
  ...
  android {
      lintOptions {
          checkReleaseBuilds false
    Warning: // Or, if you prefer, you can continue to check for errors in release builds,
    Warning: // but continue the build even when errors are found:
    Warning: abortOnError false
      }
  }
  ...
- Try:
  Run with --stacktrace
  Warning: option to get the stack trace. Run with --info or --debug option to get more log output.
  Warning: /tmp/builds/EL9JKFtkyhJu8CfrZ0/app/cordova/node_modules/q/q.js:126
                  throw e;
                  ^
  Error code 1 for command: /tmp/builds/EL9JKFtkyhJu8CfrZ0/app/gradlew with args: cdvBuildRelease,-b,/tmp/builds/EL9JKFtkyhJu8CfrZ0/app/build.gradle,-Dorg.gradle.daemon=true,-PcdvBuildArch=armv7,-PcdvBuildMultipleApks=true
  Error: Build failed during execution
  Error: 'Build failed with error code 1'
  Done building project "CargoTrak.tmp.proj" -- FAILED.
  .
  Done building project "CargoTrak.iceproj" -- FAILED.

Build FAILED.
`
mjwheatley commented 7 years ago

I'm sorry you are having difficulties building your application. However, these errors are not issues with the plugin, but with project settings. The warning messages provide solutions to remedy the problem. Please implement one of the suggested settings and you should be able to successfully build your application. The error is pointing to the "app_name" in the strings.xml, if you don't need it, you could delete it? You can add that key to all the language files. You can add the attribute translatable="false" on the element. I would try that last one as it seems the simplest solution.

rushabh138 commented 7 years ago

Dear,

We tried all of the possibility but still I’m getting same error.

Implementation:

  1. We added folders cordova-plugin-android-fingerprint-auth and then removed the folders values-es, values-fr, values-no, values-ru, values-zh, values-zh-rCN, values-zh-rMO, values-zh-rSG and values-zh-rTW
  2. We removed folder android-fingerprint completely
  3. We added below logic to all fpauth-strings.xml files xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation"
  4. Also, we added attributes translatable="false" We are still getting below errors,

[2016-11-02 14:48:01.712] Log (Info,Medium): Packing files Plugins\cordova-plugin-android-fingerprint-auth\res\android\values-es\fpauth-strings.xml, Plugins\cordova-plugin-android-fingerprint-auth\res\android\values\fpauth-strings.xml, bin\Release\Android\CargoTrak.apk, bin\Release\iOS\app.ipa with root C:\MobileApps\CargoTrak\CargoTrak. [2016-11-02 14:48:04.899] Log (Info,Medium): Checking user identity [2016-11-02 14:48:04.900] Log (Info,Medium): User logged in as kparker@camincargo.com [2016-11-02 14:48:33.991] Log (Info,Medium): Checking user identity [2016-11-02 14:48:33.992] Log (Info,Medium): User logged in as kparker@camincargo.com [2016-11-02 14:48:33.992] Log (Info,Medium): Requesting LiveSync token. [2016-11-02 14:48:34.024] Log (Info,Medium): Checking user identity [2016-11-02 14:48:34.024] Log (Info,Medium): User logged in as kparker@camincargo.com [2016-11-02 14:48:34.025] Log (Info,High): Sending build request for project CargoTrak with parameters ProjectTypeGuids={070BCB52-5A75-4F8C-A973-144AF0EAFCC9} Platform=Android AndroidCodesigningIdentity=Ken Parker ProjectConfiguration=Release AcceptResults=Url;LocalPath BuildConfiguration=Release Framework=Cordova FrameworkVersion=4.0.0 LiveSyncToken=RShJA+DdqYWmHGpO/m0auCupYRC6uyzkqKPARz7gRdEBGHrpizJAP5DKsh7Js9IKA+qWBYGp2npSCINDiGeyiRRNfyCQ2Q9BZEE6NYpz6YBoIEYDmlq74ocjVI1gSEoQ. [2016-11-02 14:48:49.573] Log (Exception,High): Server build failed. Server output: Project "CargoTrak.tmp.proj" (default targets): android Build Tooling revision 2016.10.19.7r Build Tooling Hostname ab-linuxbpc-2 Warning: Note: Some input files use or override a deprecated API. Warning: Note: Recompile with -Xlint:deprecation for details. Warning: Note: Some input files use or override a deprecated API. Warning: Note: Recompile with -Xlint:deprecation for details. Warning: FAILURE: Warning: Build failed with an exception. Warning: * What went wrong: Warning: Execution failed for task ':mergeArmv7ReleaseResources'. Warning: > Warning: [string/app_name] /tmp/builds/DmPQwZhm0ShFFvVLgy/app/res/values/fpauth-strings.xml [string/app_name] /tmp/builds/DmPQwZhm0ShFFvVLgy/app/res/values/strings.xml: Error: Duplicate resources Warning: * Try: Warning: Run with Warning: --stacktrace option to get the stack trace. Run with --info or Warning: --debug option to get more log output. Warning: /tmp/builds/DmPQwZhm0ShFFvVLgy/app/cordova/node_modules/q/q.js:126 throw e; ^ Error code 1 for command: /tmp/builds/DmPQwZhm0ShFFvVLgy/app/gradlew with args: cdvBuildRelease,-b,/tmp/builds/DmPQwZhm0ShFFvVLgy/app/build.gradle,-Dorg.gradle.daemon=true,-PcdvBuildArch=armv7,-PcdvBuildMultipleApks=true Error: [string/app_name] /tmp/builds/DmPQwZhm0ShFFvVLgy/app/res/values/fpauth-strings.xml [string/app_name] /tmp/builds/DmPQwZhm0ShFFvVLgy/app/res/values/strings.xml: Error: Duplicate resources Error: Build failed during execution Error: 'Build failed with error code 1' Done building project "CargoTrak.tmp.proj" -- FAILED. . [2016-11-02 14:48:49.804] Log (Exception,High): System.Exception: Build for Android completed with errors. See build log for more information.

mjwheatley commented 7 years ago

Closing because this is not an issue with the plugin. This plugin adds resource files to support multiple languages. You must accommodate for this fact and make adjustments to your project accordingly. The issue seems to be with the string for "app_name" in the strings.xml file. This string resource does not belong to the plugin. You need to add xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation" to the strings.xml file not the fpauth-strings.xml files.

rushabh138 commented 7 years ago

I have added a signature.gradle file to the plugin and referenced it in the plugin.xml file and it did fixed the issue. Thanks.

mjwheatley commented 7 years ago

If it is something you think should be added to the plugin, send me a pull request to review.