App crashes with API 28 on Android 8.0

I’m using Fuse 1.12 installed via NPM. Since I build my app using:

"SDK": {
    "BuildToolsVersion": "28.0.3",
    "CompileVersion": 28,
    "MinVersion": 19,
    "TargetVersion": 28
},
"Architectures": {
    "Release": ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"]
},

it crashes or it simply wont start on Android 8. I read in the forum that time ago this behaviour was due to a font issue or a mapview issue, but for my understanding these issues have been fixed (I do use Lato font, but I don’t use third party libraries).

I dont’ have a Android 8 device to test on and Android Studio emulator keeps reporting INSTALL_FAILED_NO_MATCHING_ABIS so I can’t understand what’s the error.

Do you have a mapview? Here’s the issue and resolution:

Hi and thank you for answering. Yes I do use MapView. If it may be usefull this is what Google Play console reports:

java.lang.RuntimeException: 
   at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3303)
   at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3411)
   at android.app.ActivityThread.-wrap12 (Unknown Source)
   at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1994)
   at android.os.Handler.dispatchMessage (Handler.java:108)
   at android.os.Looper.loop (Looper.java:166)
   at android.app.ActivityThread.main (ActivityThread.java:7529)
   at java.lang.reflect.Method.invoke (Native Method)
   at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:245)
   at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:921)
Caused by: java.lang.IllegalStateException: 
   at android.app.Activity.onCreate (Activity.java:1081)
   at android.support.v4.app.SupportActivity.onCreate (SupportActivity.java:66)
   at android.support.v4.app.FragmentActivity.onCreate (FragmentActivity.java:321)
   at android.support.v7.app.AppCompatActivity.onCreate (AppCompatActivity.java:84)
   at com.apps.tsn.tsn21.onCreate (tsn21.java:53)
   at android.app.Activity.performCreate (Activity.java:7383)
   at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1218)
   at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3256)

I will try you suggestion. I know I already asked but I still don’t understand UXL. Do you mean that I have to create a .UXL file with <Extensions>... inside and save it in the root folder of the app?
Thank you for the patience.

Just add this to the maps module:
com.google.android.gms:play-services-maps:16.1.0

Like in my PR here:

I managed to install the APK on a friend’s Android 8.0 phone but unfortunately the issue that keeps crashing the app hasn’t been solved with this suggestion.

I edited the MapView.uno file in C:\Users\_user_\AppData\Local\Fusetools\Packages\Fuse.Maps\1.10.0-rc1\Android I changed

[Require("Gradle.Dependency.Implementation", "com.google.android.gms:play-services-maps:12.0.1")]

to

[Require("Gradle.Dependency.Implementation", "com.google.android.gms:play-services-maps:16.1.0")]

but the app simply does not start. Tapping the icon does nothing. I do use MapView but the problem does not occur when the user runs the maps, it occurs immediately.
This is a serious issue as many users are reviewing the app 1 star… :frowning_face:

We had crash issues with Android 8.0 when the orientation was set in the .unoconfig as “portrait”. Can you check if you are forcing portrait? I fixed the issue with this:

You need to narrow down the crashing/offending code by removing each “complex”/3rd party module 1 by 1

Did you remember to uno doctor after you made the change? …and which version of uno are you using?

Now that I have a Android 8 device I finally di some testing. Thank you for answering.

@aeq
UNO version is 1.12.1.352
Now that you told me I did uno doctor
Fortunately the app seems to not suffer the MapView issue. I changed MapView.uno found in C:\Users\_user_\AppData\Roaming\npm\node_modules\fuse-sdk\node_modules\@fuse-open\fuselibs\Source\build\Fuse.Maps\1.12.0\Android (which is the ‘new’ FuseLibs folder after NPM installation) as said but the app worked with both com.google.android.gms:play-services-maps:... version.

@Matti_Tihverainen
Yes, my app does use portrait and that was the bug that prevented the app from starting. I still would like to set the app to portrait mode, so I set windowIsTranslucent=false as explained but it did not worked. Let me say that I did not copied or moved any file as said in point #3 of your post because since the use of NPM as the preferred method to install Fuse the folders are not those indicated, nor I want to risk to break Fuse libs installation with manual operations.
Is there an updated workaround to set portrait mode?

I notice that AndroidManifest.xml in C:\Users\enric\AppData\Roaming\npm\node_modules\fuse-sdk\node_modules\@fuse-open\uno\lib\build\UnoCore\1.12.1\Targets\Android\app\src\main contains already:

#if @(Project.Mobile.Orientations:Equals('Portrait'))
              android:screenOrientation="portrait"
#elif @(Project.Mobile.Orientations:Equals('LandscapeLeft'))
              android:screenOrientation="landscape"
#elif @(Project.Mobile.Orientations:Equals('LandscapeRight'))
              android:screenOrientation="reverseLandscape"
#elif @(Project.Mobile.Orientations:Equals('Landscape'))
              android:screenOrientation="sensorLandscape"
#else
              android:screenOrientation="user"
#endif

So android:screenOrientation is not the way to solve the issue.

1 Like

Hello! You have to build Uno again to make changes in the styles.xml work. I’m not sure how to do this with the NPM installation.