Giter VIP home page Giter VIP logo

react-native-rename's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-rename's Issues

Cannot read property 'code' of undefined

react-native-rename "Master"
/home/user-pc/.nvm/versions/node/v5.0.0/lib/node_modules/react-native-rename/lib/index.js:169
} else if (err.code === 'ENOENT') {
^

TypeError: Cannot read property 'code' of undefined
at /home/user-pc/.nvm/versions/node/v5.0.0/lib/node_modules/react-native-rename/lib/index.js:169:16
at tryToString (fs.js:414:3)
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:401:12)

i am getting this error help me

Doesn't work on linux

The problem lies in the first line of index.js:

#!/usr/bin/env node --harmony

If you run this on linux you will get this error:

/usr/bin/env: ‘node --harmony’: No such file or directory

On linux (in both bash and zsh at least) you can't pass arguments and use /usr/bin/env. When using /usr/bin/env on linux, with arguments, it attempts to run 'node --harmony' as one program rather than node as the program with the --harmony argument.

This isn't a PR as I don't really have a solution for you as there isn't much of a work around this. I do question what do you need the --harmony argument for?

If it's not truly needed and you can work around it somehow then this would work fine on linux.

How to revert the name change?

Hi,

After rename my app, the home screen has changed to the default React Native home screen despite my code within index.android.js doesn't change.

What should I do to ensure that my home screen is not being replaced by the default React Native home screen? Thanks!

didn't rename anything in ios dir

after rename: react-native-rename NewName -b com.new.name

[Project]/ios/[OldName]
[Project]/ios/[OldName]-tvOS
[Project]/ios/[OldName]-tvOSTests
[Project]/ios/[OldName].xcodeproj
[Project]/ios/[OldName]Tests

^ still exist

Missing out on some files

mv: no such file or directory: ~/AwesomeProject/ios/AwesomeProject.xcworkspace
Ignore above error if this file doesn't exist
mv: no such file or directory: ~AwesomeProject/ios/wenjunyixi/AwesomeProject.entitlements
Ignore above error if this file doesn't exist

Podfile

Hey June! Super-nice tool. Saves a lot of work when duplicating my repo to bootstrap RN projects.
I'll buy you a beer when you're in Belgium.

On topic:
It seems the target-name doesn't get updated in "ios/Podfile". Might be important to rename the target there as well.

Thanks!

Regular Expression Denial of Service

After I installed your package, i get this error-message (yarn):

nsp check
(+) 1 vulnerabilities found
┌───────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ │ Regular Expression Denial of Service │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Name │ minimatch │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ CVSS │ 7.5 (High) │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Installed │ 0.2.14 │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Vulnerable │ <=3.0.1 │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Patched │ >=3.0.2 │
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ Path │ [email protected] > [email protected] > [email protected] > [email protected]
├───────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ More Info │ https://nodesecurity.io/advisories/118
└───────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

app name contains `app`

if your app name is app or something similar this package screws everything up
and i have to manually go and fix incorrect replacments

valid identifier name (alphanumeric and space)

I want to change my app name to lets-chat. When I run

react-native-rename "lets-chat"

I got the following error:

"lets-chat" is not a valid name for a project. Please use a valid identifier name (alphanumeric and space).

How should I deal with the dash?

cant run on windows

i got these errors:
$ react-native-rename "RN1 App"
Directory should be created using "react-native init"

Custom Bundle Identifier delete main java files

Version used:

    "react": "16.0.0",
    "react-native": "0.51.0"
    "react-native-version": "2.2.2",

What happened:

  • In folder android/app/src/main/java/my/custom/bundleIdentifier there were 2 files MainActivity.java and MainApplication.java
  • Run react-native-version newName -b my.custom.bundleIdentifier

Observation:
After react-native-rename finished, the two above file are deleted. So when I create an apk from the app and install to device, app always crashes when I try to open. No error message, no bug report (I use Bugsnag to track bugs and crash exceptions)

Does not rename Pods

The folders and files under ios/Pods do not get renamed with the new app name.

Doesn't work when "android" keyword in present in package id

I tried to rename my android react native project with following command:

react-native-rename MyApp com.myapp.android

It doesn't see to work and the package di shows com.myapp only. When I tried the following:

react-native-rename "Travel App" -b com.junedomingo.travelapp

I could see the correct package name com.junedomingo.travelapp. I beliveve there is an issue when you use the keyword "android" in the package name. Please confirm if you are able to replicate.

Choose different display name than package name

Currently, the display name is the same as package name (minus spaces). I'd like to have Czech characters in display name (šžřč) but they are not valid in package name, so I'd like to have opportunity to manually select display name.

Rename with <Space> EX: APP<SPACE>NAME

Hello,
I'm get the issue, if i run react-native-rename "Nelayan Aruna"
and re-build, thats not work. the apps display with name "NelayanAruna"

how can i put the beetwen my apps ? thanks

Not working

react-native-rename NewName
The app_name value in ./android/app/src/main/res/values/strings.xml must be the same with ./ios/AppFolderName before renaming the app.
ex. ./ios/CoolApp  --->  <string name="app_name">CoolApp</string>

