Skip to content

Use the serialized variable when writing on the properties file - #212

Merged
robingenz merged 1 commit into
ionic-team:mainfrom
marioshtika:main
Aug 15, 2026
Merged

Use the serialized variable when writing on the properties file#212
robingenz merged 1 commit into
ionic-team:mainfrom
marioshtika:main

Conversation

@marioshtika

Copy link
Copy Markdown
Contributor

Hello the issue is described in here

I am using the below code to write on the grade.properties file on Android, but it is not working

platforms:
  android:
    properties:
      - file: gradle.properties
        entries: 
          android.enableJetifier: true

I followed the logic and it looks like it is working but it is not writing it back to the file

I was getting the below error message

Fatal error: Error running command
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received [Object: null prototype]

And as @Ali-H888 mentioned, if you check here you will find that it is passing data to the write file argument instead of the serialized string and that's what is causing the error.

We both tested the fix and it's working on our local machine.

I have created a pull request for this.

@marioshtika

Copy link
Copy Markdown
Contributor Author

Hello.

Any update on this one?

@Gonzalo-Bruna

Copy link
Copy Markdown

Sad that this project seems to not be maintained anymore...

@robingenz

Copy link
Copy Markdown
Collaborator

Confirmed — writeProperties passes the parsed object instead of the serialized string, so every commit of a properties operation throws ERR_INVALID_ARG_TYPE. Your one-line fix is correct. Sorry it sat for so long; we will get it merged along with a regression test, since the existing test never reaches the commit path. Note that writing goes through ini.stringify, so comments in gradle.properties are not preserved.

@robingenz
robingenz merged commit 710324f into ionic-team:main Aug 15, 2026
@github-actions github-actions Bot mentioned this pull request Aug 15, 2026
robingenz added a commit that referenced this pull request Aug 15, 2026
Regression test for #198 / #212: the existing test never called commit(),
so the broken writeProperties path was never exercised.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@marioshtika

Copy link
Copy Markdown
Contributor Author

Hey @robingenz thank you for merging this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants