I have an outdated 32-bit application to react native, now I want to update that application with the latest versions, my question is, I have to work on that application or I can create a new one with the same package name and the same keystore, in such a way that it helps me to update the previous one, I hope you have explained, thanks in advance.
I recently had to upgrade a react native app from 0.49 to the latest, 0.61. There's some tools available, react-native upgrade and react-native-git-upgrade, but I had little luck with either one.
For me the easiest way was performing the update on the current codebase, with the help of RN diff purge: react-native-community/rn-diff-purge
From their README.md :
This repository exposes an untouched React Native app generated with the CLI npx >react-native init RnDiffApp. Each new React Native release causes a new project to >be created, removing the old one, and getting a diff between them. This way, the >diff is always clean, always in sync with the changes of the init template.
For whichever version you're currently at, you can look up the diff of a clean project in that version to whichever other version you'd like to upgrade to. You can check all the changes that happened between those two versions, and apply them to you own project. When I upgraded, I just applied the changes in rn-diff-purge/compare/release0.49.1..release/0.61.5 to my project.
Some things to conider:
If you only need to upgrade react native to be able to get 64 bit builds, it's going to be way less work to update to 0.59 (first version to support 64bit), than to upgrade to 0.60 or later. On version 0.60 they introduced auto-linking, meaning that you no longer need to run react-native link after installing a native dependency, but you'll need to unlink all of your current native dependencies if you don't want to see some "duplicate dependency" errors.
If you do decide to upgrade to 0.60 or later, and you have some dependency that you don't want to unlink (maybe you've added react-native-code-push, and you set the deploymentKey when you initialize the package in your MainApplication.java), you need to add them to the file react-native.config.js (if you don't have one, you should create one at the root of your project). The file should look like this:
module.exports = {
dependencies: {
'react-native-code-push': {
platforms: {
android: null, // disable Android platform, other platforms will still autolink if provided
},
},
},
};
That's all, good luck!
Related
I've upgraded react-native to latest version (0.68) through react-native CLI, and now every time I'm trying to build for android I get this error:
error: cannot find symbol reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
I tried to clean the bundle, made sure my package name is correct (like others issues suggested) and nothing so far..
If you're using the latest version of React Native (i.e: v >= 68), you've to rebuild your projects. it works for me.
Going through react-native migrations file, I've found out that somehow I missed a few migrations related to react-native new architecture (although I would expect it to be automatic when using react-native CLI upgrade command).
I suggest to follow the migrations changes especially on MainActivity.java and MainApplication.java - don't forget to change the "from" and "to" versions to your case:
https://react-native-community.github.io/upgrade-helper/?from=0.65.1&to=0.68.1
After switching our Unity game to Android App Bundle build format,the Branch.IO plugin no longer will initialize (or at least the callback never happens from Branch.initSession) It was working before with apk builds.
I'm using Unity 2019.2.0f1 and version 0.5.13 of the Branch Unity Wrapper
Is this a known issue with Branch? Any ideas what I am missing?
Please make sure that you are not missing any of the below points:
Configure Branch with the prefab (click on "Update iOS Wrapper" & "Update Android Manifest"). Match your Branch prefab inspector as mentioned here.
Make sure to initialise Branch in MonoBehavior file in Start() as mentioned here.
Make sure that the link you are clicking on have the same Branch key as the one you put in your AndroidManifest.xml (you can append ?debug=1 to the link to see more details)
4.Are you using third party plugin? If yes then please resolve it using this documentation:
https://github.com/BranchMetrics/unity-branch-deep-linking-attribution/tree/master/ThirdPartySolutions
Our recommended setup is outlined here, please follow it as closely as possible to avoid confusion:
https://docs.branch.io/pages/apps/unity/#integrate-branch
Here is our "gold standard" example app of a working Branch application with loads of features implemented:
https://github.com/BranchMetrics/unity-branch-deep-linking/tree/master/BranchUnityTestBed
In case you are still facing the issue then feel free to write to support#branch.io.
I'm trying my app on Android Device and when I start the app the dubbuger give me 1 Error and 1 Warning.
The Error is:
Async Storage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '#react-native-community/async-storage' instead of 'react-native'. See https://github.com/react-native-community/react-native-async-storage
and the Warning:
Require cycle:
node_modules/pouchdb-find/node_modules/pouchdb-utils/lib/index-browser.js
-> node_modules/pouchdb-find/node_modules/pouchdb-utils/lib/index-browser.js
Require cycles are allowed, but can result in uninitialized values.
Consider refactoring to remove the need for a cycle.
About the Error, I have follow what it said, I have done:
npm i --save #react-native-community/async-storage;
on my root project folder. And then
react-native link #react-native-community/async-storage
And At the last I have imported this: import AsyncStorage from '#react-native-community/async-storage'; on my project.
But I have always the same error.
How can I solve in your opinion this error and this warning?
Thank you!
The first step its correct and you're installing and linking the project
dependencies into your project.
# Install
$ yarn add #react-native-community/async-storage
# Link
$ react-native link #react-native-community/async-storage
The second step seems correct too.
import AsyncStorage from '#react-native-community/async-storage';
Note: Sometimes the error message comes from how you are storing the data
Can you write this part for me, I'll check the issue ?
For remove yellow warning you can:
To disable the yellow box place console.disableYellowBox = true;
anywhere in your application. Typically in the root file so it will apply to both iOS and Android.
console.ignoredYellowBox = ['Warning: Each', 'Warning: Failed'];
Can you try this ?
import {YellowBox} from 'react-native';
YellowBox.ignoreWarnings(['Warning: Each', 'Warning: Failed']);
AsyncStorage used to be a part of the react-native library, but it is now deprecated. The module was removed from the standard library and is now a part of a separate library called #react-native-community/async-storage.
You did not mention if you are using Expo and you did not mention what version of React Native you are using, but in any case, this is the documentation for it:
https://github.com/react-native-community/async-storage
If you are using RN 60+ you need to undo that link, as RN 60+ now uses autolinking. So you would run: react-native unlink #react-native-community/async-storage per the above documentation.
If you are using react-native-cli and not Expo, you probably also need to do a pod deintegrate and pod install to add
- "RNCAsyncStorage (from `../node_modules/#react-native-community/async-storage`)"
to your Podfile.lock file.
first thing: these messages are warnings and they are safe to ignore in this case
console.disableYellowBox = true;
is your friend.
second: you probably are doing things correctly, but you are not the only one who uses AsyncStorages. Probably some packages inside node_modules are using AsyngStorage too, and they are your source of warning. The only solution to this to get updated packages and/or edit them yourself and remove incorrect imports.
I am learning flutter, and while playing around with flutter's Geolocator 3.0.0 package. I came across an issue that wouldn't let me compile the app as soon as I add the reference to this package in pubspec.yaml file. A quick google search showed me the right github issue. The fix mentioned in the github issue (migrating app to support AndroidX - by updating compileSdkVersion in build.gradle file to 28, and adding android.useAndroidX=true and android.enableJetifier=true in gradle.properties) does work.
Main question: I am not sure if this (migrating project to support AndroidX) will need to be done for all flutter projects explicitly or is there a way to ensure all new flutter projects support AndroidX.
PS:I come from C# background, and I know nearly nothing about android / iOS app development.
You need to explicitly migrate a Flutter app to Android X by using Migrate to AndroidX... button located under Refactor tab of Android Studio. Manual migration is not recommended. If a plugin requires Android X, you need to perform this migration.
For the related article on Flutter.io, see: https://flutter.io/docs/development/packages-and-plugins/androidx-compatibility
Re your main question:
' I am not sure if this (migrating project to support AndroidX) will need to be done for all flutter explicitly or is there a way to ensure all new flutter projects support AndroidX'
I have never found the 'Refactor/Migrate to AndroidX' to work. Not even on new projects. I'm not sure it does anything at all. I always had to do manually even after just creating a new project. I follow the manual instructions but also delete any old versions of gradle in c:/....gradle/wrapper/dists/gradle-???. The current one, and only one to have available is gradle-5.1.1-all.
One developer on my team has some setting in Android Studio that replaces the distributionUrl entry in gradle/wrapper/gradle-wrapper.properties to use the gradle-###-all.zip, while my Android Studio changes it back to gradle-###-bin.zip.
Basically, my diff always looks like:
-distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip
This is annoying. What setting is it, and how do I change it?
gradle-1.12-all.zip file will have binaries, sources, and documentation.
gradle-1.12-bin.zip will have only binaries(That should be enough as you don't need any samples/docs)
If you want to know about gradle wrapper, please check this
http://www.gradle.org/docs/current/userguide/gradle_wrapper.html
If you and the other developer want a uniform experience, place this code in your build.gradle file
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
This will make ./gradlew wrapper --gradle-version 5.6 automatically append -all instead of -bin
For build.gradle.kts:
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}
Like #San said, -all will have binaries, sources, and documentation, while -bin will just have the binaries.
From what I've seen Android Studio recommends to use gradle-*-all.zip and even provides a "quick fix" to change that. On the other hand, the command ./gradlew wrapper sets up the wrapper using gradle-*-bin.zip, overwriting the previous setting. Make sure nobody is calling "./gradlew wrapper" automatically.
The difference is that the -bin version contains only the runtime and no sample code and documentation. 1
It actually makes sense to go for the -bin version: it is smaller and you're unlikely to need the -all version unless you're debugging Gradle scripts. For this reason, the lint warning to go for the -all version has been removed. Also, new projects are generated with the -bin version by default.
There is a ticket to let IntelliJ download the sources when you need them (after which there really isn't a reason for the -all version), but it hasn't been implemented yet.