Skip to content

Commit 6f67a69

Browse files
committed
Got a successful build on android
Had to go through all the files on the example repo 1 by 1 to see what was wrong, JSI_EXPORT. There were 3 key errors 1. Added JSI_EXPORT to hand-written cpp interfaces 2. Include "Props.h" instead of <react/renderer/components/navigationreactnative/Props.h> 3. Removed libraries from codegenConfig in package.json These each took me ages to spot
1 parent 41573b0 commit 6f67a69

14 files changed

+40
-40
lines changed

NavigationReactNative/src/cpp/react/renderer/components/navigationreactnative/ComponentDescriptors.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
#pragma once
1212

13-
#include <react/renderer/components/navigationreactnative/ShadowNodes.h>
13+
#include "ShadowNodes.h"
1414
#include <react/renderer/core/ConcreteComponentDescriptor.h>
15-
#include <NVActionBarShadowNode.h>
16-
#include <NVBarButtonShadowNode.h>
17-
#include <NVSearchBarShadowNode.h>
18-
#include <NVTabBarItemShadowNode.h>
19-
#include <NVTitleBarShadowNode.h>
15+
#include "NVActionBarShadowNode.h"
16+
#include "NVBarButtonShadowNode.h"
17+
#include "NVSearchBarShadowNode.h"
18+
#include "NVTabBarItemShadowNode.h"
19+
#include "NVTitleBarShadowNode.h"
2020

