onatcipli / rename

The Rename CLI Tool is a utility designed to modify your Flutter project's AppName and BundleId across various platforms, such as iOS, Android, Macos, Linux, Windows and Web
https://pub.dev/packages/rename
MIT License
164 stars 39 forks source link

Breaks AndroidManifest.xml #43

Closed c0bra closed 3 months ago

c0bra commented 1 year ago

Running rename with --appname AppName flag removed this line:

<application android:label="AppName" android:name="${applicationName}" android:icon="@mipmap/ic_launcher">

and added this line:

android:label="AppName"

which is invalid XML and breaks the build;

Clavum commented 1 year ago

On a similar note, mine was:

<application
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher"
        android:label="example">

And was changed to:

<application
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher"
        android:label="new_name"

Which is missing the ending bracket >

pph7 commented 1 year ago

Worked for me. If the AndroidManifest.xml is formatted like this

    <application
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher"
        android:label="app_name"
        android:requestLegacyExternalStorage="true"
        android:usesCleartextTraffic="true">

It should work. So the android:label part needs to be on a separate line.

c0bra commented 1 year ago

So the android:label part needs to be on a separate line.

I would figure this tool would be able to handle newlines in its matching logic.

AGliddon commented 1 year ago

Any indication of if or when this might get addressed?

This is a severe issue for us, due to other command line utilities formatting the XML after editing such that it's not possible to guarantee the attribute for android:label is separate from everything else on its own line.

I'm now having to look for an alternative Flutter package that provides the same features as this one, but without this issue.

onatcipli commented 11 months ago

Hi guys, I understand the case we need to change the logic for android renaming with regular expression this week I will be working on that and fix this issue thank you for put this out

I will keep you updated

onatcipli commented 3 months ago

it should be solved with the latest stable versions 3.0.1 or 3.0.2, please feel free to open again if the error appears in the latest stable version