Map Viewer 3.2 Error on Android

2485
8
02-25-2019 01:21 AM
RonnieMa1
New Contributor III

Hello Everyone,

I have started using AppStudio and downloaded MapViewer 3.2 template. Without making changes, can upload the app to AppStudio Player and successfully use the app in my Android device. Then I have proceeded to local make to create an Android application and copied the app to my own Android phone. After installation, the app instantly closes. Therefore I opened Android Studio and checked for logcat. I see the following error:

2019-02-25 17:14:48.477 10618-10634/com.esri.app10379e244f2b4d73bc917f1e25be13c8 E/AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
Process: com.esri.app10379e244f2b4d73bc917f1e25be13c8, PID: 10618
java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app/com.esri.app10379e244f2b4d73bc917f1e25be13c8-AdxZbXoYmvIvjZR7P5E-IQ==/lib/arm/libAppFrameworkWebViewLib.so"
at java.lang.Runtime.load0(Runtime.java:928)
at java.lang.System.load(System.java:1621)
at org.qtproject.qt5.android.QtNative$3.run(QtNative.java:217)
at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:87)
at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61)
at java.lang.Thread.run(Thread.java:764)
2019-02-25 17:14:48.494 10637-10637/? E/Zygote: isWhitelistProcess - Process is Whitelisted
2019-02-25 17:14:48.495 10637-10637/? E/libpersona: scanKnoxPersonas
2019-02-25 17:14:48.495 10637-10637/? E/libpersona: Couldn't open the File - /data/system/users/0/personalist.xml - No such file or directory
2019-02-25 17:14:48.512 3657-3688/? E/PhoneWindow_APM :: isCalledPackage return false
2019-02-25 17:14:48.571 3271-3271/? E/audit: type=1400 audit(1551086088.554:2203): avc: denied { write } for pid=10637 comm="ng.android.lool" name="com.samsung.android.lool-P28Ah1gl-TYCDwlkP_W9iw==" dev="dm-1" ino=655402 scontext=u:r:system_app:s0 tcontext=u:object_r:apk_data_file:s0 tclass=dir permissive=0 SEPF_SM-G930F_8.0.0_0011 audit_filtered
2019-02-25 17:14:48.878 5423-5565/? E/ContactsProvider_EventLog: Flush buffer to file cnt : 1 size : 1Kb duration : 1ms lastUpdatedAfter : 60103 ms mFlush_time_threasold : 2000 mCurrentSize : 567
2019-02-25 17:14:49.050 4862-5121/? E/PBSessionCacheImpl: sessionId[21384852879885345] not persisted.
2019-02-25 17:14:59.933 3657-4165/? E/Watchdog: !@Sync 9373 [2019-02-25 17:14:59.933]
2019-02-25 17:15:00.024 3657-3686/? E/memtrack: Couldn't load memtrack module

My configurations:

Qt 5.11.2

NDK r10e

Local make selected platform: ARMv7

On a side note, I can successfully deploy an apk using the Web Map template.

0 Kudos
8 Replies
ErwinSoekianto
Esri Regular Contributor

Ronnie, 

Is the same issue happening if you do Cloud Make, then download the APK to the same Android device from our OTA website

Thank you,

Erwin

0 Kudos
RonnieMa1
New Contributor III

It is alright on Cloud Make, the apps deployed successfully and can be installed.

I would like to do local make, as I am preparing to customize my own mobile application. Although the build process can be done through cloud make, I would like to minimize the time of creating the app and local make is easier for me to view the errors during the build. 

Also, under the Configure Project section of QtCreator, it always says No valid kits found. Of course, I then used Tools > External > AppStudio > Make and was able to access the make page. I suppose we are not meant to build and run directly on QtCreator?

As Anshuman suggests, the following is my QtCreator configuration:

- Windows 10 Pro, 64-bit operating system

- QtCreator 4.5.0 (based on Qt 5.10.0)

- Qt version Qt 5.11.2

- JDK version 1.8.0_201

- Android SDK Tools version 26.1.1

- Installed Android SDK API 19, 26, 28

- NDK Version 10.4.0

Thanks,

Ronnie

0 Kudos
by Anonymous User
Not applicable

Hi Ronnie,

 

In addition to building the app using Cloud Make, can you also provide some more information about your build environment?

Which operating system are you using and what version of AppStudio do you have? This will help us to troubleshoot the issue better.

 

Also, it will be useful for us to understand the reason why you are using Local Make to build your app instead of Cloud Make.

 

Thanks,

Anshuman

0 Kudos
RonnieMa1
New Contributor III

An update on my progress trying local make.

Previously, after local make, there used to be a message like:

'android-26' does not exist

I have installed all SDKs through Android Studio and the message disappeared. Now I am trying to resolve the following:

Total time: 27.706 secs

PREDEX CACHE HITS: 0
PREDEX CACHE MISSES: 16
Stopped 0 worker daemon(s).
Android package built successfully in 43.713 ms.
-- File: xxxxxxxxxxxx/Intermediate/Android/AppStudioApp/android-build//build/outputs/apk/android-build-debug.apk
1 file(s) copied.

Warning: QML import could not be resolved in any of the import paths: ArcGIS.AppFramework.Controls
Warning: QML import could not be resolved in any of the import paths: Esri.ArcGISExtras
Warning: QML import could not be resolved in any of the import paths: Esri.ArcGISRuntime.Toolkit.CppApi
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Fusion.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Imagine.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Material.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Universal.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils

Build Successful

I've read plenty that these warnings can be ignored, but I thought it is worth mentioning here.

Ronnie

0 Kudos
ShobanaSuresh
Esri Contributor

Hi Ronnie,

Can you let me know if the apk built using below steps work?

  • Build Android apk using Local Make
  • Local Make would have automatically created Project, Intermediate, Output and Scripts sub folders in the path supplied
  • Delete the Intermediate and Output folders
  • Open Scripts\build-android.bat in a text editor
  • Remove double quotes in lines that use the variable usesAppFrameworkWebView. i.e., Update the lines to

                     SET usesAppFrameworkWebView=true
                     if %usesAppFrameworkWebView% == true (

  • Run the script build-android.bat manually to build the apk
  • Test if this apk works

Thanks

Shobana

RonnieMa1
New Contributor III

Hey Shobana, 

It worked! I can now deploy my app to Android. Do you know if this procedure should be applied to iOS as well?

Thanks,

Ronnie

0 Kudos
ShobanaSuresh
Esri Contributor

Hi Ronnie,

Glad to hear that the apk works now.

We'll make sure to fix the bug in the build script in AppStudio 3.3 final release.

FYI. This bug affects only Android Local Make builds that run on a Windows machine. If you run local make Android builds on a mac or linux machine, no changes need to be made in build scripts .

> Do you know if this procedure should be applied to iOS as well?

No. iOS builds are not affected by this bug.

Thanks

Shobana

RonnieMa1
New Contributor III

Thank you Shobana for your responses, really appreciate everyone's effort in assisting!

Ronnie