android-template icon indicating copy to clipboard operation
android-template copied to clipboard

Error from newproject.sh

Open joekeen opened this issue 5 years ago • 6 comments

Hi,

I downloaded the zip and tried to use the script to create a new project but I get an error:

$ ./newproject.sh -p com.example.project -t Project
./newproject.sh: 71: [[: not found
newproject.sh: Invalid Package Name: com.example.project (needs to follow standard pattern {com.example.package})

I'm using Kubuntu 20.04, where:

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Jul 19  2019 /bin/sh -> dash

If i try to run the script with bash i get the following error:

$ bash newproject.sh -p com.example.project -t Project
Files structure has been renamed. Replacing package and package name within files...
sed: can't read s/io.bloco.template/com.example.project/g: No such file or directory

joekeen avatar Jan 06 '21 22:01 joekeen

can you double check the the script permissions?

Filmaluco avatar Jan 08 '21 15:01 Filmaluco

Script is executable:

-rwxr-xr-x
$ file newproject.sh 
newproject.sh: POSIX shell script, ASCII text executable

joekeen avatar Jan 09 '21 09:01 joekeen

I've got the same issue, my script is executable as well. Is there something unique with downloading the zip vs. cloning?

neuhoffm avatar Jun 27 '21 02:06 neuhoffm

@neuhoffm are you also using a Linux distro or Windows?

Filmaluco avatar Jun 28 '21 15:06 Filmaluco

@Filmaluco I'm on windows but using the Ubuntu subsystem shell. I actually made it past this error by adding: #!/bin/bash to the beginning of the file. With that in place the script executes until I get:

android-template-master$ ./newproject.sh -p com.psdemo.carvedrockmember -t CarvedRockMember
Files structure has been renamed. Replacing package and package name within files...
/mnt/c/Development/android-template-master/CarvedRockMember
sed: can't read s/io.bloco.template/com.psdemo.carvedrockmember/g: No such file or directory

It does seem to create the files and folder properly but renaming the packages inside of them is failing.

neuhoffm avatar Jul 04 '21 15:07 neuhoffm

Update: I created a new script you can find it in the PR linked above, atm should be functional for this version... however, we are currently updating the Template to better standards and the script will also be updated to said version. So if u use it for this version check the commit c1b8ead

Filmaluco avatar Sep 22 '22 17:09 Filmaluco