0

We have a worklight project version 6.2.0.1 and I have migrated it to MFP 7.

During my build (Ant or eclipse) I'm getting this error for iOS:

ANT:

 builtin-copyPlist --convert binary1 --outdir /Users/Sam/Desktop/ProjectName/temp/source/ProjectName/apps/ProjectName/iphone/native/CordovaLib/build/ProjectName.app -- WorklightSDK/resources/Cookies.mom
 [exec] 

/Users/Sam/Desktop/ProjectName/temp/source/ProjectName/apps/ProjectName/iphone/native/WorklightSDK/resources/Cookies.mom:0: 
error: reading data: The file “Cookies.mom” couldn’t be opened because there is no such file.

If I built the project through eclipse and ran it to xCode i get:

enter image description here Inside WoklightSDK, I don't see the cookies.mom

enter image description here How to fix this error?

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
Sami
  • 572
  • 8
  • 22
  • Are you storing your project in some source control system? could it be that you are not uploading everything and so when you downloaded the files into Studio 7 they were incomplete? Try deleting the native folder first before upgrading. – Idan Adar Apr 11 '15 at 04:45
  • Yes my project is stored to our main svn, which we have been always using and there is no native folders in our svn, we use "NativeResources" folder instead since our hybrid project contains some native codes. Is there some values I need to insert or configure in the xCode project inside the"NativeResources"folder to migrate the iOS? – Sami Apr 11 '15 at 13:59
  • Are you also storing there the xcodproj file? If you're storing this file then it may cause problems when migrating. Try two things: 1) remove the nativeResources folder and then try to migrate and then re-add the files and re-build in xcode 2) Try to migrate with *native* folder after it was generated in 6.2. – Idan Adar Apr 11 '15 at 14:01
  • Yes of course there is the xcodeproj stored, it contains our native code. I tried "1" and it didn't work, got the same error. I tried "2" and got this error on eclipse "Migrating the ProjectName project from version 6.2.0.01.20141106-2034 to version 7.0.0.00.20150402-2001 has failed because java.io.IOException: Unable to delete file: /Users/Sam/Documents/workspace/ProjectName/apps/ProjectName/ipad/native/CordovaLib/Classes/UIDevice+Extensions.m" – Sami Apr 11 '15 at 14:36
  • The only other thing I can think of is to delete the iPhone folder > import > add iPhone folder > add native code again. – Idan Adar Apr 11 '15 at 14:39
  • Idan, in WL 6.2 when I build the project, I see in iPhone>native>WoklightSDK>resources > cookies.mom. However, when I do the build for same project on MFP 7, I navigate to the iPhone>native>WokrlightSDK, but I don't see the "resources" folder inside. It is not being generated which contains the missing files that blocking my project from being built. any idea why? – Sami Apr 13 '15 at 14:11
  • At this time I do not know, I don't have time to look into it. Feel free to open a PMR. – Idan Adar Apr 13 '15 at 14:13

1 Answers1

2

The mentioned files in the screen shots no longer exist in a MFP project (so it is OK that they are not there in a fresh project) The migration process was supposed to remove them and so the build should not have errored on them.

But you're getting an error, this means to me that the project was not migrated to MFP 7.


Edit: per the test project in the PMR you've opened, this is happening because in your project you use using the nativeResources folder. Use of this folder is no longer considered a best practice you should stop using it.

The error here is that After the migration process, that part of it removes the old cookies.mom files, the builder takes the contents of the nativeResources folder and copies it to the native folder. In this process it replaces the updated .xcodeproj (now with removed references to the cookies.mom files that no longer exist), with your old .xcodeproj file that does contain these references - to files that do not exist... thus when building in Xcode, it fails because it has references to files that do not exist.

Delete the .xcodeproj file from your nativeResources folder and re-building. Next, in Xcode, re-references your custom class files. After the build succeeds in Xcode and your app is working, copy back the updated .xcodeproj file to the nativeResource folder, if you choose to continue using it.

