software-mansion / react-native-screens

Native navigation primitives for your React Native app.
https://docs.swmansion.com/react-native-screens/
MIT License
3.05k stars 518 forks source link

Fatal Exception java.lang.RuntimeException: Unable to start activity ComponentInfo Unable to instantiate fragment com.swmansion.rnscreens.n #2164

Open MuazzezA opened 5 months ago

MuazzezA commented 5 months ago

Description

I received this error on real devices and could not find a solution.

Steps to reproduce

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{appName/appName.MainActivity}: androidx.fragment.app.Fragment$j: Unable to instantiate fragment com.swmansion.rnscreens.n: calling Fragment constructor caused an exception at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3815) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3977) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:109) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2374) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:233) at android.os.Looper.loop(Looper.java:344) at android.app.ActivityThread.main(ActivityThread.java:8249) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)

   Caused by androidx.fragment.app.Fragment$j: Unable to instantiate fragment com.swmansion.rnscreens.n: calling Fragment constructor caused an exception
   at androidx.fragment.app.Fragment.instantiate(Fragment.java:631)
   at androidx.fragment.app.FragmentContainer.instantiate(FragmentContainer.java:57)
   at androidx.fragment.app.FragmentManager$3.instantiate(FragmentManager.java:483)
   at androidx.fragment.app.FragmentStateManager.<init>(FragmentStateManager.java:85)
   at androidx.fragment.app.FragmentManager.restoreSaveState(FragmentManager.java:2728)
   at androidx.fragment.app.FragmentController.restoreSaveState(FragmentController.java:198)
   at androidx.fragment.app.FragmentActivity$2.onContextAvailable(FragmentActivity.java:149)
   at androidx.activity.contextaware.ContextAwareHelper.dispatchOnContextAvailable(ContextAwareHelper.java:99)
   at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:352)
   at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:273)
   at com.facebook.react.ReactActivity.onCreate(ReactActivity.java:45)
   at com.frontguard.when.MainActivity.onCreate(MainActivity.java:16)

Snack or a link to a repository

link

Screens version

3.20.0

React Native version

0.71.6

Platforms

Android

JavaScript runtime

None

Workflow

React Native (without Expo)

Architecture

None

Build type

Release mode

Device

Real device

Device model

No response

Acknowledgements

Yes

kkafar commented 5 months ago

Looks like omitted installation steps.

MuazzezA commented 5 months ago

But this error does not exist on all prod devices. I cannot implement a native solution because I can only use codepush. However, the current steps are given below.

public class MainActivity extends ReactActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    //NOTE FIX: https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704067
    super.onCreate(null);
    overridePendingTransition(0, 0);
    SplashScreen.show(this, R.style.SplashScreenTheme, true);
}

 // manifest

<activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:screenOrientation="portrait"
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
    android:launchMode="singleTask"
    android:windowSoftInputMode="adjustResize"
    android:exported="true">

There is a question that comes to my mind. Will changing this in the route reduce my errors?

import { createStackNavigator} from '@react-navigation/stack';
to 
import {createNativeStackNavigator} from 'react-native-screens/native-stack';

/* "react-native": "^0.71.6", "@react-navigation/core": "^6.4.6", "@react-navigation/native": "^6.1.6", "@react-navigation/native-stack": "^6.9.8", "@react-navigation/stack": "^6.3.11",

*/

tboba commented 5 months ago

Hi @MuazzezA, I agree that's strange, given the information that you're using activity with all installation steps completed. However, we can't spot any issues with this error, while we're completing installation steps ourself. Could you please provide a minimal repro that will show the same error as yours, so that we could investigate this issue further? Also, what devices are you using on production to test your app?

kkafar commented 5 months ago

There is a question that comes to my mind. Will changing this in the route reduce my errors?

Dunno man :/ Basically change from JS stack to native one (you can also test on @react-navigation/native-stack) should be painless, however you need to keep in mind that some prop have changed their names between stack versions, so most likely you would need to change in few more places.

MuazzezA commented 5 months ago

Hi, First of all I want to share with you all the outputs I have. these came from Firebase Crashlytics. (changed the application name to app) https://pastecode.io/s/g9wgb6fd

