-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RN v0.60 autolinking compatibility #613
Comments
Hello @thymikee, First of all, I want to thank you and your team for opening this issue. We really appreciate the heads up of a breaking change like this. React Native community is awesome. We have been looking into supporting RN v0.60 autolinking since v0.60.0-rc.0 was out. We did some initial investigation and came up with a plan to support to v0.60. TODOs for autolinking with App Center RN SDK:
Regarding your concerns,
Luckily this won't be a problem for us. We can use
Yes we are aware of the lack of postlink hooks. I totally agree with your comment (react-native-community/cli#429 (comment)) that postlink scripts bring inconsistent developer experience and they are often misused as a hack or workaround. I am personally in favor of getting rid of postlink script from App Center RN SDK for simplicity in the future. Hopefully we can move towards that direction soon. Lastly, I have a question for you @thymikee,
How do you disable autolinking in v0.60? Thanks, |
Thank you for such a welcoming response!
I'm so happy you've found a way to simplify Android configs to work with autolinking. Janic have done something similar recently for
For now it's only possible from the user side (to disable from library config we'd need to adjust some things, but it's not impossible), per package or per package's platform. Here's an example (a PR waiting to be merged): https://github.com/react-native-community/cli/pull/444/files#diff-e170f7cfd11ce7d2abb04a47b02a4caa. It basically looks like the config I provided in original post.
This looks legit. If you'd like to keep some parts of the scripts that really make sense from the ease of use perspective, you can always provide a Regarding removing |
👋 everyone - RN 0.60.0 is out, is there any estimate on when a compatible version of appcenter will be out? EDIT: |
Thanks @kelset. We are actively working on the support of RN 0.60.0. The ETA is our SDK July release. Will share more information once we are ready for the release. |
Hi guys, updating from the RN 0.57 to RN 0.60 here, lots of fun. Could you please tell, is it possible to add appcenter on top of the fresh RN 0.60.3 install? Or should I wait for July release? My steps:
Also, there is neither |
@AndriiChubariev You'll also need to adjust the MainApplication.java: @Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
+ packages.add(new AppCenterReactNativeCrashesPackage(MainApplication.this, getResources().getString(R.string.appCenterCrashes_whenToSendCrashes)));
+ packages.add(new AppCenterReactNativeAnalyticsPackage(MainApplication.this, getResources().getString(R.string.appCenterAnalytics_whenToEnableAnalytics)));
+ packages.add(new AppCenterReactNativePackage(MainApplication.this));
return packages;
} Then you can disable linking for appcenter and related libs: #613 (comment) |
Hi @thymikee I tried above suggestions and I am getting below error
|
@vinaypuppal once you hit that (provided the library is linked properly as it was before, with gradle imports etc), you need to disable autolinking on android for this lib: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library // react-native.config.js
module.exports = {
dependencies: {
'appcenter': {
platforms: { android: null },
},
// ...and the rest of appcenter libs
},
}; |
For people reading this in the near future -- this works. Ulink, relink on android only then add the .config.js file Don't make the mistake I did and make it |
Hello everyone, Thanks for the patience. App Center RN SDK v2.2.0 (https://github.com/microsoft/appcenter-sdk-react-native/releases/tag/2.2.0) is released with RN v0.60 support. Please check it out and let us know if you still run into issues with v0.60 integration. |
App Center RN SDK documentation will be updated very soon. The super-short version of how to integrate App Center SDK,
|
Am just starting to integrate the SDK into my app. my package.json got the latest :
did a
I dont see any analytics data in the dashboard though. I might be missing something. |
I ran |
@Alewex you could try |
@Alewex I want to share something I found out while updating to RN .60 It's true,
I have been able to build on iOS my problem was Android, hopefully this update solves it |
@LuisRodriguezLD Man, you've saved me hours, thanks a lot 🙇 |
What does y'alls |
@bobber205 I recommend you try this tool my friend. There, you can compare your react native version and the one you want to upgrade to. Depending your latest version, one of the latest changes in the AppDelegate.m file is the use of a bridge:
|
I was thinking more along the lines of the AppCenter includes in AppDelegate.m That's where my current errors lie. |
Either one of these fails now
back from the manual linking days. Without any reference though I just get
etc |
@bobber205 Mine just looks like this.
|
Couple of things I've noticed: Forgot to add I took out all reference to app center in AppDelegate.m and it's compiling now. But when my app boots up I get
So strange. Anyone know if the docs are up to date now? |
From reading #287 it looks like this is because I am not calling |
@dhei I'm trying to integrate App Center with a new RN 0.60.4 project. I've installed packages through npm and installed the pods for iOS. But how do I configure my app secrets in the new workflow? The |
I got my AppCenter 2.2.0 running on react-native 0.60.4. My AppDelegate.m look like before
This far I've only run my app in the simulator and it works without errors. @dylinmaust What I've done is to add it manually. Don't know if it's correct though but hey, it works :). Follow 3.2.4 this part of the documentation |
@dylinmaust Great thing to point out! I wonder if it's worthing trying to link the package(s) just to generate those files then unlink them? |
Your suspicion is correct: https://docs.microsoft.com/en-us/appcenter/sdk/getting-started/react-native#31-integrate-the-sdk-automatically-for-react-native-060 the config files need to manually created on RN 0.60. |
This issue will now be closed as the SDK was updated to implement the feature request. |
Thank you @guperrot! |
Description
Hi! I'm one of the maintainers of https://github.com/react-native-community/cli and one of the biggest features we ship in 0.60 is autolinking.
tl;dr: autolinking makes installing native packages as easy as running
yarn add
ornpm install
. It works by discovering native modules through CLI, passing them to native build tools scripts (CocoaPods and Gradle) and constructing the native imports/definitions automatically during build/installation time. The automatic handling comes with some constraints and assumptions, that we try to make true for most of the packages.Details
We'd really like Appcenter to work with it, however there are some blockers:
AppCenterReactNativePackage
takesMainApplication.this
argument, which is now not available. Is it possible for you to restructure the app entry to have no arguments passed through constructor? (on a side note: passing params in constructor may also cause problems in future TurboModules).postlink
/prelink
hooks are not compatible with autolinking approach and we're not providing support for it. If there are any extra steps expected from users (e.g. creating config files), they need to be documented and applied manually.It's also possible to use legacy
react-native link
and to disable autolinking (it's turned on by default in 0.60) throughreact-native.config.js
on the user side:Please let me know your thoughts and possible paths forward. Thanks!
The text was updated successfully, but these errors were encountered: