I have been building my apps using Expo v27.0.0 which is react-native v0.55 (latest version as I know of at the time writing this post), and apparently when building the app, the target API is 25 and google play require the app to target at least API 26 to be published.
I have tried to detach the app from expo and rebuild using android studio after change the targetSDKVersion, however I keep getting too many errors with the gradle, and as I know, I won't be able to go back to react native if I detach, so I would prefer not to detach.
Is there any way to manually change the API level in react native ?
All answers are greatly welcomed.
Thank you very much.
Related
I want to use to use React Native for a project at work, but based on their guide for setting up the development environment, it seems like it's out of date.
Reading the guide for setting up React Native at https://reactnative.dev/docs/environment-setup, I read:
...We recommend JDK11. You may encounter problems using higher JDK versions.
The Java SE Development Kit (JDK) is at version 19 now, so this was my first red flag.
Additionally, it reads:
Building a React Native app with native code, however, requires the Android 12 (S) SDK in particular.
When choosing the option for that SDK when creating a new project in Android Studio, it tells me, "Your app will run on approximately 24.1% of devices."
I can't move forward if this won't work on most devices, however I read that React Native is still popular today. I'm not sure that's possible given that 24.1%. Can anyone help clear this up? Are there caveats for that statistic that I read?
For context, this is a simple smartphone app for submitting forms.
Yes, React Native works with modern Android and iOS phones, and is still under active development.
Yes, JDK 11 is recommended in the docs, and is the version of the JDK you should develop React Native with.
When you create a new React Native project from the CLI, the compilation and target OS versions are not controlled by which JDK you have installed. They are set in your build.gradle:
buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 23
compileSdkVersion = 31
targetSdkVersion = 31
That's all you need to worry about in terms of which devices you can support. It's not recommended to modify those versions, which depend on the version of React Native you start your project in. However, I've raised the target due to dependencies before, and nothing has exploded.
You can see some of the brands who use it to write their apps on RN's showcase on Github. Most of those apps include forms, so you should be covered there.
Suddenly after changing target SDK version to 30 all the file system operations using react-native-fs like mkdir, moveFile, copyFile etc stopped working on react-native android app for android version 11. I'm aware of new scoped storage introduced in android 10 and was using requestLegacyExternalStorage="true" flag to keep using the legacy storage. But this flag is not respected on android 11 so is there any way I can still use all the file system operation using react-native-fs? I saw a bunch of open issues related to this on their repo, but no clear solution is mentioned. So reaching out for any help here.
Any help on how I can continue to use all the above-mentioned fs operations on android 11 and target SDK 30 is very appreciated.
Othe details,
react-native-fs version 2.11.17
react-native version 0.59.5
targetSdkVersion : 30
requestLegacyExternalStorage is set to true
I need to set the target SDK version of an Android project to API 14. But I do not have the same version available to compile the project. I know that the project can be compiled with a different version but I need to know whether it will cause any issue.
I received the error "Android manifest file is missing" even though it exists. When I cleaned and then built the project it was compiled but the application crashed. What am I doing wrong here?
These were my settings.
There should be no issues introduced when compiling with a higher version, it is even encouraged to do so. You can find more on that topic in this Medium article.
I would also like to bring your attention to the following blog, which contains some important information regarding SDK targeting in the near future.
Unfortunately I do not use Eclipse so I fear cannot provide any verified insight on that matter. However the suggestions I have found so far include:
Cleaning the project
Getting rid of characters such as ö,ë, etc.
Deleting the file and recreating it
The manifest issue was probably due to creating a project with the same name over and over again. However clean -> build the project helped me get rid of it.
Yeah. Android compile version can be higher than the target version.
Android compile version and target version do not have to be the same.
compileSdkVersion
The compileSdkVersion is the version of the API the app is compiled against. This means you can use Android API features included in that version of the API (as well as all previous versions, obviously). If you try and use API 16 features but set compileSdkVersion to 15, you will get a compilation error. If you set compileSdkVersion to 16 you can still run the app on a API 15 device as long as your app's execution paths do not attempt to invoke any APIs specific to API 16.
targetSdkVersion
The targetSdkVersion has nothing to do with how your app is compiled or what APIs you can utilize. The targetSdkVersion is supposed to indicate that you have tested your app on (presumably up to and including) the version you specify. This is more like a certification or sign off you are giving the Android OS as a hint to how it should handle your app in terms of OS features.
As for the manifest error, you could try (if you are using android studio) clicking File > Invalidate Caches / Restart or force a gradle sync
Thank you for your answers.
I think the manifest issue was due to creating a project with the same name over and over again. However clean -> build the project helped me get rid of it.
Yeah. Android compile version can be higher than the target version. Those two do not have to be the same.
I use the following play services library in my android project. play-services-location,play-services-auth and play-services-gcm. The library are in version 9.2.0.I have the minSdkVersion as 9.
I recently added the VerifyApps API into the project and in order to use that library properly I had to add a new dependency com.google.android.gms:play-services-safetynet:11.6.0. When I added it, android studio asked to enter some class paths in myAndroidManifest file or else I had to improve my minSdkVersion to 14. After adding it some of the functionalities provided by the authAPI started acting up throwing some runtime exceptions in devices running Android 5.0 and above.
I upgraded my Auth and GCM API to version 11.6.0. Android studio again asked me to enter some more class paths in AndroidManifest file. After this the app is working fine but I came across this doc. According to this doc if I am using a play-service version greater than 10.2, my app will not work on devices below 4.0 (Correct me if I am wrong, But a careful look at the wordings lead me to believe that only the support is stopped but existing API calls will work just fine). But I am not using the full play-service dependency in my project I am just the aforementioned 4 libraries, so by adding the suggested entries in the AndroidManifest files should let my app to work just fine in devices below version 4.0 right?
If the functionalities are not fully supported then, is there a list of functionalities that will be affected by upgrading to this version?
You can create a special flavor for older platforms, and use it with an older version of gms. You will deploy the two flavors as split APKs to Play Store.
I am trying to work on a cross-platform mobile app using xamarin with visual studio 2015. However, after downloading what I think was all of android sdk/tool, I am getting the exception from the screenshot.
I read multiple if not most of "cannot load assembly" problems from Googling, but most of them have associated file url/name while I have got none of that.
Really desperate to know if anyone had come across this since this is my first time using visual studio & C#, and I am overwhelmed by the amount of new things I am learning.
Thanks
Aloe
API 24 is not fully supported in the current stable Xamarin release. It is only fully supported on a web Preview. See:
https://developer.xamarin.com/guides/android/platform_features/introduction-to-android-n/ .
So use API 23 instead and I would uninstall API 24.
Also do not use the android sdk build tools version 24 as that has been having issues as well. See:
https://releases.xamarin.com/technical-bulletin-android-sdk-build-tools-24/