Run the following in your terminal and copy the results here.
npx react-native --version
: 4.13.0npx react-native info
:SDK version : 10.0.18363.1198
Target Platform Version(s):
Desktop
Target Device(s):
Visual Studio 2019
Visual Studio Version:
Debug
Build Configuration:
-->x64
Follow the instructions on https://microsoft.github.io/react-native-windows/docs/native-modules-setup#creating-a-new-native-module-library-project, to create new native module library.
Try to Build It
Building the project should succeed, instead this is the result:
@jonthysell @dannyvv does this look familiar?
@getuliovdmnaweb : I was able to get things to build with this change (which is present in the template, I'm curious if you may have undone this change locally or if we are creating the project wrongly on some older version...?)
namespace MyLibrary
{
- public sealed class ReactPackageProvider : IReactPackageProvider
+ public sealed partial class ReactPackageProvider : IReactPackageProvider
{
public void CreatePackage(IReactPackageBuilder packageBuilder)
{
packageBuilder.AddAttributedModules();
}
+ partial void CreatePackageImplementation(IReactPackageBuilder p);
}
}
Environment
Run the following in your terminal and copy the results here.
npx react-native --version
: 4.13.0npx react-native info
:
- SDK version : 10.0.18363.1198
- Target Platform Version(s):
Desktop- Target Device(s):
Visual Studio 2019- Visual Studio Version:
Debug- Build Configuration:
-->x64Steps To Reproduce
- Follow the instructions on https://microsoft.github.io/react-native-windows/docs/native-modules-setup#creating-a-new-native-module-library-project, to create new native module library.
- Try to Build It
Expected Results
Building the project should succeed, instead this is the result:
link to a repository:
I have the same in project from scratch (https://microsoft.github.io/react-native-windows/docs/getting-started) when build in console, see screenshot ManagedCodGen.jpg. When build via VisualStudio all ok, but when app starting I got crash, see screenshot crashWhenStarting.jpg.
VisualStudio version - 16.8.1
npm version - 6.14.8
node versio - v14.15.1
Dependecies:
"dependencies": {
"react": "16.13.1",
"react-native": "0.63.2",
"react-native-windows": "^0.63.0-0"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/runtime": "^7.8.4",
"@react-native-community/eslint-config": "^1.1.0",
"babel-jest": "^25.1.0",
"eslint": "^6.5.1",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.13.1"
},
@getuliovdmnaweb : I was able to get things to build with this change (which is present in the template, I'm curious if you may have undone this change locally or if we are creating the project wrongly on some older version...?)
namespace MyLibrary { - public sealed class ReactPackageProvider : IReactPackageProvider + public sealed partial class ReactPackageProvider : IReactPackageProvider { public void CreatePackage(IReactPackageBuilder packageBuilder) { packageBuilder.AddAttributedModules(); } + partial void CreatePackageImplementation(IReactPackageBuilder p); } }
I have this changes, but still can't build app via console and get crash when app starting in build via VS see my message above.
@tarasvakulka your issue seems unrelated to the issue being discussed here, please file a new issue.
Most helpful comment
@getuliovdmnaweb : I was able to get things to build with this change (which is present in the template, I'm curious if you may have undone this change locally or if we are creating the project wrongly on some older version...?)