[ALOY-1490] Alloy 1.8+ not copying symbolic links to the platform folder in the project root
|Affected Version/s||alloy 1.8.0|
Steps to ReproducePlace a symbolic link to a folder or file under app/platform/android/res/*
Actual ResultNo files or folders which are symbolic links under app/platform/ are copied across to the
Expected ResultAll files or folders whether they be symbolic links or not should be copied across to the
- Sharif AbuDarda 2016-04-07 Hello, Can you explain a little more? I am not clearly understanding your issue. What do you mean by symbolic link? Please provide some steps to follow and necessary code segment. We need to test it in our environment. Regards, Sharif.
- Peter Horner 2016-04-08 Hi Sharif, I currently have 31 clients who each have their own app. The functionality is the same for each App. The only difference between the Apps are the graphics like the launch icon and the splash screens, and also tiapp.xml and manifest. So what I do to avoid having 31 sets of the same source code, which would be updated 31 times whenever I make a change, is to use symbolic links or symlinks (shortcuts in Windows terms) to a Base App which contains all the source code and generic graphics. It means whenever I make a change to the Base App, all 31 Apps get the source code change straight away. All I have to do is republish them. Now that the platform folder has been placed into the app folder, and gets copied out to the project root directory on Android App compilation, only the files and directories that are NOT symlinks get copied across. This causes the compiler to fail as it can't find the files it requires to build the app. The error looks like this: [ERROR] : Failed to package application: [ERROR] : [ERROR] : /Users/Peter/Documents/Appcelerator_Studio_Workspace/App1/build/android/res/drawable-mdpi/ic_drawer.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited [ERROR] : /Users/Peter/Documents/Appcelerator_Studio_Workspace/App1/build/android/res/drawable-hdpi/ic_drawer.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited [ERROR] : /Users/Peter/Documents/Appcelerator_Studio_Workspace/App1/build/android/res/drawable-xhdpi/ic_drawer.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited [ERROR] : /Users/Peter/Documents/Appcelerator_Studio_Workspace/App1/build/android/AndroidManifest.xml:4: error: Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.Dark'). When I look at the newly created platform folder in the project root, I can see that all the files that are symlinks in app/platform/ are not there. For example, App 1 has a notification icon for when it receives Push Notifications and is located in app/platform/android/res/drawable-xxhdpi/notification.png. This file is actually a symlink from App1 to the Base App project. The Linux command I used to create the symlink looks like this: ln -sv ../../../../../../Base\ App/app/platform/android/res/drawable-xxhdpi/notification.png app/platform/android/res/drawable-xxhdpi/notification.png Try creating a symlink under app/platform/android/res/ to a file somewhere outside of the current project and then compile the project for Android and see if that symlink file gets copied across to the project root platform folder. Regards, Peter
- Peter Horner 2016-04-14 Hi Sharif, Just wanted to find out how you are going with this problem. Just to add a bit more information, I replaced all instances of the symlinks in the app/platform/android/res/ folder with the actual files taken from my Base App project and it compiled without error. So that shows that the symlinks are the problem. However, replacing the symlinks is not a long term solution as it means that eventually I could have 100 App projects and if I need to update any graphics that are common to all projects, I would have to do it 100 times. With symlinks, I only have to make the change once in the Base App project and all other projects are updated automatically. If you could look into this further for me, it would be greatly appreciated. Kind regards, Peter
- Sharif AbuDarda 2016-04-15
- Peter Horner 2016-04-15
I looked at that other ticket link you sent, but that was resolved back in 2014. This problem with the symlinks has only just started occurring since the latest update of Appcelerator Studio which moved the platform folder into the app folder (and then recreates the platform folder in the project root). I am not sure I should reopen that ticket when it doesn't really relate to the problem I am experiencing.
In general, Appcelerator Studio works fine with symlinks, just not when it's copying the contents from app/platform to the
/platform folder. Kind regards, Peter
- Sharif AbuDarda 2016-04-15 Hello, Can you attach a test case, sample code for us to test?
- Peter Horner 2016-04-15 If you look back at my comment from a week ago, you will see all the information you need. I can't provide any sample code as the problem is not a programming issue, but the way Appcelerator Studio is handling symbolic links when copying files across.
- Fokke Zandbergen 2016-04-17 [~cbarber] you might want to have a look as well since you did ALOY-1365. Could it be that the way Alloy now copies platform/i18n does not include symbolic links?
- Peter Horner 2016-04-17 I am using relative paths in my symbolic links. I wonder if that is causing the problems. I need to use relative paths as I work between different computers and the pathing is different on each one. So an absolute path would not work when pulling files from Git. Would it be possible just to resolve the symbolic link and actually copy the file that the symbolic link links to, instead of copying across the symbolic link itself?
- Peter Horner 2016-05-02 Any word on this problem so far?
- Fokke Zandbergen 2016-05-03
[~cbarber] any idea?
[~phorner72] not sure how relative paths in symbolic links would work once they've been copied from
- Peter Horner 2016-05-03 [~fokkezb] A relative path would no longer work if the symbolic link is copied up one directory higher. As I mentioned in a previous comment, it would be great if the symbolic link could be resolved and the actual file it points to would be copied into the /platform folder at the time of publishing the app. So the actual /platform file would not contain any symbolic links, just actual physical files that the symbolic links point to. Is this possible?
- Peter Horner 2016-05-25 Just wanted to bump this issue and see if there has been any progress on it.