Its all about SAP Fiori Client -openSAP-Developing mobile apps with HCP-Week 3
Hello Developers,
Week 3 openSAP course Developing Mobile Apps with SAP HANA Cloud Platform was quite a short unit. Started with
- Introduction to SAP Fiori client,
- device feature support
- How to access on-premise / cloud based Fiori apps
- Integrate on-premise / cloud mobile platform
- Create your own custom Fiori client
Latest SAP Fiori Client 1.5 supports below device OS:
Android : 4.1+
iOS: 7.0+
Windows: 8.1, 10
Benefit of running SAP Fiori apps in the SAP Fiori client are:
- Improved management of the app resources using the cache manager plugin
- Handling of authentication challenges within a web view via AuthProxy plugin
- Customize app title, screen, splash screen
- Native device functionalities
- Security enhancements
- Provisioning the user certificate through SAP Mobile Secure and SMP
My findings:
- If you want to customize SAP Fiori client, make sure to install SMP3 Mobile SDK.
- Before running node create_fiori_client.js command, make sure you have run npm install and can see node_modules folder under C:\SAP\MobileSDK3\KapselSDK\apps\fiori_client path.
Otherwise you might see error, Error: Cannot find module ‘unzip’ at Function.Module.resolveFilename
3. An easy way to check if an android device has been detected successfully on the PC (via USB) by typing adb devices. If not, please insall the Google USB driver.
4. Proxying HCP fiori content through HANA Cloud Platform Mobile Services (HCPms) not working at the moment.
5. As per this discussion, there seems to be an issue with the gradle-andorid-aspectj-plugin.
Error message: Could not find property ‘javaCompiler’ on com.android.build.gradle.interna .api.LibraryVariantImpl_Decorated@xxxxx
Workaround: In Fiori_client project, navigate to C:\SAP\MobileSDK3\KapselSDK\apps\fiori_client\myopensapfioriclient\platforms\android\CordovaLib and look for built.gradle file and change its version to 0.9.12
6. SAP has been rebranding with its product and solutions for quite a long time. If you dont find HCPms on SAP HANA Cloud Platform cockpit, dont be surprise, its now ‘mobile services‘ 😉
7. Easy way to build and deploy an app to android device
cordova build android
cordova run android (on device connected via USB)
OR cordova emulate android (on android emulator)
8. If you dont have SAP Fiori URL (or work email address), you can try out SAP Fiori using sample Data (in Demo mode). e.g. My Inbox, Travel requests, order products etc.
9. If something goes wrong while accessing an application, go to SETTINGS and clear LOG, clear CACHE and clear ALL APPLICATION SETTINGS
10. Fiori URL is always mentioned in appConfig.js file (under C:\SAP\MobileSDK3\KapselSDK\apps\fiori_client\myopensapfioriclient\www)
11. An easy way to generate keystore file (default password: changeit)
12. For signing Android apk
- copy the myopensap keystore to the C:\SAP\MobileSDK3\KapselSDK\apps\fiori_client\myopensapfioriclient\platforms\android\build\outputs\apk
- open CMD command by navigating to java bin folder.
- copy paste below command
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore C:\SAP\MobileSDK3\KapselSDK\apps\fiori_client\myopensapfioriclient\platforms\android\build\outputs\apk\myopensap.keystore C:\SAP\MobileSDK3\KapselSDK\apps\fiori_client\myopensapfioriclient\platforms\android\build\outputs\apk\android-armv7-debug.apk myopensap
I got below result:
13. In case if you get an error like unable to sign jar: java.util.zip.ZipException , follow the solution mentioned here.
14. Optimize apk using zipalign tool > navigate to android sdk folder C:\Users\KansalJK\AppData\Local\Android\android-sdk\build-tools\23.0.1
run below command
C:\Users\KansalJK\AppData\Local\Android\android-sdk\build-tools\23.0.1>zipalign
-v 4 C:\SAP\MobileSDK3\KapselSDK\apps\fiori_client\myopensapfioriclient\platform
s\android\build\outputs\apk\android-armv7-debug.apk myopensapfioriclient.apk
Response: you will get myopensapfioriclient.apk generated in android path.
You can ask your queries in discussion section of this course.
For more info,follow
SMP and HCPms: SMP Developer Center
SAP Web IDE, SAP HAT : SAPUI5 Developer Center
SAP HCP : SAP HANA Cloud Platform Developer Center
SAP HANA Cloud portal: SAP HANA Cloud Portal
Week 1: SAP Mobile strategy -openSAP-Developing mobile apps with HCP-Week 1
Week 2: SAP Web IDE deep dive-openSAP-Developing mobile apps with HCP-Week 2
Week 4: #HCPms helps you in mobilizing Fiori Apps -openSAP-Developing mobile apps with HCP-Week 4
Week 5: Run your mobile app in offline and best practices-openSAP-Developing mobile apps with HCP-Week 5
Week 6: Secure your mobile-openSAP-Developing mobile apps with HCP-Week 6
Hi Kansal,
I'm trying to install Fiori client on my android device, and the same error as your step 5 is occuring, but it works on IOS.
The kapsel version is 3.11.0 - sps 7. gradle-android-aspectj-plugin version in build.gradle is 0.9.12.
Build is completed successfully if I will use SMP SDK v 3.9.2, but i should to use v. 3.11.7
Log file is attached.
What may be wrong?
C:\Kapsel\apps\fiori_client>cd FioriClient
C:\Kapsel\apps\fiori_client\FioriClient>cordova build android
Running command: cmd "/s /c "C:\Kapsel\apps\fiori_client\FioriClient\platforms\android\cordova\build.bat""
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_60
Running: C:\Kapsel\apps\fiori_client\FioriClient\platforms\android\gradlew cdvBuildDebug -b C:\Kapsel\apps\fiori_client\FioriClient\platforms\android\build.gradle -Dorg.gradle.daem
on=true
embedded
WARNING [Project: :] Current NDK support is deprecated. Alternative will be provided in the future.
WARNING [Project: :] Current NDK support is deprecated. Alternative will be provided in the future.
WARNING [Project: :] Current NDK support is deprecated. Alternative will be provided in the future.
WARNING [Project: :] Current NDK support is deprecated. Alternative will be provided in the future.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_armv7DebugCompile'.
> Could not resolve com.android.support:multidex:1.0.1.
Required by:
:android:unspecified
> Could not GET 'https://repo1.maven.org/maven2/com/android/support/multidex/1.0.1/multidex-1.0.1.pom'.
> Connection to https://repo1.maven.org refused
> Could not GET 'https://jcenter.bintray.com/com/android/support/multidex/1.0.1/multidex-1.0.1.pom'.
> Connection to https://jcenter.bintray.com refused
> Could not GET 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/android/support/multidex/1.0.1/multidex-1.0.1.pom'.
> Connection to https://download.01.org refused
> Could not resolve com.android.support:support-v4:23.0.1.
Required by:
:android:unspecified
> Could not GET 'https://repo1.maven.org/maven2/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom'.
> Connection to https://repo1.maven.org refused
> Could not GET 'https://jcenter.bintray.com/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom'.
> Connection to https://jcenter.bintray.com refused
> Could not GET 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom'.
> Connection to https://download.01.org refused
> Could not resolve com.google.android.gms:play-services-gcm:7.3.0.
Required by:
:android:unspecified
> Could not GET 'https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/7.3.0/play-services-gcm-7.3.0.pom'.
> Connection to https://repo1.maven.org refused
> Could not GET 'https://jcenter.bintray.com/com/google/android/gms/play-services-gcm/7.3.0/play-services-gcm-7.3.0.pom'.
> Connection to https://jcenter.bintray.com refused
> Could not GET 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/google/android/gms/play-services-gcm/7.3.0/play-services-gcm-7.3.0.pom'.
> Connection to https://download.01.org refused
> Could not resolve com.android.support:support-v4:23.0.1.
Required by:
:android:unspecified
> Could not GET 'https://repo1.maven.org/maven2/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom'.
> Connection to https://repo1.maven.org refused
> Could not GET 'https://jcenter.bintray.com/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom'.
> Connection to https://jcenter.bintray.com refused
> Could not GET 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom'.
> Connection to https://download.01.org refused
> Could not resolve com.android.support:multidex:1.0.1.
Required by:
:android:unspecified
> Could not GET 'https://repo1.maven.org/maven2/com/android/support/multidex/1.0.1/multidex-1.0.1.pom'.
> Connection to https://repo1.maven.org refused
> Could not GET 'https://jcenter.bintray.com/com/android/support/multidex/1.0.1/multidex-1.0.1.pom'.
> Connection to https://jcenter.bintray.com refused
> Could not GET 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/android/support/multidex/1.0.1/multidex-1.0.1.pom'.
> Connection to https://download.01.org refused
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 18.17 secs
C:\Kapsel\apps\fiori_client\FioriClient\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\Kapsel\apps\fiori_client\FioriClient\platforms\android\gradlew cdvBuildDebug -b C:\Kapsel\apps\fiori_client\FioriClient\platforms
\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\c5232106\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
C:\Kapsel\apps\fiori_client\FioriClient>
C:\Kapsel\apps\fiori_client\FioriClient\platforms\android\CordovaLib\build.gradle
buildscript {
repositories {
mavenCentral()
}
// Switch the Android Gradle plugin version requirement depending on the
// installed version of Gradle. This dependency is documented at
// http://tools.android.com/tech-docs/new-build-system/version-compatibility
// and https://issues.apache.org/jira/browse/CB-8143
if (gradle.gradleVersion >= "2.2") {
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0+'
classpath 'com.uphyca.gradle:gradle-android-aspectj-plugin:0.9.12'
}
} else if (gradle.gradleVersion >= "2.1") {
dependencies {
classpath 'com.android.tools.build:gradle:0.14.0+'
classpath 'com.uphyca.gradle:gradle-android-aspectj-plugin:0.9.12'
}
} else {
dependencies {
classpath 'com.android.tools.build:gradle:0.12.0+'
classpath 'com.uphyca.gradle:gradle-android-aspectj-plugin:0.9.12'
}
}
}
Hello Pavel,
Looks like network issue.
If your computer uses a proxy and you are developing for Android, create a folder (if one does not exist) named .gradle in your home directory and a file within it named gradle.properties.
systemProp.http.proxyHost=proxy
systemProp.http.proxyPort=8080
systemProp.http.nonProxyHosts=*.sap.corp|localhost
systemProp.https.proxyHost=proxy
systemProp.https.proxyPort=8080
systemProp.https.nonProxyHosts=*.sap.corp|localhost
Reference: Additional Required Software
If problem still persists, i will request you to raise a new thread with more info on the issue. If you want, you may provide reference of this blog as well.
Regards,
JK
Hi Jitendra,
Thank you for replay.
Problem is resolved. I just updated an android SDK.
Regards,
Pavel
HI,
Regarding the point 4.
4. Proxying HCP fiori content through HANA Cloud Platform Mobile Services (HCPms) not working at the moment.
is this still not working ?
I am also facing the same issue.
Thanks,
Rumeshbabu S