(info : 83% of crash events for this issue happened in the first 5 seconds of a user's session) %48 samsung , %26 xiaomi and other devices. and %31 android 14.

I don't get this error, but some of my users do.

joelbrewer commented 4 months ago

This same error appeared in our logs for the first time yesterday. @MuazzezA did you figure out what's going on?

MuazzezA commented 4 months ago

@joelbrewer unfortunately. I haven't found any solution. I don't even know where the error is coming from but I'll let you know when I figure it out.

kkafar commented 4 months ago

Most likely it is this line that throws an error, if it's of any help to you.

MuazzezA commented 4 months ago

@kkafar yes this solution is already in my project but it is not working. i think it is a temporary solution.

oyun0915 commented 4 months ago

Firebase Crashlytics log Screenshot 2024-06-10 at 16 10 26

rishabhHubilo commented 4 months ago

Are there any updates on this error? Facing the same issue.

kkafar commented 4 months ago

I don't have any unfortunately. I want not able to reproduce this crash even once and there is no reproduction provided.

Waiting for repro here

devjta commented 4 months ago

Is there a way, that this bug could actually get fixed for real?

Passing null, basically destroy the whole view history. So on rotating my tablet, the app starts in the main-activity and has removed every RN screen.

And no, I will also not disable configChanges for rotating, as it will break any fold-able phone or putting the app in split-screen.

Edit: https://developer.android.com/reference/android/app/Fragment -> Default constructor. Every fragment must have an empty constructor, so it can be instantiated when restoring its activity's state.

I mean, its since 2018 you are telling people to pass null. Could you actually do it correctly for Android? An empty constructor should work fine and not result in crashing the app.

Also I am not even able, to build react-native screens, so I could try to fix that error somehow.. Should it actually work on Mac OS? Can you make a guide, how to build it?

We need that to be fixed, otherwise people have a horrible usage in fold-able phones and when resizing it on tablets.

And I would even try to take a look at it, but I cannot get it to build.

Ibad9 commented 4 months ago

any update on this.

react-native-screens: 3.32.0 react-native-bootsplash: 5.5.3 react-native: 0.74.2

kkafar commented 4 months ago

@devjta

Taking into account that a minimal reproducible example was not provided and we are not able to reproduce this exact issue on our side, I won't prioritise this issue above any another with actual reproduction. As the library is open source, you can always try to fix the problem yourself (especially that you are able to reproduce it apparently).

Reporting a build issue in the form of "it does not work", also won't enable me to provide you with any help. To play around you could either build one of our example apps or just use the library in your project and edit the code directly. I guess the contributing guide might be helpful here 😄

Our libraries are maintained free of charge by a team with a limited number of people involved, but if you are not happy with the current pace of development and need premium support dedicated for your app, please reach out to us by sending an email to contact@swmansion.com.

devjta commented 4 months ago

@kkafar just DONT PASS null. Your setup guide is basically the problem (SINCE 2018, so much for pace..).

You not implementing an empty constructor of Fragments breaks the Android lifecylce, which I pointed above.

Every fragment has to have an empty constructor. Thats how Android works. I mean, you also have one, where you throw the exception which points to the error from 2018 and the idea of "passing null" to fix it.

I will try tomorrow to run react-native screens localy, but my question anyway was, if it should even work on Mac OS or if Mac OS CMake breaks everything, as this is the build error

Details

``` java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "line" is null java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "line" is null Cannot invoke "String.equals(Object)" because "line" is null * Try: > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. * Exception is: com.intellij.openapi.externalSystem.model.ExternalSystemException: java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "line" is null java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "line" is null Cannot invoke "String.equals(Object)" because "line" is null at com.intellij.gradle.toolingExtension.modelAction.GradleModelFetchAction.addModels(GradleModelFetchAction.java:172) at com.intellij.gradle.toolingExtension.modelAction.GradleModelFetchAction.execute(GradleModelFetchAction.java:67) at org.jetbrains.plugins.gradle.model.ProjectImportAction.doExecute(ProjectImportAction.java:138) at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:91) at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:39) at org.gradle.tooling.internal.consumer.connection.InternalBuildActionAdapter.execute(InternalBuildActionAdapter.java:64) at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.runAction(AbstractClientProvidedBuildActionRunner.java:131) at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.fromBuildModel(AbstractClientProvidedBuildActionRunner.java:104) at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.fromBuildModel(AbstractClientProvidedBuildActionRunner.java:84) at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator.fromBuildModel(DefaultBuildTreeModelCreator.java:57) at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$fromBuildModel$1(DefaultBuildTreeLifecycleController.java:82) at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$runBuild$4(DefaultBuildTreeLifecycleController.java:106) at org.gradle.internal.model.StateTransitionController.lambda$transition$5(StateTransitionController.java:166) at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:247) at org.gradle.internal.model.StateTransitionController.lambda$transition$6(StateTransitionController.java:166) at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:44) at org.gradle.internal.model.StateTransitionController.transition(StateTransitionController.java:166) at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.runBuild(DefaultBuildTreeLifecycleController.java:103) at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.fromBuildModel(DefaultBuildTreeLifecycleController.java:74) at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner.runClientAction(AbstractClientProvidedBuildActionRunner.java:43) at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:53) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.internal.buildtree.ProblemReportingBuildActionRunner.run(ProblemReportingBuildActionRunner.java:49) at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:65) at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:136) at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41) at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.lambda$execute$0(RootBuildLifecycleBuildActionExecutor.java:40) at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:122) at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.execute(RootBuildLifecycleBuildActionExecutor.java:40) at org.gradle.internal.buildtree.DefaultBuildTreeContext.execute(DefaultBuildTreeContext.java:40) at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.lambda$execute$0(BuildTreeLifecycleBuildActionExecutor.java:65) at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:53) at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.execute(BuildTreeLifecycleBuildActionExecutor.java:65) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:61) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:57) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor.execute(RunAsBuildOperationBuildActionExecutor.java:57) at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.lambda$execute$0(RunAsWorkerThreadBuildActionExecutor.java:36) at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249) at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109) at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.execute(RunAsWorkerThreadBuildActionExecutor.java:36) at org.gradle.tooling.internal.provider.continuous.ContinuousBuildActionExecutor.execute(ContinuousBuildActionExecutor.java:110) at org.gradle.tooling.internal.provider.SubscribableBuildActionExecutor.execute(SubscribableBuildActionExecutor.java:64) at org.gradle.internal.session.DefaultBuildSessionContext.execute(DefaultBuildSessionContext.java:46) at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:100) at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:88) at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:69) at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:62) at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:41) at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:63) at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31) at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:52) at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:40) at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47) at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75) at org.gradle.util.internal.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) org.gradle.internal.operations.BuildOperationInvocationException: java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "line" is null at org.gradle.internal.operations.DefaultBuildOperationRunner.throwAsBuildOperationInvocationException(DefaultBuildOperationRunner.java:192) at org.gradle.internal.operations.DefaultBuildOperationRunner.access$100(DefaultBuildOperationRunner.java:24) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:75) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$BuildOperationWrappingBuilder.build(DefaultToolingModelBuilderRegistry.java:334) at org.gradle.internal.build.DefaultBuildToolingModelController$AbstractToolingScope.getModel(DefaultBuildToolingModelController.java:85) at org.gradle.tooling.internal.provider.runner.DefaultBuildController.getModel(DefaultBuildController.java:108) at org.gradle.tooling.internal.consumer.connection.ParameterAwareBuildControllerAdapter.getModel(ParameterAwareBuildControllerAdapter.java:39) at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.getModel(UnparameterizedBuildController.java:113) at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.getModel(NestedActionAwareBuildControllerAdapter.java:31) at org.gradle.tooling.internal.consumer.connection.UnparameterizedBuildController.findModel(UnparameterizedBuildController.java:97) at org.gradle.tooling.internal.consumer.connection.NestedActionAwareBuildControllerAdapter.findModel(NestedActionAwareBuildControllerAdapter.java:31) at com.intellij.gradle.toolingExtension.modelAction.DefaultBuildController.findModel(DefaultBuildController.java:101) at com.android.tools.idea.gradle.project.sync.SyncActionRunnerKt$toMeasuringController$1$findModel$4.invoke(SyncActionRunner.kt:289) at com.android.tools.idea.projectsystem.gradle.sync.Counter.invoke(PerformanceMeasurementUtil.kt:108) at com.android.tools.idea.gradle.project.sync.SyncActionRunnerKt.measure(SyncActionRunner.kt:330) at com.android.tools.idea.gradle.project.sync.SyncActionRunnerKt.access$measure(SyncActionRunner.kt:1) at com.android.tools.idea.gradle.project.sync.SyncActionRunnerKt$toMeasuringController$1.findModel(SyncActionRunner.kt:289) at com.android.tools.idea.gradle.project.sync.ActionToRun$toSafeController$1.findModel(SyncActionRunner.kt:160) at com.android.tools.idea.gradle.project.sync.ModelFetchersKt.findNativeVariantAbiModel(ModelFetchers.kt:141) at com.android.tools.idea.gradle.project.sync.VariantDiscovery$toFetchVariantDependenciesAction$1$1.invoke(VariantDiscovery.kt:210) at com.android.tools.idea.gradle.project.sync.VariantDiscovery$toFetchVariantDependenciesAction$1$1.invoke(VariantDiscovery.kt:199) at com.android.tools.idea.gradle.project.sync.ModelResult$Companion.create(ModelResult.kt:32) at com.android.tools.idea.gradle.project.sync.VariantDiscovery$toFetchVariantDependenciesAction$1.invoke(VariantDiscovery.kt:199) at com.android.tools.idea.gradle.project.sync.VariantDiscovery$toFetchVariantDependenciesAction$1.invoke(VariantDiscovery.kt:194) at com.android.tools.idea.gradle.project.sync.ActionToRun$map$1.invoke(SyncActionRunner.kt:66) at com.android.tools.idea.gradle.project.sync.ActionToRun$map$1.invoke(SyncActionRunner.kt:66) at com.android.tools.idea.gradle.project.sync.ActionToRun.run$intellij_android_projectSystem_gradle_sync(SyncActionRunner.kt:77) at com.android.tools.idea.gradle.project.sync.SyncActionRunner$runActions$1.invoke(SyncActionRunner.kt:223) at com.android.tools.idea.gradle.project.sync.SyncActionRunner$runActions$1.invoke(SyncActionRunner.kt:223) at com.android.tools.idea.gradle.project.sync.SyncActionRunner.runAction(SyncActionRunner.kt:250) at com.android.tools.idea.gradle.project.sync.SyncActionRunner.runActions(SyncActionRunner.kt:223) at com.android.tools.idea.gradle.project.sync.VariantDiscovery.discoverVariantsAndSync(VariantDiscovery.kt:125) at com.android.tools.idea.gradle.project.sync.SyncProjectActionWorker$populateAndroidModels$2.invoke(SyncProjectActionWorker.kt:72) at com.android.tools.idea.gradle.project.sync.SyncProjectActionWorker$populateAndroidModels$2.invoke(SyncProjectActionWorker.kt:58) at com.android.tools.idea.projectsystem.gradle.sync.Counter.invoke(PerformanceMeasurementUtil.kt:108) at com.android.tools.idea.gradle.project.sync.SyncProjectActionWorker.populateAndroidModels(SyncProjectActionWorker.kt:58) at com.android.tools.idea.gradle.project.sync.AndroidExtraModelProviderWorker.populateBuildModels(AndroidExtraModelProviderWorker.kt:100) at com.android.tools.idea.gradle.project.sync.AndroidExtraModelProviderImpl.populateBuildModels(AndroidExtraModelProvider.kt:113) at com.android.tools.idea.gradle.project.sync.AndroidExtraModelProvider.populateBuildModels(AndroidExtraModelProvider.kt:55) at com.intellij.gradle.toolingExtension.modelAction.GradleModelFetchAction.addBuildModels(GradleModelFetchAction.java:207) at com.intellij.gradle.toolingExtension.modelAction.GradleModelFetchAction.lambda$addModels$2(GradleModelFetchAction.java:165) at com.intellij.gradle.toolingExtension.modelAction.GradleModelFetchAction.lambda$forEachModelFetchPhase$1(GradleModelFetchAction.java:153) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(Unknown Source) at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.base/java.util.stream.ReferencePipeline.forEachOrdered(Unknown Source) at com.intellij.gradle.toolingExtension.modelAction.GradleModelFetchAction.forEachModelFetchPhase(GradleModelFetchAction.java:153) at com.intellij.gradle.toolingExtension.modelAction.GradleModelFetchAction.addModels(GradleModelFetchAction.java:158) at com.intellij.gradle.toolingExtension.modelAction.GradleModelFetchAction.execute(GradleModelFetchAction.java:67) at org.jetbrains.plugins.gradle.model.ProjectImportAction.doExecute(ProjectImportAction.java:138) at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:91) at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:39) at org.gradle.tooling.internal.consumer.connection.InternalBuildActionAdapter.execute(InternalBuildActionAdapter.java:64) at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.runAction(AbstractClientProvidedBuildActionRunner.java:131) at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.fromBuildModel(AbstractClientProvidedBuildActionRunner.java:104) at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner$ActionAdapter.fromBuildModel(AbstractClientProvidedBuildActionRunner.java:84) at org.gradle.internal.buildtree.DefaultBuildTreeModelCreator.fromBuildModel(DefaultBuildTreeModelCreator.java:57) at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$fromBuildModel$1(DefaultBuildTreeLifecycleController.java:82) at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$runBuild$4(DefaultBuildTreeLifecycleController.java:106) at org.gradle.internal.model.StateTransitionController.lambda$transition$5(StateTransitionController.java:166) at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:247) at org.gradle.internal.model.StateTransitionController.lambda$transition$6(StateTransitionController.java:166) at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:44) at org.gradle.internal.model.StateTransitionController.transition(StateTransitionController.java:166) at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.runBuild(DefaultBuildTreeLifecycleController.java:103) at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.fromBuildModel(DefaultBuildTreeLifecycleController.java:74) at org.gradle.tooling.internal.provider.runner.AbstractClientProvidedBuildActionRunner.runClientAction(AbstractClientProvidedBuildActionRunner.java:43) at org.gradle.tooling.internal.provider.runner.ClientProvidedPhasedActionRunner.run(ClientProvidedPhasedActionRunner.java:53) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.internal.buildtree.ProblemReportingBuildActionRunner.run(ProblemReportingBuildActionRunner.java:49) at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:65) at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:136) at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41) at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.lambda$execute$0(RootBuildLifecycleBuildActionExecutor.java:40) at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:122) at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.execute(RootBuildLifecycleBuildActionExecutor.java:40) at org.gradle.internal.buildtree.DefaultBuildTreeContext.execute(DefaultBuildTreeContext.java:40) at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.lambda$execute$0(BuildTreeLifecycleBuildActionExecutor.java:65) at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:53) at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.execute(BuildTreeLifecycleBuildActionExecutor.java:65) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:61) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:57) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157) at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59) at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73) at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor.execute(RunAsBuildOperationBuildActionExecutor.java:57) at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.lambda$execute$0(RunAsWorkerThreadBuildActionExecutor.java:36) at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249) at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109) at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.execute(RunAsWorkerThreadBuildActionExecutor.java:36) at org.gradle.tooling.internal.provider.continuous.ContinuousBuildActionExecutor.execute(ContinuousBuildActionExecutor.java:110) at org.gradle.tooling.internal.provider.SubscribableBuildActionExecutor.execute(SubscribableBuildActionExecutor.java:64) at org.gradle.internal.session.DefaultBuildSessionContext.execute(DefaultBuildSessionContext.java:46) at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:100) at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:88) at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:69) at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:62) at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:41) at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:63) at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31) at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:52) at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:40) at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47) at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75) at org.gradle.util.internal.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104) at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "line" is null at java.base/java.util.concurrent.FutureTask.report(Unknown Source) at java.base/java.util.concurrent.FutureTask.get(Unknown Source) at com.android.build.gradle.internal.ide.v2.NativeModelBuilder.generateBuildFilesAndCompileCommandsJson(NativeModelBuilder.kt:156) at com.android.build.gradle.internal.ide.v2.NativeModelBuilder.buildAll(NativeModelBuilder.kt:117) at com.android.build.gradle.internal.ide.v2.NativeModelBuilder.buildAll(NativeModelBuilder.kt:46) at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$BuilderWithParameter.build(DefaultToolingModelBuilderRegistry.java:289) at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$UserCodeAssigningBuilder.lambda$build$0(DefaultToolingModelBuilderRegistry.java:374) at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication.reapply(DefaultUserCodeApplicationContext.java:109) at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$UserCodeAssigningBuilder.build(DefaultToolingModelBuilderRegistry.java:374) at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$LockSingleProjectBuilder.lambda$build$0(DefaultToolingModelBuilderRegistry.java:304) at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$fromMutableState$1(DefaultProjectStateRegistry.java:374) at org.gradle.internal.work.DefaultWorkerLeaseService.withReplacedLocks(DefaultWorkerLeaseService.java:345) at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:374) at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$LockSingleProjectBuilder.build(DefaultToolingModelBuilderRegistry.java:304) at org.gradle.tooling.provider.model.internal.DefaultToolingModelBuilderRegistry$BuildOperationWrappingBuilder$1.call(DefaultToolingModelBuilderRegistry.java:337) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204) at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199) at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66) ... 144 more Caused by: java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "line" is null at com.android.build.gradle.external.cmake.server.ServerProtocolV1.readExpected(ServerProtocolV1.java:519) at com.android.build.gradle.external.cmake.server.ServerProtocolV1.readMessage(ServerProtocolV1.java:547) at com.android.build.gradle.external.cmake.server.ServerProtocolV1.decodeResponse(ServerProtocolV1.java:404) at com.android.build.gradle.external.cmake.server.ServerProtocolV1.decodeResponse(ServerProtocolV1.java:398) at com.android.build.gradle.external.cmake.server.ServerProtocolV1.connect(ServerProtocolV1.java:113) at com.android.build.gradle.tasks.CmakeServerExternalNativeJsonGenerator.executeProcessAndGetOutput(CmakeServerExternalNativeJsonGenerator.kt:154) at com.android.build.gradle.tasks.CmakeServerExternalNativeJsonGenerator.executeProcess(CmakeServerExternalNativeJsonGenerator.kt:94) at com.android.build.gradle.tasks.ExternalNativeJsonGenerator.buildForOneConfiguration(ExternalNativeJsonGenerator.kt:308) at com.android.build.gradle.tasks.ExternalNativeJsonGenerator.access$buildForOneConfiguration(ExternalNativeJsonGenerator.kt:81) at com.android.build.gradle.tasks.ExternalNativeJsonGenerator$getMetadataGenerators$1.call(ExternalNativeJsonGenerator.kt:131) at com.android.build.gradle.tasks.ExternalNativeJsonGenerator$getMetadataGenerators$1.call(ExternalNativeJsonGenerator.kt:81) at com.android.build.gradle.internal.ide.v2.NativeModelBuilder$generateBuildFilesAndCompileCommandsJson$$inlined$map$lambda$1.call(NativeModelBuilder.kt:152) at com.android.build.gradle.internal.ide.v2.NativeModelBuilder$generateBuildFilesAndCompileCommandsJson$$inlined$map$lambda$1.call(NativeModelBuilder.kt:46) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) ... 3 more ```

kkafar commented 4 months ago

my question anyway was, if it should even work on Mac OS or if Mac OS CMake breaks everything, as this is the build error

🤔 CMake is not macOS specific software in any way, so I'm not sure what do you even mean here.

If you want to run react-native-screens on react-native-macos I don't think you can do, as there is no concept of stack on macOS.

If you want to build the library itself on macOS and cross-compile it to a native mobile platform, there should be no problem, as I'm doing this daily.

devjta commented 4 months ago

@kkafar Ok, so it should work fine on Mac OS...

Which version of CMake do you use? And which JDK for the android project? Thanks for the answers :)

I have cmake 3.25.2 installed. Using homebrew. Gradle uses JDK 17.

kkafar commented 4 months ago

@devjta CMake 3.22.1 (bundled together with Android Studio), JDK 17, NDK appropriate for RN version, for 0.74 I believe it is 26.1.