-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Issue Description
We notice that our Android apps are consistently crashing when using @nativescript/core 8.4.8-next
(we had to install one of the next versions to fix the following issue in our live apps: #10213)
It seems to be related to adding a border to any view, like a button.
We provided a sample app for reproduction (see below) and it has the following layout:
<Page>
<ActionBar title="My App"/>
<StackLayout class="p-20">
<Button text="TAP" tap="onButtonTap" class="-primary" borderRadius="20"/>
</StackLayout>
</Page>
import {Frame} from "@nativescript/core";
export function onButtonTap() {
Frame.topmost().navigate("test-page");
}
On our side, the crash is only reproducable on Android 9 emulator and older versions, it does not occur on Android 10 or higher on our side.
Sometimes the app crashes when tapping the button and navigate to another page, sometimes it already crashes when loading the first page with that button.
We see lots of crashes in Crashlytics like this:
System.err: An uncaught Exception occurred on "main" thread.
System.err: path must be convex
System.err:
System.err: StackTrace:
System.err: java.lang.IllegalArgumentException: path must be convex
System.err: at android.graphics.Outline.setConvexPath(Outline.java:284)
System.err: at org.nativescript.widgets.BorderDrawable.getOutline(BorderDrawable.java:914)
System.err: at android.view.ViewOutlineProvider$1.getOutline(ViewOutlineProvider.java:38)
System.err: at android.view.View.rebuildOutline(View.java:15788)
System.err: at android.view.View.invalidateDrawable(View.java:20909)
System.err: at android.graphics.drawable.Drawable.invalidateSelf(Drawable.java:453)
System.err: at android.graphics.drawable.Drawable.setVisible(Drawable.java:862)
System.err: at android.view.View.onVisibilityAggregated(View.java:12924)
System.err: at android.view.View.dispatchDetachedFromWindow(View.java:18395)
System.err: at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3777)
System.err: at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3769)
System.err: at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3769)
System.err: at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5359)
System.err: at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5330)
System.err: at android.view.ViewGroup.removeView(ViewGroup.java:5261)
System.err: at androidx.fragment.app.SpecialEffectsController$Operation$State.applyState(SpecialEffectsController.java:470)
System.err: at androidx.fragment.app.DefaultSpecialEffectsController.applyContainerChanges(DefaultSpecialEffectsController.java:844)
System.err: at androidx.fragment.app.DefaultSpecialEffectsController.executeOperations(DefaultSpecialEffectsController.java:130)
System.err: at androidx.fragment.app.SpecialEffectsController.executePendingOperations(SpecialEffectsController.java:306)
System.err: at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1912)
System.err: at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1817)
System.err: at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760)
System.err: at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:547)
System.err: at android.os.Handler.handleCallback(Handler.java:873)
System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
System.err: at android.os.Looper.loop(Looper.java:193)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6669)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
The crashes happen mostly on Android 9 (but also Android 10, Android 6, ...).
First version with the issue: 8.4.8-next-02-21-2023-4229708015
Last version without the issue: 8.4.8-next-02-20-2023-4218942650
The issue is still existing when using version 8.5.0-alpha.2
Reproduction
- Download and build the app
- install it on Android 9 Emulator (or Android 8, 7, 6, ...)
- Tap the button to navgate to another page -> CRASH
Bildschirmaufnahme.2023-03-14.um.11.58.02.mov
Relevant log output (if applicable)
-Environment
OS: macOS 13.2.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Shell: /bin/zsh
node: 16.17.0
npm: 8.19.3
nativescript: 8.4.0
# android
java: 11.0.11
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found
# ios
xcode: 14.2/14C18
cocoapods: 1.11.3
python: 2.7.18
python3: 3.10.9
ruby: 2.6.10
platforms:
- DriverKit 22.2
- iOS 16.2
- macOS 13.1
- tvOS 16.1
- watchOS 9.1Dependencies
"dependencies": {
"@nativescript/core": "^8.4.8-next-02-21-2023-4229708015",
"@nativescript/theme": "~3.0.2"
},
"devDependencies": {
"@nativescript/android": "^8.4.0",
"@nativescript/webpack": "~5.0.12"
}Please accept these terms
- I have searched the existing issues as well as StackOverflow and this has not been posted before
- This is a bug report
- I agree to follow this project's Code of Conduct