Androidx and gradle feature errors after running update - react-native

I returned to a react native project after about a month or two and updated the packages along with all the packaged. However, it seems that in the time since I worked on it there have been some major changes which is now preventing react-native run-android from completing and results in a list of errors which seem related to the camera module, gradle and androidx.
Apologies, I could not paste the error in the post as it exceeds the character limit.
https://hatebin.com/bvsjcldeby
After initializing a new project all seems well so it appears to be something wrong with the configuration of the project itself.
Any help is really appreciated. Thanks in advance.

Google moves from the Support Library to the AndroiX library. So the first one is deprecated.
RN 0.60.X migrates to AndroidX ans so should each of the dependencies that you use. 0.60.X is a major breaking change and the way to solve it could be very wide. You would need to check each of your modules or dependencies that you use and find if they upgrades to use AndroidX. There is also a workaround where you could use Jetifier, which is a tool that will migrate old dependencies to the new AndroidX imports however I found it a little buggy dependening on your project.
My 2 cents right now would be to go to 0.59.8 until all major dependencies have time to upgrade and release their updated versions. Otherwise I think it is too much work right now.
You can see more here: https://facebook.github.io/react-native/blog/2019/07/03/version-60

Related

Outdated React Native Project

I posted this question yesterday, but apparently worded it badly, so I'm trying again.
I'm working on a project that had been closed for a couple of years and reopened. During that time, a large number of the included node_modules have gone out of support (or at least the versions being used), React Native has been updated several times, new rules came out for building iOS projects, etc. leaving the project in a pretty broken state.
The previous team that worked on the project didn't leave much in the way of documentation, and we're stuck figuring out the details on our own.
There are two of us on the UI development, and we're able to build the project as-is using all of the old components. However, as soon as we start upgrading anything, we run into conflicts.
I've spent a good bit of time (several different times combined) trying to find a way to get the upgrade started, but everything I've tried runs into conflicts.
For purposes of clarity, he problems that I encounter include:
npm reports ERESOLVE Unable to resolve dependency tree
many errors (hundreds) come out of the XCode build - version compatibility, not allowed to use deprecated components, legacy build system outdated, conflicting pointer assignments, etc
All tools need to be upgraded (Node, npm, Android Studio, Xcode, React, React Native, Gradle, etc
Is there somewhere I can find an article or tutorial or something with a step-by-step, repeatable process for creating a project from scratch and adding the required components in an orderly way so that I can upgrade the whole process at once?
Also, I know that a lot of open source projects support their products with paid services, but that doesn't appear to be the case with React Native as far as I can tell. Is there somewhere we can find a project / build expert to come in and work with us on this?
Any help would really be appreciated!
Thanks in advance!

How to troubleshoot React Native build error?

Below you can see the output I get when I try to run npx react-native run-android. It suggests some options to try in order to further pinpoint the problem, however they don't work with the aforementioned command so I assume that they are related to a gradle (just an educated guess).
I know ZERO about gradle; I have just seen the name here and there and in the output shown below. So please keep that in mind when you answer. If I need to learn how to run some gradle command(s) directly, please be as verbose as possible in your answer.
The project was working fine just a bit ago, but I wanted the ability to force portrait mode for certain screens but without configuring my entire app to always have to stick to portrait mode. So I found what looked to be a solution in the react-native-orientation-locker module. I installed it with yarn and then proceeded to update files as directed: https://www.npmjs.com/package/react-native-orientation-locker.
After updating the appropriate files, I got an error that suggested axios was the problem. I uninstalled and reinstalled axios. After that didn't work, I proceeded to undo all the file changes I had just made. Then I uninstalled the react-native-orientation-locker module.
To my knowledge, I have undone everything I did between the time the project worked and stopped working.
Sadly, I had not put this into source control yet (a mistake I won't make again), so I can't revert.
Where to go from here?
Problems like this are hard to pin point. What you can do is open the android project in android studio and see the logs as the project is being assembled. I assume you do not have much knowledge about android either so you might need some senior resource to help you.
What I usually do in this case is open android studio and if I am lucky enough, it tells me which file has an issue and I go to the file and do what android studio suggests me. Some times it fixes the problem and sometimes it doesn't.
Another thing I would like to mention is that the documentation of the package you are using is important to follow. I assume you did that already but I would suggest to review it narrowly and closely.
Another guess I can tell you is try to go to your-project/android/build.gradle and over there, you'll see something like this in the start. The package you are using mentions something about target SDK 27. I think you should check that out too. May be it helps
Lastly I would say always use source control while working with react native. It can easily blow up at any time so you should always have a safety net to fallback to :)

How to upgrade Aurelia project from version v0.24.0 to current version v1.2.3

I'm trying to upgrade a very old version of Aurelia CLI project v0.24.0 to the current version v1.2.3. I've tried to follow the steps from this link from the docs but when I try to run it I receive this error:
So my question is what is the best approach to upgrade it from such an old version to the newest one?
Just a screenshot of error is too little info to give proper advice on. And between the currently latest version of v1.2.3 and v0.24.0 (Jan, 2017) there's roughly 3 years. Fun part is, you'd be amazed at relatively how little Aurelia core itself has changed. Simply because a lot remained stable.
Most impactful changes will be in either:
aurelia_project folder, with the build and config routines
bundler config (system.js, webpack, requirejs - whichever you've used)
That being said, this does not necessarily mean that your dependencies have also remained stable in those past three years. Especially in Javascript world. To accommodate for this, I would suggest:
Create a blank, new project with the latest Aurelia CLI
Copy/paste over the /src folder from your old project to your new one
Take in consideration specifics, like package.json from your old project and migrate them by hand (reinstalling) in your new project
Again, try to keep your bundler similar and you will have relatively little changes. But if you choose you want to migrate from System.Js to Webpack, it'll be a bit more hassle. But arguably, rewarding in the end if your project needs to be kept alive for a longer while.
Considering the age of your old project, restarting with a clean setup and config is what I would consider to be "the best way" to retouch only the necessities.

How can I link packages manually after upgrading the react-native version(Some third party packages not updated to podfile)

I am trying to upgrade the react-native version to 0.60. Here how can I link manually the package. (i.e) in androind if we add the packages in Build.gradle it will link manually for that particular package.
Can any one give solution how can we acheive this in iOS link.
Is the xcodeproj will support for the 0.60 and can we able to link manually.
I have tried in the latest version of react-native 0.61.5. But it not worked for me?
Ultimately from RN0.60 onwards, manual linking is not necessary as RN has a mechanism of auto linking.
From my experience of upgrading to RN0.61, I've realized not all the library will be auto linked as expected. Reason being, the *.podspecs is not declared in your podfile. To perform this auto-linking, you need to include the 3rd party library's *.podspec within podfile. Hence during pod install, this *.podspec will tell the system where to grab the library, versions, etc.
I've previously shared a solution related to RN0.61 and *.podpsec. Maybe you can read my solution and try with it, hope it helps!

how to add latest webrtc sources to android project?

So, there is existing webrtc project, that runs on latest libjingle(25dec 2015). And now, for support purpose, I need to update current version to latest from webrtc repo. How can I do that? I see there java files with c++ with headers in separate folders, have no idea what is going on there, even where files that I actually need, and how to implement that source to project. Is there any in-depth guide for that? Have anyone faced this problem before?
WebRTC's project structure have changed a lot since last year. They are deprecating GYP in favor of GN, it is highly recommended to start from the beginning.
You can read the compilation guide for Android there: https://webrtc.org/native-code/android