Worklight 6.1 - "All Build" fails and gives java.lang.NullPointerException - ibm-mobilefirst

Worklight 6.1 Studio.
Created Android and iPhone Platform. While do "All Build" it fails and gives java.lang.NullPointerException.
Log:
[2014-03-13 21:08:27] Starting build process: application 'MobileApp', all environments<br>
[2014-03-13 21:08:33] Application build failed: java.lang.NullPointerException

Try the following:
Delete the native folder
Close Eclipse
Locate your temp folder (Windows, OS X)
Delete the wlBuildResources folder
Open Eclipse
Re-build
If you have native code in your native\ folder, you can do the following for Android (and similarly for iOS):
copy android\native\res\xml\config.xml to android\nativeResources\res\xml folder (if the folder doesn't exist, create it)
copy android\native\src\com\your-app-name\*.java files to android\nativeResources\src\com\your-app-name folder (if the folder doesn't exist, create it)
copy android\native\AndroidManifest.xml to android\nativeResources folder
This way you do not need to fear removing the native folder; upon build time the files will be copied to their location in the native folder.

Related

I get "no lwjgl in java.library.path" when debugging my client [duplicate]

Note this is different from this question because it does not deal with linking because it's not asking how to link it via the CLI, but the GUI in Eclipse.
I have been trying to write a simple program using LWJGL. When I add the library to Eclipse (Kepler 4.3.1 on Windows 7 64bit) and write a program, it does not show red squigglies under the the things which use LWJGL. However, trying to run it gives me the following stacktrace:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.lwjgl.Sys$1.run(Sys.java:73)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:95)
at org.lwjgl.Sys.<clinit>(Sys.java:112)
at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
at DisplayExample.start(DisplayExample.java:8)
at DisplayExample.main(DisplayExample.java:23)
(Yes, that is the example they give first, but I wanted to run it to make sure everything was installled properly)
My question is, how do I fix this error? Note that, even when running in Eclipse, it still fails. If I run something else which does not use LWJGL it works, too. I just downloaded it from the internet - it only had one version, so I assume it was the correct one. From what I can see, none of the other question askers have the same error as me - but if you could point me to informative questions that would be helpful too.
You don't have the natives set up in your LWJGL application.
Here's how to do it:
Go to your LWJGL folder that contains the folders named "jar", "res", "doc", and "native". You need to go into Eclipse (assuming you use eclipse), open your project in the Project Explorer on the left side of your screen.
Right click on the "JRE System Library" of your project, and click "Build Path" -> "Configure Build Path".
Include the LWJGL native libraries to your project in the Build Path Configurer by clicking the "Native library location" which can be seen in the JRE System Library dropdown menu.
Click on "Edit...", which will be the only button clickable in that general area.
A file explorer will pop up. Navigate to the location of your LWJGL native folder (The location should be something like "C:\Users\YOURUSERNAMEHERE\Desktop\Java\eclipse\lwjgl-2.9.0\native" if you are using Windows) and include the folder named [Your OS here].
Hope this helped :)
I was following the tutorial here, and it looks like I didn't do the Adding the natives step, or I did it incorrectly.
Follow the instructions in that link and the problem should be resolved:
This is done by clicking the little arrow next to the lwjgl.jar file to show the drop down list. Double click 'Native library location' and select the folder that contains the native files for your operating system and clicking OK. These are located in the natives folder include in the LWJGL download bundle (e.g. On Windows you'd point to the natives\windows folder which contains the *.dll files, On Mac you'd point to the natives/macosx folder and on Linux you'd point to the natives/linux folder).
If you try tu run this code:
public static void main(String... args){
System.out.println(System.getProperty("java.library.path"));
}
you should get output like this:
/Users/yourName/.sdkman/candidates/java/8.0.252.j9-adpt/jre/lib/compressedrefs:/Users/yourName/.sdkman/candidates/java/8.0.252.j9-adpt/jre/lib:/usr/lib
So, you just need to download LWJGL libraries and copy files located at "...native/yourOSname" to one of this folders
That works to me fine!
I solved the issue by adding the lwjgl.64.dll file to the jdk-14.0.1 bin folder

Moving React Native project to new folder

i need to move RN project to new folder, but when i do that. I get this error when i run the project using react-native run-ios. When running the project from original folder, there are no errors.
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening TestProject.xcworkspace
The following commands produced analyzer issues:
Analyze /Users/home/Desktop/APLIKACE/TestProject/node_modules/react-native/ReactCommon/jsi/jsi.cpp normal x86_64
Analyze /Users/home/Desktop/APLIKACE/TestProject/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp normal x86_64
(2 commands with analyzer issues)
The following build commands failed:
CompileC /Users/home/Desktop/APLIKACE/TestProject/ios/build/TestProject/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTUIUtils.o /Users/home/Desktop/APLIKACE/TestProject/node_modules/react-native/React/UIUtils/RCTUIUtils.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
So i figured out a solution, which is working for what i need to do ( move project to new empty folder where i initialized github repo ).
So it seems there are some issues with relative paths and names. So what i did was rename my old project like this
.../ParentFolder/MyProject to .../ParentFolder/MyProject2
i created new folder in ParentFolder with exactly same name as the original folder ie .../ParentFolder/MyProject. This was now empty folder i initialized as Git repo.
Then i copied contents of MyProject2 to MyProject folder. Everything is working now fine.
Hope that helps someone in the future.

iOS giving cookie.mom error when building MFP project

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:
Inside WoklightSDK, I don't see the cookies.mom
How to fix this error?
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.

where is gradle storing the android buildapk?

I use the command gradle clean build
it ends with BUILD SUCCESSFUL, but where can I find the build .apk?
Or how can I set up the build directory destination?
Look in //build/apk. You'll need to do this outside of Android Studio since AS filters the directories and hides "apk".
Update: Android Studio no longer filters the output directory, so you can just drill into the build directory (under the app).

How can I build a Xamarin iOS app using MSBuild?

I have an iOS App project, builds fine in Visual Studio (paired with my Mac build host). I want to build this project using an MSBuild command, so that I can use Teamcity for my builds. (My build agent is a Windows machine which will pair with a Mac build host).
Currently I run the following command:
msbuild MyApp.App.iOS.csproj /t:_RemoteBuild /p:ServerAddress=macmini2.local;Configuration="Debug";Platform="iPhoneSimulator";OutputPath="C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug"
And this builds my 2 library projects, but it seems to fail when building my main project:
_GenerateBundleContentDir:
Preparing application bundle
Copying file from "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyApp.Business.Core.dll" to "C:\Projects\MySolution\MyApp.App.iOS\obj\iPhoneSimulator\Debug\build_package\assemblies\MyApp.Business.Core.dll".
Copying file from "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyApp.Business.Core.pdb" to "C:\Projects\MySolution\MyApp.App.iOS\obj\iPhoneSimulator\Debug\build_package\assemblies\MyApp.Business.Core.pdb".
Copying file from "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyApp.Business.Core.dll.mdb" to "C:\Projects\MySolution\MyApp.App.iOS\obj\iPhoneSimulator\Debug\build_package\assemblies\MyApp.Business.Core.dll.mdb".
Copying file from "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyApp.Business.iOS.dll" to "C:\Projects\MySolution\MyApp.App.iOS\obj\iPhoneSimulator\Debug\build_package\assemblies\MyApp.Business.iOS.dll".
Copying file from "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyApp.Business.iOS.pdb" to "C:\Projects\MySolution\MyApp.App.iOS\obj\iPhoneSimulator\Debug\build_package\assemblies\MyApp.Business.iOS.pdb".
Copying file from "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyApp.Business.iOS.dll.mdb" to "C:\Projects\MySolution\MyApp.App.iOS\obj\iPhoneSimulator\Debug\build_package\assemblies\MyApp.Business.iOS.dll.mdb".
C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MonoTouch.Common.targets(195,3): error MSB3030: Could not copy the file "C:\Projects\MySolution\MyApp.App.iOS\bin\iPhoneSimulator\Debug\MyAppAppiOS.exe" because it was not found. [C:\Projects\MySolution\MyApp.App.iOS\MyApp.App.iOS.csproj]
At the moment it is not possible to build Xamarin.iOS projects using msbuild (it is being worked on and in the future (not sure when) this will change).
However it seems it's possible to delegate the work to the Mac: http://forums.xamarin.com/discussion/comment/44484/#Comment_44484