I am building for Android using Cordova with Ionic. I have set the versionCode in the widget tag inside the config.xml file to 10. But after building the app I am getting the version code as 108.
The version of Cordova that I have is 6.1.1.
How can I build an app where the versionCode is unchanged?
This still seems to be an unresolved issue in Cordova since version 5.0. Check out this issue link for more info on the same.
Also I suggest you to look at the following SO post for possible resolution of the issue.
Related
I have faced a problem in making an android build was working perfectly since the last 5 months but my Bitrise workflow is failing when I update compileSDKVersion and targetSDKVersion can you please help me are how to solve this issue
Previous
compileSdkVersion : 30
targetSdkVersion : 30
Work perfectly
Currently
compileSdkVersion : 31
targetSdkVersion : 31
Can’t work perfectly
Screen-short
[1]: https://i.stack.imgur.com/80ewD.png
Note:- My project is built in React Native framework, On my local system this project works perfectly and successfully created android build
System Specification:-
OS:- Monterey
RAM:- 16 GB
JDK Version:- 11.0.15
React native version:- 0.65.1
Updating just the SDK versions like that will cause problems because other pieces of React Native might be tied to it. You have to upgrade React Native to the latest version (or whichever version that supports SDK 31).
Undo your changes and upgrade using React Native CLI's upgrade command.
npx react-native upgrade
You can read more about it here.
I have an essential plugin that hasn't been updated in a year. I made the mistake of updating flutter, and now, when I try to build, it is telling me about a whole list of plugins that require android 31. Unfortunately, android 31 breaks the one plugin that I must use. Caret notation in the pubspec.yaml is funny because the documentation says it's supposed to choose a version of the package that works with the dependencies, but it's just not doing that.
Run flutter downgrade in command line or reinstall your old version.
Uptil yesterday everything was working fine.
Now all of a sudden I am getting this error (mentioned in title).
minSdkVersion is set to 16
TargetSdk is set to 25
All answers for previous such queries have not helped.
Is there some upstream issue.
My team and I are all hitting the same issue. No code was updated in our app. We just ran the build and hit this error.
This arises from a mismatch between the Android compile SDK version and the support library / build tools version (see here).
Even if you changed no code in the project, if the Android SDK modules were updated or the cordova-android platform version changed, this would cause the observed error.
You can resolve it by updating the project to use the most recent cordova-android version:
cordova platform rm android
&& cordova platform add android#latest --save
&& cordova build android
Also make sure the Android SDK components (Support Library, build tools, platform tools) are up-to-date.
I am trying to build an app made with Angular2 + Ionic2 (ie. Cordova 6) for my android 4.4.4.
I have noticed the version 4.4.4 of android was reffered to the api level 20, so this is the version I have downloaded and installed (api20 + android SDK Build Tools level 20 too). In cordova I have edited the platforms/android/project.properties and platforms/android/CordovaLib/project.properties to build to android-2O instead of the default android-23 api. I have also edited the AndroidManifest.xml.
The issue comes when I try to compile my project with cordova build android, cordova executes some CordovaLib:instructions UP-TO-DATE and bug on CordovaLib:compileDebugJavaWithJavac..
According to the error report which is :
platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:25:
error: cannot find symbol import android.webkit.ClientCertRequest;
^ symbol: class ClientCertRequest location: package android.webkit
At the end of all the error report it also says :
You may not have the required environment or OS to build this project
Error: Error code 1 for command:
platforms/android/gradlew with args:
cdvBuildDebug,-b,/Users/thomas/Documents/www/MyProject/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
So I come here to ask for help, because I have no idea what is wrong with Cordova and android-SDK...
Thank you to everyone who helps ;)
Bye !
When you build for Android there is targetSdkVersion and minSdkVersion.
targetSdkVersion indicates wich version of the API will be used to compile the program, not wich version of Android must be on the device the program will be run on.
minSdkVersion indicates the minimum version of android a device must have to be compatible with your program.
If you downgrade the targetSdkVersion, you are limited to older functions and if your program uses the newer functions it will fail to compile (I think it's what happens if you try to compile a Cordova version designed for API 23 with API 20).
By default Cordova (at least for the version 5.1 of cordova-android) uses the targetSdkVersion 23 and the minSdkVersion 14, which means programs should work on devices runing Android Ice Cream Sandwich (4.0) or newer.
In your case, all you have to do is install SDK 23 and don't touch anything to try to change the target SDK.
Please I am trying to build a small android app with ionic but I downloaded android SDK 5.1.1 .
I wish to deploy to a device that has android version 2.3.3 but it won't even build .
It keeps telling me that the target app is android-22. I want it to build for a lower version like android-8.
Please any help will really be appreciated.
I only want it to be able to build for a lower version
I tried to edit the version in the androidManifest.xml files on my project but still I get errors
->First of all, let`s make sure you have downloaded the plateform for Android 2.2 using Android SDK Manager.
->Set android:minSdkVersion to 8 in androidManifest.xml
->Verify the BuidTarget attribute, since it specifies the development tool of which api to provide you.
->Your problem seems to be the absence of API8 in your SDK.
you might need to change your minSdk in build.gradle
in the app build.gradle file set the min sdk version as 8.
defaultConfig {
applicationId "com.etrade.mobilepro.activity"
minSdkVersion 8
versionCode 87
versionName "4.5"
}
Since the app is not building I guess you don't have that particular sdk.I would suggest downloading the sdk through sdk manager.