'NativeScript + angular app crashing on startup (android 11 - API 30)
I have an app in NativeScript + Angular, when i put targetSdkVersion from 29 to 30 (as google needs) on App_Resources\Android\app.gradle, the app crashes on start and show nothing, just closes itself. I tryed so many things to fix, and nothing works. When i back targetSdkVersion to 29, the app works perfectly.
app.gradle
android {
compileSdkVersion 30
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
generatedDensities = []
multiDexEnabled true
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
dependencies {
implementation "androidx.multidex:multidex:2.0.1"
}
package.json dependencies
"dependencies": {
"@angular/animation": "^4.0.0-beta.8",
"@angular/animations": "~11.0.0",
"@angular/common": "~11.0.0",
"@angular/compiler": "~11.0.0",
"@angular/core": "~11.0.0",
"@angular/forms": "~11.0.0",
"@angular/platform-browser": "~11.0.0",
"@angular/platform-browser-dynamic": "~11.0.0",
"@angular/router": "~11.0.0",
"@nativescript/angular": "~11.0.0",
"@nativescript/appversion": "^2.0.0",
"@nativescript/core": "~7.0.0",
"@nativescript/datetimepicker": "~2.0.0",
"@nativescript/iqkeyboardmanager": "~2.0.0",
"@nativescript/picker": "^3.0.1",
"@nativescript/theme": "~2.3.3",
"@nativescript/webpack": "^3.0.0",
"@nstudio/nativescript-exoplayer": "^5.0.6",
"@nstudio/nativescript-snackbar": "^2.1.0",
"@ticnat/nativescript-searchable-select": "^1.0.7",
"credit-card-type": "^9.1.0",
"moment": "^2.29.1",
"nativescript-audio": "^6.2.0",
"nativescript-dna-netservices": "^1.1.0",
"nativescript-fontawesome": "^1.0.0",
"nativescript-iap": "^8.0.3",
"nativescript-screen-orientation": "^2.0.0",
"nativescript-sentry": "^2.0.0",
"nativescript-sqlite": "^2.6.4",
"nativescript-ui-dataform": "^7.0.4",
"nativescript-ui-sidedrawer": "~9.0.0",
"nativescript-zip": "^4.0.2",
"reflect-metadata": "~0.1.12",
"rxjs": "^6.6.0",
"xcode": "^3.0.1",
"zone.js": "~0.11.1"
},
"devDependencies": {
"@angular/cli": "^11.0.2",
"@angular/compiler-cli": "~11.0.0",
"@nativescript/android": "7.0.1",
"@nativescript/ios": "7.1.1",
"@nativescript/schematics": "^10.1.0",
"@nativescript/types": "7.0.0",
"@ngtools/webpack": "~11.0.0",
"@types/jest": "^26.0.15",
"codelyzer": "~6.0.0",
"node-sass": "^4.14.1",
"ts-patch": "^1.3.2",
"tslint": "~6.1.3",
"typescript": "~4.0.0"
}
Solution 1:[1]
Must be an issue with some of the plugins not working well with sdk30. It might be tiresome to check one by one, so try adding to AndroidManifest.xml. If it doesn't fix the issue, you should devote some time into finding the exact plugin(s) that cause the problem.
Thanks MishaMashina! Putting android:allowNativeHeapPointerTagging="false" in my AndroidManifest.xml solved my problem.
In aditional, i had another problem with API 30 after solved the first one. i was taking the ERR_ACCESS_DENIED error when i tryed load content in a webView. And i solved it setting this properties on the code when loading the webView:
webView = args.object.android;
...
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setAllowContentAccess(true);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Luan Luna |