By continuing to use this folder, you void your support - as I mentioned, this folder is no longer considered a best practices and may disappear in the future.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • even MFP6.3 removed those files? – Sami Apr 13 '15 at 17:20
  • Eclipse console when I check out the code from SVN "Migrating the ProjectName project from version 6.2.0.01.20150214-1613 to version 6.3.0.00.20150214-1702 has succeeded." (right click on iPhone > run as > build iPhone environment. again run as > xCode project > clean the project and build it got the same error) – Sami Apr 13 '15 at 17:25
  • Might be a migration bug then... pmr. – Idan Adar Apr 13 '15 at 17:27
  • Idan, sorry, just last question, is there a fix pack for MFP 6.3, I would like to download the latest fix available for this version before raising PMR. I used this URL to get the MFP 6.3 (http://stackoverflow.com/questions/17493510/ibm-worklight-where-to-find-previous-releases). If there is a fix packs and you can share with me the way of getting it, it might solve the issue hopefully and avoid the PMR. – Sami Apr 13 '15 at 19:14
  • If you are an IBM customer or business partner you can download the latest available iFix from IBM fIX Central. – Idan Adar Apr 13 '15 at 19:17
  • yes we are, would you please share the landing page for the IBM fix Central for MFP 6.3 and we can login with our credentials to download it? Thanks in advance. – Sami Apr 13 '15 at 19:19
  • Please google for "ibm fix central". There is no landing page, you'll need to search in the website for "mobilefirst platform 6.3". – Idan Adar Apr 13 '15 at 19:21
  • Idan, would you please take a look at this PMR 54816,047,649? and provide your input. Thank you – Sami Apr 29 '15 at 17:49
  • I have sent a response back 3 min ago. If MFP is not able to migrate my older .xcodeproj by modifying it to remove the WorklightSDK, is that mean I need to rewrite my native code again? – Sami Apr 29 '15 at 17:52
  • Where in my response in the PMR did you at all see me asking you to re-write your native code?! I did not ever write this. The copying of the nativeResources folder happens AFTER THE MIGRATION, which is why you see the OLD .xcodeproj file. Remove the .xcodeproj file from the the nativeResources folder - ONLY this file. Then import the project to 6.3 to have it migrated. Then run it in Xcode again and re-reference your files. This should work. If it works, you can now put back the UPDATED .xcodeproj file back into nativeResources folder. – Idan Adar Apr 29 '15 at 17:54
  • This is not a bug. It happens because of the way you are working per my description. As I wrote several times, using nativeResources is no longer considered best practices. DO NOT USE IT. – Idan Adar Apr 29 '15 at 17:54
  • You can also directly edited in a text editor the .xcodeproj file to remove references to cookies.mom files - I do not guarantee this will be enough. There is no bug here. None. Do not use the nativeResources folder. – Idan Adar Apr 29 '15 at 17:56
  • I will do what you have asked now and test it. But for your second comment, where should I keep my native code then if you are recommending to not use the nativeResource folder? – Sami Apr 29 '15 at 17:56
  • Inside the native folder obviously – Idan Adar Apr 29 '15 at 17:59
  • Thank you Idan, I was able successfully to build the iOS project on MFP 6.3 and 7 after removing the OLD xcodeproj and replaced it with the new one. I also did the file reference to complete the build. Will close the PMR. – Sami Apr 29 '15 at 21:06
  • I have a slightly less urgent read of the situation. While the migration process didn't remove the Cookies.mom from pbxproj, it did add all of the new Framework references to the pbxproj file, so it does seem that the migration actually took place. It just seems like if this nativeResource/Resource subdirectory existed in the app, it doesn't remove this Cookies.mom resource from the pbxproj. I had 9 apps that got migrated, and only 3 of them had this issue so it was an interesting testcase. – scott dickerson Feb 11 '16 at 19:05