I am getting this error but this name is the same before I run the command.

Error in renaming folder

I get this error when trying to run react-native-rename: https://d.pr/i/GhC7qW/5YzaNTTp

When it completes, the files it does overwrite, the contents end up being like this (more than just this file): https://d.pr/i/Hsb4Hg/46gtj37O

I'm on React Native 0.43.1 and react-native-rename 2.1.7. As some background, the project had started on RN 0.20-something so has been through a lot of changes as RN evolved.

Any ideas?

Removes java files under old package name

I have a RN projects created with create-rn-app package but modified.
I ran your tool and realized it removes the files under
/android/app/src/java/old/package/name/MainActivity.java
/android/app/src/java/old/package/name/MainApplication.java

and creates a folder
/android/app/src/java/new/package/name/

I'm on windows, node 8.3, npm 5.3.0
Let me know if I can provide further details.

Entry, ":CFBundleIdentifier", Does Not Exist

im getting this with react native 0.56

An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=164):
Unable to lookup in current state: Shutting Down
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/ReactNativeKit.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

any idea?

Seems to prefix the mv operation?

I dunno why in my project this seems to not rename the ios/* directories properly and errs out with many lines of:

fatal: source directory is empty, source=tv/ios/MyProjectName, destination=tv/ios/NewProjectName
Ignore above error if this file doesn't exist

Doesn't change ios/* names

Hello,
react-native-rename dosn't change name of files in 'ios' dir, This is a sample:

D:\Project\MyProject>react-native-rename "TheName"
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
\android\app\src\main\res\values\strings.xml MODIFIED
\index.js MODIFIED
\package.json MODIFIED
\app.json MODIFIED
\android\settings.gradle MODIFIED
\app.json MODIFIED
The system cannot find the path specified.
The system cannot find the path specified.
\android\app\BUCK MODIFIED
\android\app\build.gradle MODIFIED
\android\app\src\main\AndroidManifest.xml MODIFIED
Done removing previous bundle directory.
Done removing builds.
APP SUCCESSFULLY RENAMED TO "TheName"! 🎉 🎉 🎉
Please make sure to run "watchman watch-del-all" and "npm start --reset-cache" before running the app.

System Info:
--- Windows 10 Enterprise
--- React Version : 16.2.0
--- React Native Version : 0.52.2

Build doesn't work after rename

I really liked this package and just ran it.

However, after I've renamed my app, and I run cd android && ./gradlew assembleReleaseto do another build, I get an error:

2 errors
:app:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJavac'.
> 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

Any idea how to resolve this?

Error on windows

On windows, it partially fails with this message: "Error: Command failed: rm -rf ./ios/build && rm -rf ./android/.gradle && rm -rf ./android/app/build && rm -rf ./android/build"

This is because rm does not exists on windows (unlike linux or osx (unix)). it is replaced by rmdir (or rd). So you shoud use "rd /s /q" instead of "rm -rf" when run on windows.
And also invert the path slashes (on windows it would be rm -rf .\android.gradle for example)

One other thing, when chaining commands like this (with &&), if one fails, all commands after that would not be executed. So if /ios/build does not exists for example, android/.gradle, /android/app/build and /android/build would not be deleted. So you should execute these commands in seperate command calls so that one failing do not impact all the others...

Except from that, good package, saved me some time compared to doing it by hand ;)

Some files are being deleted

  • org
    • brunolemos
      • app
        • modules [DELETED]
          • MyCustomModule [DELETED]
            • CustomModule.java [DELETED]
            • CustomPackage.java [DELETED]
        • MainActivity.java (package name renamed correctly)
        • MainApplication.java (package name renamed correctly)

macOS
Latest version of everything

Java Packages are deleted

After successfully renaming my app and decided to build it, the app crashed unexpectedly on my emulator without any error output. So i dug through and discovered that both MainActivity.java and MainApplication.java have been deleted. Please is there any fix for this??? There haven't been any fix or whatsoever so far.

Please make the bundle name change optional

Some command like this: -nb for "no bundle" name changing would be quite nice to have, then I could change just the name of the app and .ipa/.apk etc.

Practical example: react-native-rename "NewName" -nb

Previous Directory Not Deleted

Somehow previous directory in ..\android\app\src\main\java\com is not updated to the new project name.
So, I have to rename the directory to the new project name.
Also, I have to update package keyword in MainActivity.java and MainApplicatioin.java to the new project name.
After that "react-native run-android" command will get success.

Other Languages dosen't work

hey @junedomingo
thanks for your great work,
unfortunately when i tried to change App Name to Arabic Chars
i got
is not a valid name for a project. Please use a valid identifier name (alphanumeric and space)
thanks in advance

iOS build failed after rename

ld: library not found for -lAutoGrowTextInput
clang: error: linker command failed with exit code 1 (use -v to see invocation)



** BUILD FAILED **


The following build commands failed:

	Ld build/Build/Products/Debug-iphonesimulator/palmy_mobile.app/palmy_mobile normal x86_64
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/palmy_mobile.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/palmy_mobile.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Package/Bundle name

Is it possible to create or rename package in android style:
com.companyname.appname

command not found

see after installation i could not change name,it shows the error react-native-rename command not found

git mv breaks functionality (for ejected projects)

Hi, the changes to use git mv instead mv, while having good motivation, cause the rename operation to fail when not using version control, of course. This means that generated folders (of the type that many react native users will be using after running react-native eject, for example - we do this in our project at every major RN upgrade) cannot be renamed. Perhaps a flag to use mv instead of git mv would be the best solution?

Missing out on some files

Namely:

./ios/Podfile
./ios/AppName/AppName.entitlements (might need to change the setting that points to the entitlement file as well)
./ios/AppName-tvOS
./ios/AppName-tvOSTests
./ios/AppName.xcworkspace (cocoapods apps are built from Workspace instead of Project)
./AppName.app.dSYM.zip
./AppName.ipa

Android package name case sensitiveness.

Hi, thanks for the great package, being using it a lot.

But I got into a pesky problem. On Android, some of my app package names already on play store have upper case letters. rn-rename (on line 81 and in other parts) set the bundleid toLowerCase(). Google doesn't allow the package name to change.

Is there a way I'm missing to keep the case sensitiveness on renaming the Android project?
If not, I'm considering developing this feature in rn-rename myself. In that case, what would be the right way to do it?

Thanks in advance.

Not working for me

I am getting this error message:

The app_name value in ./android/app/src/main/res/values/strings.xml must be the same with ./ios/AppFolderName before renaming the app.
ex. ./ios/CoolApp ---> CoolApp
and try running the command again with you new app name.

But the name is exactly the name already.

After renaming project ios build error

** BUILD FAILED **

The following build commands failed:
CompileC /Users/ranvir/wslab/Myapp/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTRootContentView.o Base/RCTRootContentView.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/ranvir/wslab/Myapp/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTStatusBarManager.o Modules/RCTStatusBarManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

Installing build/Build/Products/Debug-iphonesimulator/Myapp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/Myapp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

It's rename only android project name.

Please help me out.


./android/app/src/main/res/values/strings.xml MODIFIED
./index.android.js MODIFIED
./package.json MODIFIED
./app.json MODIFIED
./index.ios.js MODIFIED
./android/app/src/main/java/com/example BUNDLE INDENTIFIER CHANGED
./android/app/src/main/java/com/example BUNDLE INDENTIFIER CHANGED
./android/settings.gradle MODIFIED
./android/app/BUCK MODIFIED
./android/app/src/main/java/com/example/MainActivity.java MODIFIED
./android/app/src/main/java/com/example/MainApplication.java MODIFIED
./android/app/src/main/java/com/example/MainActivity.java MODIFIED
./android/app/build.gradle MODIFIED
./android/app/src/main/java/com/example/MainApplication.java MODIFIED
./android/app/src/main/AndroidManifest.xml MODIFIED
./app.json MODIFIED

Android & iOS Build Errors

Versions:
[email protected]
[email protected]
[email protected]

Issue: Apps whichg are freshly created (via react-native init) and are then modified with react-native-rename do not build properly on android or iOS.

Expected Behavior: No errors should be produced after renaming a freshly init'd app.

Steps to Reproduce:

  • yarn global add react-native-rename
  • react-native init test
  • cd ./test
  • react-native run-android OR react-native run-ios //just to ensure everything is working
  • git init && git add -A && git commit -m "Initial commit"
  • git checkout -b renameTest
  • react-native-rename renameTest //output shown below:
./ios/renameTest RENAMED
./ios/renameTest-tvOS RENAMED
./ios/renameTest-tvOSrenameTests RENAMED
./ios/renameTest.xcodeproj RENAMED
./ios/renameTestrenameTests RENAMED
./android/app/src/main/res/values/strings.xml MODIFIED
./ios/renameTest/Base.lproj/LaunchScreen.xib MODIFIED
./package.json MODIFIED
./ios/renameTest/Info.plist MODIFIED
./app.json MODIFIED
./ios/renameTest.xcodeproj/project.pbxproj MODIFIED
./android/app/src/main/java/com/renametest BUNDLE INDENTIFIER CHANGED
./android/app/src/main/java/com/renametest BUNDLE INDENTIFIER CHANGED
./ios/renameTest/AppDelegate.m MODIFIED
./android/settings.gradle MODIFIED
./android/app/BUCK MODIFIED
./ios/renameTest.xcodeproj/project.pbxproj MODIFIED
./ios/renameTest.xcodeproj/project.pbxproj MODIFIED
./android/app/src/main/java/com/renametest/MainActivity.java MODIFIED
./android/app/src/main/java/com/renametest/MainApplication.java MODIFIED
./android/app/src/main/java/com/renametest/MainActivity.java MODIFIED
./android/app/build.gradle MODIFIED
./android/app/src/main/java/com/renametest/MainApplication.java MODIFIED
./android/app/src/main/AndroidManifest.xml MODIFIED
./app.json MODIFIED
  • react-native run-android OR react-native run-ios

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.