How to create signed apk from 32 bit to 64 bit? - android-studio

My project configuration
React-native version: 0.55.3
Android Gradle Version: 3.3
Android api level: 26
It will create 32 bit apk, now we need to create 64 bit apk file to upload on play store but in the studio, facing some issue like
Could not determine Java version "12.0.1"
so I've updated the Gradle file to 5.4.1, compileSdkVersion from 26 to 28 and all other react native library to latest updates But I got too many errors in the studio.
WARNING: The following project options are deprecated and have been
removed: android.useDeprecatedNdk NdkCompile is no longer supported
WARNING: Configuration 'provided' is obsolete and has been replaced
with 'compileOnly'. It will be removed at the end of 2018. For more
information see:
http://d.android.com/r/tools/update-dependency-configurations.html
after this error studio stuck and too many other libraries do not link with the android studio.
How to solve useDeprecatedNdk error and how to convert compileSdkVersion API level to 28 to run APK successfully.
Update gradle file:
App level build.gradlew
Root level build.gradle
gradle.properties
Old gradle version
App level build.gradle
root level build.gradle
graddle.wrapper.properties
react native package.json file

you can migrate your code with androidx and minimum apilevel 21

Google Play Changes in 2021:
All application that do not support a 64-bit version will not be available in the Google Play Market (including games written on the Unity engine)
read more
WHAT TO DO?
Thanks to ReactCommunity! As of March 12, 2019, ReactNative has a new version release 0.59.
Yes, they added hooks, but the important thing here is 64-bit support on Android.
So just upgrade your react native to the latest version and it will compile the App with 64 bit support!
How to Upgrade React Native??

Related

Unknown attribute warning in XML

AndroidManifest and XML layouts are showing me the Unknown attribute android: warning even though the attributes exist and the app works on the device.
Example: Unknown attribute android:maxSdkVersion, android:clickable="true" etc.
I am aware of the other questions regarding this issue and tried everything I could find about this topic but nothing works for me.
I tried to:
Sync Project with Gradle Files
Delete the .idea and .gradle folders from the project location
Delete caches from c:\Users\<user>\.gradle\caches\
Invalidate caches and restart ...and many other things I couldn't remember right now.
The problem still persists on a newly installed OS (Windows 11) and obviously, newly installed Android Studio, and also the issue affects only old projects...
Also, my project is up to date with everything the Android Studio doesn't show me any warning to update a version of a dependency or so.
Gradle version 7.3.3
Android Gradle Plugin Version 7.2.1
Update:
The warning appears only with the SDK version 33 (compileSdkVersion 33), if I build with version 32, the warning disappears...
Update2:
New projects which use API level 33 still show the warning...
Maybe it's a bug in the SDK?
UPD 20.01.2023: You can update Android Studio to the latest version now (Android Studio Electric Eel | 2022.1.1) and this bug is fixed there. Worked for me.
OLD: Got same crap and a lot of other.
And yes, just downgraded buildToolsVersion to "32.1.0 rc1" and targetSdkVersion, compileSdkVersion to API 32 for as long as bug exists in API 33.
Same here, I use this temporary workaround until Android team fix this issue or better solution.
Move all require code for Android 13 into library module (in my case, all of them are moved into utility module) and keep it use compile SDK 33
Temporary changes compile SDK in other module to 32 for local development
It's not ideal, but switching to Dolphin RC1 resolves this. Given that it will (presumably) hit stable pretty soon, it may not get fixed in Chipmunk. You can download Dolphin from the Android Studio Preview page, just be aware that it is not available as an installer so you will need to manually update your installed version or use it alongside until it hits stable.
Perfect!!
set compileSdkVersion to 32
compileSdkVersion 32
set targetSdkVersion to 32
targetSdkVersion 32
downgrade androidx.core:core-ktx
implementation 'androidx.core:core-ktx:1.8.0'
This config works for me:
Android Studio Dolphin | 2021.3.1
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
compileSdk 33 (SDK 33 Rev. 2, Sources 33 Rev. 1)
buildToolsVersion "33.0.0"
targetSdkVersion 33
Gradle Plugin version 7.3.0.

uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library

