Android Build Error

Hi
I am trying to create an apk.
I created a backup of an app A and then created a new app B from the backup of A.

When I try and compile the APK, I get this error.....
(Bear in mind App A compiles to APK just fine, so why does the exact same app bomb with this error???

Build error

Most likely build error cause:

(node:26647) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /app/platforms/android/gradlew: 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.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.
1 person has
this problem
+1
Reply
  • Hello Deon,

    1. Please check your Push Notification settings, did you set a new set of project ID, json config files and so on for the new app?

    2. Do you use Barcode Scanner in your app? If yes, please disable it and run the build again
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Hi Serhii

    Thank you. I did create a new firebase project and also created new database and with new push notification api.
    I only use app to receive push messages. I do not send messages, so there is no reference to push api key from the app. Project db ID is set to new db as well.

    I dont use barcode scanner in app.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Deon,

    Generally, to troubleshoot issues with pushes, first of all, you need to check if the settings for Push for Android in your project have been configured correctly and with all the steps as described in our documentation: https://docs.appery.io/docs/pushnotif...

    You should also know that for the correct functioning of the Push option, the Device and Notification Cordova plugins should be enabled in the App Settings of your project (I have no doubts you know it, though).

    As for the error that you get with your binary build, please increase the Target SDK version in your Android binary settings to 8.1 and try again.
    One more thing that can help resolve the issue:
    Removing the "SENDER_ID" property from your PushPlugin, generating new JSON config files for Firebase, and uploading them to Appery.io platform: https://docs.appery.io/docs/pushnotif....

    Please let us know the result.

    PS
    Such an error might also indicate that you have two plugins enabled in your app that are conflicting.
    To troubleshoot, uncheck all the plugins until the build successes then you add plugins one by one with the build checks to understand what plugins give you this error.
    You can find all the plugins you are using now in your App Settings interface.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Thank you for your reply.

    Quite a while ago I brought it to Appery's attention that the Push Services in the Server backend loses its settings for no reason. The uploaded certificates would simply vanish. This issue was acknowledged and fixed by Appery support.

    It seems this issue has returned. The Google Services JSON file as well as the Firebase AdminSDK file is disappearing by itself after adding it to Push Settings.

    I then created brand new Firebase files and uploaded, just for good measure. For now I am able to create the APK. I will let you know if the settings reset again.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Ok, It continually loses it settings. I pop the files in. I compile APK fine. Next compile settings are gone and I have to uploaded the Firebase files again. Please can you check why the settings keep getting lost.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Now its not retaining the settings at all. Why is there no confirmation that settings are saved. Maybe provide a button to click to save settings?
    To top it, I cant use my existing firebase files that I created. I have to create new ones everytime the settings are lost.

    This is de-ja-vu.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Could you please share your application with support@appery.io and provide us with it's name?

    JSON configs are not included in the app backup, because of security reasons. Please generate a new pair of them for each your application (even, created from the backup)
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • I'm getting this issue too.

    Background to the problem, I need to make manual small changes to config.xml during development. Once ready to build the release version, clicking the 'release' checkbox causes the push JSON files to be lost from the push settings.

    Deleting and regenerating config.xml does not resolve the problem. The only solution appears to be repeatedly closing and reopening the entire builder once config.xml and the push settings have been restored, though it appears this sometimes has to be done repeatedly.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Chris,

    Could you please share your application with support@appery.io and provide us with its name?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Hi Galyna,

    The app is shared with support and called 'Maes y Mynydd'.

    The problem occurs with all the apps generated using a plugin called 'School App'.

    If you can tell me the steps I need to do to ensure that the build it successful, it would be appreciated.

    Thanks for your help,

    Chris
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Chris,

    Can you confirm you have issues with Android builds only?
    Just to clarify - your builds (both Android and iOS) are successful but Android version lacks the push JSON files? Is this the issue you are concerned with?

    Important - please clarify as well if you created the app under question from the backup, if so - such behavior is to be expected as all the Push settings need to be recreated in this case.

    In this connection, I would like you to know that by making a backup of an app you can save all the created pages with their UI and services, enabled plugins, libraries versions, keys and binaries, themes, JavaScript, CSS, etc.; the structure of the application also remains unchanged.
    But if you need to create a backup of the database for further use, for example, you will need to save it separately by exporting its data to JSON or CSV (to do it, go to the Settings tab). The same applies to API Express projects, Push notification settings, etc.

    Also, could you please provide us with more information on the plugin School App you use in your app as well?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Hi Galyna,

    Yes. The issue is related to Android only and it only comes about when I click the 'release' version checkbox. Doing so causes the firebase JSON files to be dropped and builds to fail; however, restoring the firebase JSON files is not enough to fix the build failure. To fix, it is necessary to delete and restore config.xml and then close and reopen the builder, sometimes more than once.

    The apps are always created using a plugin called 'School App' (now shared with support: 777e762b-43a7-47a5-a8e0-aa5c6036a8db), not a backup of an existing app.

    The apps do not use any of Appery's BaaS options (push, database, etc.); they are dealt with at this end.

    Hope that's enough information.

    Thanks,

    Chris
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Hello again,

    Our developer has made detailed research into this issue and a lot of new questions arose to be answered so that we could research further.
    What exactly is happening to the .json files - are they deselected on the Pushes tab and then disappear from the list of the uploaded files?
    Please note that CORDOVA -> google-services.json in the Source tab should not be empty; if the .json files on the Pushes tab are successfully added to the app, in config.xml there should be a line with the package name. This should correspond with the package name registered with the Firebase service (and it does correspond in the app you shared but please, check it for the other app). The error reported by Deon (node:26647) occurs if this package name in config.xml is different.
    Then, there is no need to register a new app with Firebase every time - you only need one .json pair to use for different projects if you register the package name provided before uploading a new certificate in the new app editor.
    Also, please check your PushPllugin options - you have defined the sender_ID there, but this version does not require a sender_ID option.
    The last - in our case, the app you shared was successfully built with both debug and release modes. The .json files were deselected in the Push tab only after the app version had been created and the recreated from it. For your shared apps, there appear to be no versions but could you please specify this as well?
    And, yes, these files are not expected to be added to the backups - this is the expected behavior.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated

  • Hi Galyna,

    Sorry for the delay in replying. In answer to your questions:

    What exactly is happening to the .json files - are they deselected on the Pushes tab and then disappear from the list of the uploaded files?


    What typically happens is that, when the 'release' checkbox is ticked, the JSON files are deselected from the push settings page (https://appery.io/app/projects/61b5de...). What is more, restoring the JSON files does not necessarily fix the problem of APK builds failing. APK builds are only restored by deleting config.xml, undoing all source changes and then closing and reopening the builder (sometimes more than one).

    Thank you for the information about the content of CORDOVA -> google-services.json. I'll keep an eye on that in case of future problems.

    The last - in our case, the app you shared was successfully built with both debug and release modes. The .json files were deselected in the Push tab only after the app version had been created and the recreated from it. For your shared apps, there appear to be no versions but could you please specify this as well?


    I'm not sure what you mean when you say "there appear to be no versions" of the app and plugin I shared. I found that the .json files were deselected in the Push tab when the 'release' checkbox was selected. In future, if this happens I will check to ensure that the CORDOVA -> google-services.json file is not blank and if necessary delete and undo source changes to restore its content.

    Thanks for your help!

    Chris
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned sad, anxious, confused, frustrated