Exception: Duplicate files copied in APK com/worklight - ibm-mobilefirst

When try to build project after I include Worklight Library I received bellow error
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK com/worklight/wlclient/messages_it.properties
File1: C:\Users\user1\AndroidStudioProjects\DIMP_APP\DIMP_APP\app\libs\worklight-android.jar
File2: C:\Users\user1\AndroidStudioProjects\DIMP_APP\DIMP_APP\app\build\intermediates\exploded-aar\com.ibm.mobile.foundation\ibmmobilefirstplatformfoundation\7.1.0.0\jars\classes.jar

As you did not supply the steps you've followed to add the library to your project, I suggest to verify that you have followed the latest official steps to do so, from here: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/hello-world/configuring-a-native-android-application-with-the-mfp-sdk/
Essentially:
Create a new native project in MobileFirst Studio in order to have the latest SDK generated
Copy the worklight-android.jar, uicandroid.jar, bcprov.jar, and android-async-http.jar files from the generated NativeAPI folder to the new native Android application, in the /libs directory.
[Android Studio only] Right-click any of the added .jar files and select Add as library to add all libraries.
[Android Studio only] Create an assets folder under src\main
Copy the wlclient.properties file from the previously created MobileFirst native API folder to the new native Android application, in the /assets directory.
Add the following permissions to the AndroidManifest.xml file
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.GET_TASKS" />
Add the MobileFirst UI activity:
<activity android:name="com.worklight.wlclient.ui.UIActivity" />

Related

LibCef Files not included with .net core publish

I have a Microsoft.AspNetCore.App (2.1) project using
<PackageReference Include="Chromely.CefGlue.Winapi" Version="66.0.0" />
<PackageReference Include="Chromely.Core" Version="0.9.1" />
During build chromelycef downloads required binaries to the output folder - this is working fine.
(userdir)\.nuget\packages\chromely.cefglue.winapi\66.0.0\build\\chromelycef.exe download v66 --cef-binary-version=3.3359.1772.gd1df190 --cpu=x64 --dest=(outpath)\netcoreapp2.1\
The files are downloaded from the build controller with the build command. However I have set up a VSTS build and the publish command would not download or include the libcef files.
Is there a way to include files with the publish command other than creating a zip file from the build output?
*edit
For the moment I ended up adding a step to add files from the build output to the zip archive.
You can update the project file to include the files you'd like to publish base on this documentation.
However, if you wish to specify, for example, some files to get
published with your app, you can still use the known mechanisms in
csproj for that (for example, the element).
You can refer to Martin's answer in this question for details.

Unable to locate libMailCore2-ios.a framework file when building MailCore2

I forked the Mailcore2 repo here: https://github.com/MailCore/mailcore2/
and tried to build the libMailcore2-ios.a framework myself.
Clone the repo
Open up the mailcore2.xcodeproj file in build-mac
Select the mailcore ios target and try building with cmd+b
The build succeeds
However, I'm unable to find where this project file exports the libMailcore2-ios.a file. I see the linked products in the project, but they are all red.
Any help?

Worklight 6.1 Android ant build not using shell template configChanges

I was having a problem that all android apps build with 6.1 and ant were closing on rotate.
When i notices that the AndroidManifest.xml was not including the changeConfig screenSize.
When i look at my AndroidManifest.xml.wltemplate.wluser i see clearly
android:configChanges="orientation|keyboardHidden|screenSize"
Yet after ant build doing an ant build i see this in the AndroidManifest.xml
android:configChanges="orientation|keyboardHidden"
Other configurations(packageName, minApiVersion) made in the wluser template are being used.
My build command looks like::
<app-builder applicationFolder="${appPath}/${appName}" environments="android"
nativeProjectPrefix="${appName}" outputFolder="./bin"
skinBuildExtensions="build-dojo.xml" worklightserverhost="${wlServerAddress}"/>
Is there something im missing, this worked in 505.
Worklight Ant Task version 6.1.0.00.20131126-0630
Try this instead of making changes in AndroidManifest.xml.wltemplate.wluser
Add your changes to AndroidManifest.xml which exists in nativeEmptyApp folder if you are using inner application.
or
If you dont have inner application add your changes in AndroidManifest.xml which exists in nativeResources in Android project.
Hoping this helps.
Cheers !!

buildtime.sh “Permission denied” when building in Xcode - Native Project generated by WL Ant Task

Please refer the below post.
IBM Worklight - "Permission denied" when building in Xcode
I am using the Worklight 6.1. I build the environment with Ant Task. Ant task creates my Native folder for android and iPhone environment. I try to build the iPhone native which has been generated by Ant Task is giving the below error. Tried giving read & right permission manually. no fix.
Running a custom build phase script: buildtime.sh
/Users/prasanna/Library/Developer/Xcode/DerivedData/MobileAppIphone-coksdtlrretmihenzyztxxxdcuss/Build/Intermediates/MobileAppIphone.build/Debug-iphonesimulator/MobileAppIphone.build/Script-427B829D1393724500F223DC.sh: line 7: /Volumes/DataHD/ST/Mobile_Client/temp/PROD/iPhone/buildtime.sh: Permission denied
DONE with script: buildtime.sh (exitStatus=126)\n\n
Verify the following:
Create the project in Eclipse
Build it using Worklight Studio
Right-click on the generated iphone\native\buildtime.sh file
Check if it has the required permissions
Do the same with Ant
Check if it has the required permissions
If the result differs then this is a defect in Worklight 6.1.0.x
That said, following one of the options from the answer you've linked to should work, however you do not mention which option did you follow...
Given you are using a command line, I'd opt to following the second option to use CHMOD.
It could be that you have given it the wrong path.
Experiment with the path and come back with results.
you can also change the permission using [CHMOD][3]:
Copy the path to the folder holding the buildtime.sh file
Open the Terminal app
Run the following command (but use your own path from 1 above): chmod 755
/Users/idan/Documents/Worklight/workspace-6001/TestProject/apps/TestApp/iphone/native/buildtime.sh
buildtime.sh is executable file, you need to give it executable permissions, not just r&w
Adding the CHMOD 755 in my Ant Script for all files and folder will solve this permission issue.
<target name="set-permission"> <echo level="info">Setting Read / Write / Execute Permissions to all files and .sh files</echo> <chmod perm="755" includes="/*.sh"> <fileset dir="${basedir}/temp/QA/iphone"> <exclude name="**/trial/"/> </fileset> </chmod> </target>

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

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.