2121
namespace facebook {
2222
namespace react {

NavigationReactNative/src/cpp/react/renderer/components/navigationreactnative/EventEmitters.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @generated by codegen project: GenerateEventEmitterCpp.js
99
*/
1010

11-
#include <react/renderer/components/navigationreactnative/EventEmitters.h>
11+
#include "EventEmitters.h"
1212

1313
namespace facebook {
1414
namespace react {

NavigationReactNative/src/cpp/react/renderer/components/navigationreactnative/NVActionBarShadowNode.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#pragma once
22

33
#include "NVActionBarState.h"
4-
#include <react/renderer/components/navigationreactnative/EventEmitters.h>
5-
#include <react/renderer/components/navigationreactnative/Props.h>
4+
#include "EventEmitters.h"
5+
#include "Props.h"
66
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
77

88
namespace facebook {
99
namespace react {
1010

11-
extern const char NVActionBarComponentName[];
11+
JSI_EXPORT extern const char NVActionBarComponentName[];
1212

13-
class NVActionBarShadowNode final : public ConcreteViewShadowNode<
13+
class JSI_EXPORT NVActionBarShadowNode final : public ConcreteViewShadowNode<
1414
NVActionBarComponentName,
1515
NVActionBarProps,
1616
NVActionBarEventEmitter,

NavigationReactNative/src/cpp/react/renderer/components/navigationreactnative/NVActionBarState.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace facebook {
1414
namespace react {
1515

16-
class NVActionBarState final {
16+
class JSI_EXPORT NVActionBarState final {
1717
public:
1818
using Shared = std::shared_ptr<const NVActionBarState>;
1919

NavigationReactNative/src/cpp/react/renderer/components/navigationreactnative/NVBarButtonShadowNode.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
#include "NVBarButtonState.h"
44
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
5-
#include <react/renderer/components/navigationreactnative/EventEmitters.h>
6-
#include <react/renderer/components/navigationreactnative/Props.h>
5+
#include "EventEmitters.h"
6+
#include "Props.h"
77
#include <react/renderer/imagemanager/ImageManager.h>
88

99
namespace facebook {
1010
namespace react {
1111

12-
extern const char NVBarButtonComponentName[];
12+
JSI_EXPORT extern const char NVBarButtonComponentName[];
1313

14-
class NVBarButtonShadowNode final: public ConcreteViewShadowNode<
14+
class JSI_EXPORT NVBarButtonShadowNode final: public ConcreteViewShadowNode<
1515
NVBarButtonComponentName,
1616
NVBarButtonProps,
1717
NVBarButtonEventEmitter,

NavigationReactNative/src/cpp/react/renderer/components/navigationreactnative/NVSearchBarShadowNode.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#pragma once
22

33
#include "NVSearchBarState.h"
4-
#include <react/renderer/components/navigationreactnative/EventEmitters.h>
5-
#include <react/renderer/components/navigationreactnative/Props.h>
4+
#include "EventEmitters.h"
5+
#include "Props.h"
66
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
77

88
namespace facebook {
99
namespace react {
1010

11-
extern const char NVSearchBarComponentName[];
11+
JSI_EXPORT extern const char NVSearchBarComponentName[];
1212

13-
class NVSearchBarShadowNode final : public ConcreteViewShadowNode<
13+
class JSI_EXPORT NVSearchBarShadowNode final : public ConcreteViewShadowNode<
1414
NVSearchBarComponentName,
1515
NVSearchBarProps,
1616
NVSearchBarEventEmitter,

NavigationReactNative/src/cpp/react/renderer/components/navigationreactnative/NVSearchBarState.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace facebook {
1414
namespace react {
1515

16-
class NVSearchBarState final {
16+
class JSI_EXPORT NVSearchBarState final {
1717
public:
1818
using Shared = std::shared_ptr<const NVSearchBarState>;
1919

NavigationReactNative/src/cpp/react/renderer/components/navigationreactnative/NVTabBarItemShadowNode.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
#include "NVTabBarItemState.h"
44
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
5-
#include <react/renderer/components/navigationreactnative/EventEmitters.h>
6-
#include <react/renderer/components/navigationreactnative/Props.h>
5+
#include "EventEmitters.h"
6+
#include "Props.h"
77
#include <react/renderer/imagemanager/ImageManager.h>
88

99
namespace facebook {
1010
namespace react {
1111

12-
extern const char NVTabBarItemComponentName[];
12+
JSI_EXPORT extern const char NVTabBarItemComponentName[];
1313

14-
class NVTabBarItemShadowNode final: public ConcreteViewShadowNode<
14+
class JSI_EXPORT NVTabBarItemShadowNode final: public ConcreteViewShadowNode<
1515
NVTabBarItemComponentName,
1616
NVTabBarItemProps,
1717
NVTabBarItemEventEmitter,

NavigationReactNative/src/cpp/react/renderer/components/navigationreactnative/NVTitleBarShadowNode.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#pragma once
22

33
#include "NVTitleBarState.h"
4-
#include <react/renderer/components/navigationreactnative/EventEmitters.h>
5-
#include <react/renderer/components/navigationreactnative/Props.h>
4+
#include "EventEmitters.h"
5+
#include "Props.h"
66
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
77

88
namespace facebook {
99
namespace react {
1010

11-
extern const char NVTitleBarComponentName[];
11+
JSI_EXPORT extern const char NVTitleBarComponentName[];
1212

13-
class NVTitleBarShadowNode final : public ConcreteViewShadowNode<
13+
class JSI_EXPORT NVTitleBarShadowNode final : public ConcreteViewShadowNode<
1414
NVTitleBarComponentName,
1515
NVTitleBarProps,
1616
NVTitleBarEventEmitter,

NavigationReactNative/src/cpp/react/renderer/components/navigationreactnative/NVTitleBarState.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
namespace facebook {
1414
namespace react {
1515

16-
class NVTitleBarState final {
16+
class JSI_EXPORT NVTitleBarState final {
1717
public:
1818
using Shared = std::shared_ptr<const NVTitleBarState>;
1919

NavigationReactNative/src/cpp/react/renderer/components/navigationreactnative/Props.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @generated by codegen project: GeneratePropsCpp.js
99
*/
1010

11-
#include <react/renderer/components/navigationreactnative/Props.h>
11+
#include "Props.h"
1212
#include <react/renderer/components/image/conversions.h>
1313
#include <react/renderer/core/PropsParserContext.h>
1414
#include <react/renderer/core/propsConversions.h>

NavigationReactNative/src/cpp/react/renderer/components/navigationreactnative/ShadowNodes.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
#pragma once
1212

13-
#include <react/renderer/components/navigationreactnative/EventEmitters.h>
14-
#include <react/renderer/components/navigationreactnative/Props.h>
13+
#include "EventEmitters.h"
14+
#include "Props.h"
1515
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
1616
#include <jsi/jsi.h>
1717

NavigationReactNative/src/react-native.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ module.exports = {
2727
'NVTitleBarComponentDescriptor',
2828
'NVToolbarComponentDescriptor',
2929
],
30-
androidMkPath: "../cpp/Android.mk"
30+
cmakeListsPath: "../cpp/CMakeLists.txt",
31+
libraryName: "navigationreactnative"
3132
},
3233
},
3334
},

build/npm/navigation-react-native/package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@
2121
"react-native": "*"
2222
},
2323
"codegenConfig": {
24-
"libraries": [
25-
{
26-
"name": "navigationreactnative",
27-
"type": "all",
28-
"jsSrcsDir": "."
24+
"name": "navigationreactnative",
25+
"type": "all",
26+
"jsSrcsDir": ".",
27+
"android": {
28+
"javaPackageName": "com.navigation.reactnative"
2929
}
30-
]
3130
},
3231
"author": "Graham Mendick",
3332
"license": "Apache-2.0",

0 commit comments

Comments
 (0)