Earlier we were using Android API level 28 with minSdkVersion as 19 in config.xml and the app was available in the play store. Recently we updated the android version ( By removing and adding latest android as google play console mandated to have android above API level 29 ). Bu doing this ionic build gave below error :
Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 22 declared in library [:CordovaLib] D:\MobileApp\MyApp\platforms\android\CordovaLib\build\intermediates\library_manifest\debug\AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 22,
or use tools:overrideLibrary="org.apache.cordova" to force usage (may lead to runtime failures)
Due to this app could be updated in could of mobile phones. Please suggest if there is any way to have 19 as minSdkVersion.
Thanks !
Try to change the minSDKVersion to 22 in your config.xml file. I think the problem will be resolved. I had the same problem.
Example: <preference name="android-minSdkVersion" value="22" />
I have solution, it's not very complicated :
Enter on "player settings" (file --> build settings --> player settings) and scroll.
When you see "Minimum API Level", chante that (i choice Android 8.0 "Oreo" (API Level 26)).
Try adding this 1 line code below, under Gradle Scripts > gradle.properties (Project Properties) > Syn now > Build (Clean project > Rebuild project)
android.suppressUnsupportedCompileSdk=32

Where is gradle build tools version set?

I have installed sdk build tools version 28.0.2, and set buildToolsVersion = "28.0.2" in build.gradle. Yet when I run ./gradlew installDebug, I get an error message saying The SDK Build Tools revision (23.0.1) is too low for project.
I even UNinstalled version 23.01.1 via the android studio sdk manager - but then when I run gradlew it reinstalled it!
I ran grep -ri buildtool * to try and find where it might be, but the only reference I could find was in build.grade.
I managed to work around this by upgrading my gradle version to 3.1.0. But as a result, I now get this message:
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.0.
Which tells me that the SDK Build Tools version is being set... somewhere!
Where else is the required build tools version set? How do I change it so that gradle will use the latest version, rather than being stuck on an old one?
I had the same problem. The buildtoolsversion is defined in build.gradle(Module.app).
I removed this line from the file and then the warning disappeared.

How to solve the issue of mixing version of support libraries in Android Studio?

I received an update to android SDK. After the update, when I open a project, Android Studio recommends to update Android Gradle to v 2.3.0 and Gradle to v 3.3. I updated the project as recommended. After that I found an ugly red line under the appcompat-v7:25.2.0' (see pic).
The error, according to android studio, is that I am mixing versions of support libraries (v 25 and 24), but I didn’t find any support library of v24. I tried to build a signed apk, but app build failed (using V2 / full apk signature), so I searched the web and I found one solution to this problem by adding this line to the build.gradle: multiDexEnabled true. Adding that line fixed the problem of generating signed apk, although the red line of error was still there, it didn’t get rid of it.
Then I installed the signed apk on two phones, one running Android 6.0 and the other one is running Android 4.4.2. The app runs smoothly on Android 6.0 and crashes on start on Android 4.4.2 (I set minSdkVersion to 19).
My questions are: how can fix that error in the gradle permanently? Is adding the line “multiDexEnabled” to gradle really needed? How can I run my app on android 4.4.2 without crashing?
I'm had the same issue, just add these lines:
compile "com.android.support:animated-vector-drawable:${supportLibVersion}"
compile "com.android.support:mediarouter-v7:${supportLibVersion}"
In your case supportLibVersion is 25.2.0.

UnsatisfiedLinkError, Cocos2D-x app crash on startup

My Cocos2D-x app is working only on android 22+ and crash in lower platforms throwing an exception java.lang.UnsatisfiedLinkError
App config:
Target SDK version 22 (Android Lollipop).
Min SDK is 14.
NDK r10c with eclipse.
Update:
Very useful answer https://stackoverflow.com/a/27093163/3547788
Old solution:
Possible fix by changing the ndkr10 to ndkr9 then the app will work for all android versions, For NDK10:
changing the target & min sdk at the manifest to 14
add APP_PLATFORM := android-14 to application.mk
clean and build.
Well you decide on the minimum version of Android to support and your game is then expected to run on all versions from that version to the latest version.
You cannot, for example, decide to support 2.3, 4.0.4 and 5.0.1, but not 4.4.2 and 5.0.
See <uses-sdk> reference.

Resources