Hi guys, I’m stuck on this, I’ve been working for years on this guitar project it’s almost finish
but I don’t know why I can’t deploy it anymore.
Even after reinstalling everything …
I can’t not afford to migrate to V6, not right now …
A couple of weeks ago I did add to my config.xml:
But that does not the trick anymore, still having:
Installation failed due to: 'Failed to commit install session 2047383350 with command package install-commit 2047383350. Error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl2047383350.tmp/base.apk (at Binary XML file line #30): *******.music.jgv.MainActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present'
I must missing something, because it did work before …
Thanks for help !
here’s is my ionic info:
cli packages: (/home/iron-man/Voicings/node_modules)
@ionic/cli-utils : 1.9.0
ionic (Ionic CLI) : 3.9.0
global packages:
Cordova CLI : 10.0.0 (cordova-lib@10.1.0)
local packages:
@ionic/app-scripts : 3.2.4
Cordova Platforms : android 9.1.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v12.13.0
npm : 6.12.0
OS : Linux 5.15
Have you tried modifying your AndroidManifest.xml
file directly and/or verified the Cordova config is in fact updating it?
It’s clear that Cordova config is updating it, but as regards modifying directly the AndroidManisfest.xml
how can I do that since it’s a binary file once builded in release mode ?
thx
I was referring to updating it directly before building the APK instead of using Cordova’s config.xml
file.
What does your AndroidManifest.xml
file look like?
I had to add android:exported
in two spots in mine. One under manifest.application.activity
and the other manifest.application.provider
.
Unfortunately I am using Capacitor and can’t help with Cordova specifics. In Capacitor land we just update AndroidManifest.xml
directly.
this is my xml:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="233" android:versionName="0.2.33" package="zubicaray.music.jgv" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:exported="true" android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
* List item
It seems you save my week ! thx a lot twestrick
I’ve just added android:exported=“true” right after activity
<activity android:exported="true" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:exported="true" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
So here are my steps:
ionic cordova platform remove android
ionic cordova platform add android
modify platforms/android/app/src/main/AndroidManifest.xml accordingly
cordova build android --prod --release
1 Like
Instead of adding the exported attribute yourself, update your app to cordova-android 11 as it adds it and also targets SDK 32 by default.
Instead of ionic cordova platform add android
do ionic cordova platform add android@latest
to get latest version instead of the pinned version.
1 Like
Thx Julio, but that does not work for me.
I did try before …
And retry today, after having fully rebuilded everything, but still not working.
if you can, move to capacitor
1 Like
I 've made a reattempt, set right gradle and move to java 11
which I did before, but this time I solved some java compilation issue following:
opened 08:56PM - 22 Sep 20 UTC
closed 05:46PM - 23 Oct 20 UTC
triage
**Description:**
Ionic 4+ app fails to build after adding the firebasex packa… ge
**Steps to Reproduce:**
Step 1: Create a latest blank ionic project
Step 2: Added the firebasex package onto the Ionic 4+ project
ionic cordova plugin add cordova-plugin-firebasex
npm install @ionic-native/firebase-x
Step 3: Generate google-services.json from firebase project and add to the project folder
Step 4: Add android platform and build for android
Error received: Getting the following error when build for android
This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to
true in the gradle.properties file and retry.
Step 5: Modify platforms/android/gradle.properties as follows and rebuild
android.useAndroidX=true,
android.enableJetifier=true
Same error as step 4 received and the flags get reset automatically to 'false' as follows
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2048m
android.useAndroidX=false
android.enableJetifier=false
cdvMinSdkVersion=22
Step 6: Add < preference name="AndroidXEnabled" value="true" /> in config.xml
ionic cordova prepare android
build for android
Error received: Task :app:compileDebugJavaWithJavac FAILED
/Users/XXX/Development/app1/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:11: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;
**Output:**
/*-----------------------------------------------------------------------------------------*/
***** Output for Step4 error
Prepared android project successfully
Executing script found in plugin cordova-plugin-firebasex for hook "after_prepare": plugins/cordova-plugin-firebasex/scripts/after_prepare.js
cordova-plugin-firebasex: Preparing Firebase on Android
No scripts found for hook "before_compile".
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/XXX/Library/Android/sdk (DEPRECATED)
Using Android SDK: /Users/XXX/Library/Android/sdk
Subproject Path: CordovaLib
Subproject Path: app
Gradle Distribution URL: https\://services.gradle.org/distributions/gradle-6.5-all.zip
> Task :app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.appcompat:appcompat:1.1.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.versionedparcelable:versionedparcelable:1.1.0, androidx.fragment:fragment:1.1.0, androidx.core:core:1.2.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.constraintlayout:constraintlayout-solver:1.1.3, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.activity:activity:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.collection:collection:1.1.0, androidx.viewpager:viewpager:1.0.0, androidx.cardview:cardview:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.arch.core:core-common:2.1.0, androidx.savedstate:savedstate:1.0.0, androidx.annotation:annotation:1.1.0, androidx.lifecycle:lifecycle-common:2.1.0, androidx.appcompat:appcompat-resources:1.1.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-viewmodel:2.1.0, androidx.constraintlayout:constraintlayout:1.1.3, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.browser:browser:1.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-v4:1.0.0, androidx.media:media:1.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.vectordrawable:vectordrawable-animated:1.1.0, androidx.lifecycle:lifecycle-runtime:2.1.0, androidx.vectordrawable:vectordrawable:1.1.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 959ms
9 actionable tasks: 2 executed, 7 up-to-date
Command failed with exit code 1: /Users/gireesh.viswanathan@radian.com/Development/radian_rates_v5/platforms/android/gradlew cdvBuildDebug -b /Users/gireesh.viswanathan@radian.com/Development/radian_rates_v5/platforms/android/build.gradle
Error: Command failed with exit code 1: /Users/gireesh.viswanathan@radian.com/Development/radian_rates_v5/platforms/android/gradlew cdvBuildDebug -b /Users/gireesh.viswanathan@radian.com/Development/radian_rates_v5/platforms/android/build.gradle
at makeError (/Users/gireesh.viswanathan@radian.com/Development/radian_rates_v5/platforms/android/cordova/node_modules/execa/lib/error.js:59:11)
at handlePromise (/Users/gireesh.viswanathan@radian.com/Development/radian_rates_v5/platforms/android/cordova/node_modules/execa/index.js:114:26)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[ERROR] An error occurred while running subprocess cordova.
cordova build android --verbose exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
ionic:utils-process onBeforeExit handler: running 2 functions +0ms
ionic:utils-process processExit: exiting (exit code: 1) +37ms
/*-----------------------------------------------------------------------------------------*/
*****
****Note: The following error occurs when < preference name="AndroidXEnabled" value="true" > is added in the config.xml
****
cordova-plugin-firebasex: Preparing Firebase on Android
No scripts found for hook "before_compile".
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/XXX/Library/Android/sdk (DEPRECATED)
Using Android SDK: /Users/XXX/Library/Android/sdk
Subproject Path: CordovaLib
Subproject Path: app
Gradle Distribution URL: https\://services.gradle.org/distributions/gradle-6.5-all.zip
> Task :app:compileDebugJavaWithJavac FAILED
/Users/XXX/Development/app1/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:11: error: package android.support.annotation does not exist
import android.support.annotation.RequiresApi;
^
/Users/XXX/Development/app1/platforms/android/app/src/main/java/com/ionicframework/cordova/webview/IonicWebViewEngine.java:137: error: cannot find symbol
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
^
symbol: class RequiresApi
location: class IonicWebViewEngine.ServerClient
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
23 actionable tasks: 2 executed, 21 up-to-date
Command failed with exit code 1: /Users/XXX/Development/app1/platforms/android/gradlew cdvBuildDebug -b /Users/XXX/Development/app1/platforms/android/build.gradle
Error: Command failed with exit code 1: /Users/XXX/Development/app1/platforms/android/gradlew cdvBuildDebug -b /Users/XXX/Development/app1/platforms/android/build.gradle
at makeError (/Users/XXX/Development/app1/platforms/android/cordova/node_modules/execa/lib/error.js:59:11)
at handlePromise (/Users/XXX/Development/app1/platforms/android/cordova/node_modules/execa/index.js:114:26)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[ERROR] An error occurred while running subprocess cordova.
cordova build android --verbose exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
ionic:utils-process onBeforeExit handler: running 2 functions +0ms
ionic:utils-process processExit: exiting (exit code: 1) +41ms
/*-----------------------------------------------------------------------------------------*/
**My `ionic info`:**
Ionic:
Ionic CLI : 6.11.0 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.3.3
@angular-devkit/build-angular : 0.1000.8
@angular-devkit/schematics : 10.0.8
@angular/cli : 10.0.8
@ionic/angular-toolkit : 2.3.3
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 9.0.0, ios 6.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 8 other plugins)
Utility:
cordova-res (update available: 0.15.1) : 0.14.0
native-run (update available: 1.1.0) : 1.0.0
System:
Android SDK Tools : 26.1.1 (/Users/XXX/Library/Android/sdk)
ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v12.18.0 (/usr/local/bin/node)
npm : 6.14.8
OS : macOS Catalina
Xcode : Xcode 12.0 Build version 12A7209
ionic cordova plugin add cordova-plugin-androidx
ionic cordova plugin add cordova-plugin-androidx-adapter`
now it works, thx a lot