How to build Expo APK local

Loading...

How to build Expo APK local

Is it possible to build the APK of an expo app locally?
The doc says:

If you haven’t used exp before, the first thing you’ll need to do is login with your Expo account using exp login.

I tried exp start, exp build:android but the commands require a login.
I don’t want to build the APK using expo server. Is there a way to run this build locally? So no login and push of source code required?
If not, can I view the whole source code of the generated APK?

Solutions/Answers:

Solution 1:

if you want to generate apk eject the CRNA with npm run eject command. Then you will get android and ios folders suppurate in mac and you will get an only android folder in windows. and follow the instruction which is in a given link below

https://facebook.github.io/react-native/docs/signed-apk-android.html

References

Loading...

React Native : add fragment to mainactivity using Android Native Modules

Loading...

React Native : add fragment to mainactivity using Android Native Modules

I have a specific Android native library to integrate the camera features. The library provides the Fragment with the all it features. I just want to integrate that with Mainactivity in React Native app.
I have followed the link “Add fragment into react-native view”
Also i have gone through many tutorials. But I am stuck up at the place where we add the fragment into the Mainactivity container layout of React native app.
Update:
React Component (JS file):
export default class MyCustomView extends Component {
render() {
return (

{
MyLayout.openBlankFragment(12345)

}

);
}
}
const MyLayout = NativeModules.MyModule;

MyModule (Java Code):
@ReactMethod
private void openBlankFragment(final int viewId) {
// Log.v(“View Tag”, “View ID: “+viewId); it prints tag 12345
UIManagerModule uiManager = getReactApplicationContext().getNativeModule(UIManagerModule.class);

uiManager.addUIBlock(new UIBlock() {
@Override
public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {
View view = nativeViewHierarchyManager.resolveView(viewId);

final Activity activity = getCurrentActivity();
BlankFragment fragment = new BlankFragment();
FragmentTransaction transaction = ((MainActivity)activity).getSupportFragmentManager().beginTransaction();
transaction.add(view.getId(), fragment);
transaction.commit();

}
});
}

view.getId() is not recognized. Need help here. If i set the activity root view id like “transaction.add(android.R.id.content, fragment);”. Its working fine and i can my fragment. But i need to setup my fragment as view in React screen like a frame.

Solutions/Answers:

References

Loading...