Customize OutSystems Now Android Studio NullPointerException

Customize OutSystems Now Android Studio NullPointerException

  

Hi There,

I am trying to customize OutSystems Now on Andriod Studio. I followed all the steps from the page with the instructions on the steps for buidling your own app:
  • Installed Andriod Studio
  • In the Android SDK manager installed all the packages (some have newer versions)
  • Downloaded OutSystems Now source code from GitHub
  • Opened the project
  • With a direct build (after some rebuild and synchronize to get rid of an Andrios-22 error) an NullPointerException pops up, see screen shot
Any help in resolving this?

Regards,

Wilko
Hello wilko.

The exception is from Android Studio and is not related to the OutSystems Now source code. Can you try creating a new empty project and see if the problem persists? Are you using the latest version of Android Studio? Can you try in another machine?

Thanks

Hi Cesar, I know it is not OutSystems but Android Studio. I just follow the steps provided on the outsystems page https://labs.outsystems.net/OutSystemsNowDocs/OutSystemsNowOpenSource.aspx, And I am making very very sure that I follow the instruction there, and that is where the errors start, it should not be like that in my expectation. I did it all over again and at least I got rid of the NullPointerException but other errors popup. This is what I do:
  • Remove Android Studio
  • Install Android Studio
  • Remove outsystems-app-android folder from laptop
  • Install out-systems-app-android folder from downloaded zip file OutSystemsNow-Android-Master.zip
  • Open Android Studio and open the OutSystems Now project
  • Have exactly the packages installed in the Android SDK manager as written on the outsystems now page, only some packages are not able to be installed with the specific versions mentioned, I am using the stand-alone SDK manager:
  • The Android SDK Tools is only available in 25.1.6 and not 24
  • The Android SDK Platform-tools is only available in 23.1 and not 21
  • The rest is fine, except the Android Support Library has an indication behind it of being Obsolete, I installed 23.2.1 anyway
When returning to Android Studio from the SDK manager a Gradle build starts. That gives the following errors:
  • Failed to sync Gradle project 'outsystems-app-android'
  • Cause: failed to find target with hash string 'android-22' in SDK folder
After some looking around, the following project.properties files have android-22 as taget:
  • OutSystems>platforms>android>project.properties
  • OutSystems>platforms>android>CordovaLib>project.properties
btw, AndroidUniversalImageLoaderLib references android-20, and another references android-17.

The OutSystemsNow SourceCode page is not mentioning SDK Platform 22 (Android 5.1.1 (API 22)). Two options I tried, downgrade the android-22 target in the project.properties files to android-20 or install the SDK Platfom 22. Both are tricky.

If SDK platform 22 is installed, apply plugin: 'android-library' is outdated in CordovaLib and some properties cannot be found. If 'android-library'' is to be changed to 'com.andoid.library' as suggested by the compiler, the properties are not giving an error anymore.

A rebuild after that gives an error in the execution of the :OutSystems:platform:android:processDebugResources' with process AndriodSDK\build-tools\21.1.2\aapt.exe finished with non-zero exit value 1

That does it for me, not able to resolve.

Downgrading the android-22 to android-20 in the two project.properties (first option mentioned) leads to a host of other errors in the compiler which I am not able to resolve.

So given that I am trying to follow the instructions here and get stuck, even though it is not OutSystems, it does not enable me to make my own version of the OutSuystems Now app where I need to load the plugins I need for my project.

Help is appreciated. Attached are screen prints of the steps and errors.

Wilko
Solution
Hi Wilko,

In fact the OutSystems Now page is a bit out dated, and some of the given packages versions are already obsolete. Can your please follow this steps and see if this works for you?

  1. Do a clean Install out-systems-app-android folder from downloaded zip file OutSystemsNow-Android-Master.zip;
  2. Open Android Studio and open the OutSystems Now project;
  3. Now, go to Tools -> Android -> SDK Manager and when the window appear select "Launch Standalone SDK Manager";
  4. Install the suggested packages and in the end guarantee that you have installed these packages: Android SDK Tools 25.1.6 (latest),  Android SDK Platform-tools 23.1 (latest), Android SDK Builds-tools 23.0.3 (latest) and Android SDK Build-tools 20.
  5. To finish, go to build tab (of Android Studio) and rebuild project;

Ps: attached is a print of SDK Manager with the tools needed to build the OutSystems Now.

I hope this help you,

Thanks,
Bruno
Solution
Bruno hi,

Yes it helped. Thanks for your support. If I do that, the rebuild executes successfully. The APK generation does not.

In the build.gradle of the CordovaLib the constant for the compileSdkVersion and buildToolsVersion are unknown (cdvCompileSdkVersion and cdvBuidltoolsVersion, even though in the project structure of the CordovaLib module the properties are set.

Changing those constants to 22 and '23.0.3' gets an APK generated. See attached build.gradle.

So I am happy.

If you can give me hint on what steps to do to incorporate the MicroBlink plugin, I would be even happier.

Saludos,

Wilko

Bruno Grácio wrote:
Hi Wilko,

In fact the OutSystems Now page is a bit out dated, and some of the given packages versions are already obsolete. Can your please follow this steps and see if this works for you?

  1. Do a clean Install out-systems-app-android folder from downloaded zip file OutSystemsNow-Android-Master.zip;
  2. Open Android Studio and open the OutSystems Now project;
  3. Now, go to Tools -> Android -> SDK Manager and when the window appear select "Launch Standalone SDK Manager";
  4. Install the suggested packages and in the end guarantee that you have installed these packages: Android SDK Tools 25.1.6 (latest),  Android SDK Platform-tools 23.1 (latest), Android SDK Builds-tools 23.0.3 (latest) and Android SDK Build-tools 20.
  5. To finish, go to build tab (of Android Studio) and rebuild project;

Ps: attached is a print of SDK Manager with the tools needed to build the OutSystems Now.

I hope this help you,

Thanks,
Bruno
 
 

To incorporate the MicroBlink plugin in OutSystems Now you will need to install Cordova (that runs on NodeJS). After you have NodeJS and Cordova running on your machine you should open the terminal and go to ..../outsystems-app-android/Outsystems folder. Now, run cordova plugin add https://github.com/OutSystems/Cordova-Plugin-Micro-Blink-ID.git comand to install the plugin.

In each plugin documentation there is a section explaining what command you should run to install it. If you want to confirm that the plugin is installed on your project run cordova plugin list an see if your plugin is listed.

Thanks,
Bruno