Skip to content
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

Add support for 0.58 #4639

Closed
jp928 opened this issue Jan 25, 2019 · 19 comments
Closed

Add support for 0.58 #4639

jp928 opened this issue Jan 25, 2019 · 19 comments

Comments

@jp928
Copy link
Contributor

@jp928 jp928 commented Jan 25, 2019

Issue Description

Add support for 0.58

Steps to Reproduce / Code Snippets / Screenshots

yarn install react-native@0.58

then

react-native run-ios

cannot find bundlejs

Environment

  • React Native Navigation version: 2.8.0
  • React Native version: 0.58
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator
@joshperry131

This comment has been minimized.

Copy link

@joshperry131 joshperry131 commented Jan 25, 2019

Hi,

We successfully got the library working on Android today. We only had to make one change in the "utils/NoOpPromise.java" file.

It seems that with 0.58 a change was made to the Promise interface to support rejecting a promise with additional WritableMap arg for extra properties. (https://github.com/facebook/react-native/blob/60b3942389be508935589df41c2a7203922cc5a7/ReactAndroid/src/main/java/com/facebook/react/bridge/Promise.java).

We implemented the new methods in NoOpPromise and it all seemed to compile/build/run correctly.

Here is the NoOpPromise file with the changes we made: https://gist.github.com/joshperry131/84be94ead24f8a70bcf8a544cd5f328f

Still need to give iOS a bash but I hope this helps!

Thanks,
Josh

@fantasywind

This comment has been minimized.

Copy link

@fantasywind fantasywind commented Jan 31, 2019

> Task :app:compileReleaseJavaWithJavac
/Users/me/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0.aar/7284fb1cdd3efb220344a299395446a5/res/values-v28/values-v28.xml:5:5-8:13: AAPT: No resource found that matches the given name (at 'dialogCornerRadius' with value '?android:attr/dialogCornerRadius').


> Task :react-native-navigation:verifyReactNative56ReleaseResources

FAILURE: Build failed with an exception.

It's an issue only when building release assemble, any ways to fix it?

stacktrace

 FAILURE: Build failed with an exception.

 * What went wrong:
 Could not determine the dependencies of task ':app:mergeReleaseAssets'.
 > Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'.
    > Could not resolve project :react-native-navigation.
      Required by:
          project :app
       > Unable to find a matching configuration of project :react-native-navigation:
           - Configuration 'reactNative57_5DebugApiElements':
               - Required RNN.reactNativeVersion 'reactNative57' and found incompatible value 'reactNative57_5'.
               - Required com.android.build.api.attributes.BuildTypeAttr 'release' and found incompatible value 'debug'.
               - Found com.android.build.api.attributes.VariantAttr 'reactNative57_5Debug' but wasn't required.
               - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
               - Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
           - Configuration 'reactNative57_5DebugRuntimeElements':
               - Required RNN.reactNativeVersion 'reactNative57' and found incompatible value 'reactNative57_5'.
               - Required com.android.build.api.attributes.BuildTypeAttr 'release' and found incompatible value 'debug'.
               - Found com.android.build.api.attributes.VariantAttr 'reactNative57_5Debug' but wasn't required.
               - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
               - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.
           - Configuration 'reactNative57_5ReleaseApiElements':
               - Required RNN.reactNativeVersion 'reactNative57' and found incompatible value 'reactNative57_5'.
               - Required com.android.build.api.attributes.BuildTypeAttr 'release' and found compatible value 'release'.
               - Found com.android.build.api.attributes.VariantAttr 'reactNative57_5Release' but wasn't required.
               - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
               - Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
           - Configuration 'reactNative57_5ReleaseRuntimeElements':
               - Required RNN.reactNativeVersion 'reactNative57' and found incompatible value 'reactNative57_5'.
               - Required com.android.build.api.attributes.BuildTypeAttr 'release' and found compatible value 'release'.
               - Found com.android.build.api.attributes.VariantAttr 'reactNative57_5Release' but wasn't required.
               - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
               - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.

 * Try:
  Run with --scan to get full insights.

 * Exception is:
 org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':app:mergeReleaseAssets'.
   at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:62)
   at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.addToTaskGraph(DefaultTaskExecutionPlan.java:179)
   at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.addTasks(DefaultTaskGraphExecuter.java:113)
   at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:47)
   at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
   at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$000(DefaultBuildConfigurationActionExecuter.java:25)
   at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.proceed(DefaultBuildConfigurationActionExecuter.java:54)
   at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:44)
   at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
   at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$000(DefaultBuildConfigurationActionExecuter.java:25)
   at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.proceed(DefaultBuildConfigurationActionExecuter.java:54)
   at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:47)
   at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
   at org.gradle.execution.DefaultBuildConfigurationActionExecuter.select(DefaultBuildConfigurationActionExecuter.java:36)
   at org.gradle.initialization.DefaultGradleLauncher$CalculateTaskGraph.run(DefaultGradleLauncher.java:286)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
   at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
   at org.gradle.initialization.DefaultGradleLauncher.constructTaskGraph(DefaultGradleLauncher.java:181)
   at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:136)
   at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:115)
   at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
   at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
   at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
   at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:38)
   at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
   at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
   at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
   at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
   at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
   at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.run(RunAsBuildOperationBuildActionRunner.java:45)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
   at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
   at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
   at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:42)
   at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
   at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
   at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
   at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
   at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
   at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
   at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
   at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:61)
   at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34)
   at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
   at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
   at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
   at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
   at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
   at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
   at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
   at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
   at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:46)
   at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
   at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
   at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
   at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
   at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
   at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
   at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
   at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
   at org.gradle.util.Swapper.swap(Swapper.java:38)
   at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
   at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
   at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
   at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
   at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
   at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
   at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
   at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
   at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
   at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
   at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
   at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
 Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all task dependencies for configuration ':app:releaseRuntimeClasspath'.
   at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:995)
   at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1700(DefaultConfiguration.java:121)
   at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationTaskDependency.visitDependencies(DefaultConfiguration.java:1386)
   at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext$TaskGraphImpl.getNodeValues(CachingTaskDependencyResolveContext.java:89)
   at org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmpyEdges.getNodeValues(CachingDirectedGraphWalker.java:211)
   at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:121)
   at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:73)
   at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.doGetDependencies(CachingTaskDependencyResolveContext.java:76)
   at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:60)
   ... 84 more
 Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve project :react-native-navigation.
 Required by:
     project :app
   at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.calculateTargetConfigurations(EdgeState.java:141)
   at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.attachToTargetConfigurations(EdgeState.java:96)
   at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.attachToTargetRevisionsSerially(DependencyGraphBuilder.java:386)
   at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolveEdges(DependencyGraphBuilder.java:196)
   at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:149)
   at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:118)
   at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver.resolve(DefaultArtifactDependencyResolver.java:92)
   at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolveBuildDependencies(DefaultConfigurationResolver.java:124)
   at org.gradle.api.internal.artifacts.ivyservice.ShortCircuitEmptyConfigurationResolver.resolveBuildDependencies(ShortCircuitEmptyConfigurationResolver.java:67)
   at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.resolveBuildDependencies(ErrorHandlingConfigurationResolver.java:55)
   at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationTaskDependency.visitDependencies(DefaultConfiguration.java:1367)
   ... 90 more
 Caused by: org.gradle.internal.component.NoMatchingConfigurationSelectionException: Unable to find a matching configuration of project :react-native-navigation:
   - Configuration 'reactNative57_5DebugApiElements':
       - Required RNN.reactNativeVersion 'reactNative57' and found incompatible value 'reactNative57_5'.
       - Required com.android.build.api.attributes.BuildTypeAttr 'release' and found incompatible value 'debug'.
       - Found com.android.build.api.attributes.VariantAttr 'reactNative57_5Debug' but wasn't required.
       - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
       - Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
   - Configuration 'reactNative57_5DebugRuntimeElements':
       - Required RNN.reactNativeVersion 'reactNative57' and found incompatible value 'reactNative57_5'.
       - Required com.android.build.api.attributes.BuildTypeAttr 'release' and found incompatible value 'debug'.
       - Found com.android.build.api.attributes.VariantAttr 'reactNative57_5Debug' but wasn't required.
       - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
       - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.
   - Configuration 'reactNative57_5ReleaseApiElements':
       - Required RNN.reactNativeVersion 'reactNative57' and found incompatible value 'reactNative57_5'.
       - Required com.android.build.api.attributes.BuildTypeAttr 'release' and found compatible value 'release'.
       - Found com.android.build.api.attributes.VariantAttr 'reactNative57_5Release' but wasn't required.
       - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
       - Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
   - Configuration 'reactNative57_5ReleaseRuntimeElements':
       - Required RNN.reactNativeVersion 'reactNative57' and found incompatible value 'reactNative57_5'.
       - Required com.android.build.api.attributes.BuildTypeAttr 'release' and found compatible value 'release'.
       - Found com.android.build.api.attributes.VariantAttr 'reactNative57_5Release' but wasn't required.
       - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
       - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.
   at org.gradle.internal.component.model.AttributeConfigurationSelector.selectConfigurationUsingAttributeMatching(AttributeConfigurationSelector.java:43)
   at org.gradle.internal.component.model.LocalComponentDependencyMetadata.selectConfigurations(LocalComponentDependencyMetadata.java:111)
   at org.gradle.internal.component.local.model.DslOriginDependencyMetadataWrapper.selectConfigurations(DslOriginDependencyMetadataWrapper.java:58)
   at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.calculateTargetConfigurations(EdgeState.java:138)
   ... 100 more


 * Get more help at https://help.gradle.org

 BUILD FAILED in 2s
@jp928

This comment has been minimized.

@fantasywind

This comment has been minimized.

Copy link

@fantasywind fantasywind commented Jan 31, 2019

@jp928 I already tried to ignore reactNative56 / reactNative57 but still failed. Only ignore all versions included reactNative57_5 will be ok. But the MainApplication cannot import the class.

It only happened on execute ./gradlew assembleRelease but react-native run-android work perfectly.

My build.gradle is follows:

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 19
        compileSdkVersion = 28
        targetSdkVersion = 27
        supportLibVersion = "28.0.0"
        googlePlayServicesAuthVersion = "15.0.1"
        androidMapsUtilsVersion = "0.5+"
    }
    repositories {
        google()
        mavenLocal()
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.0.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenLocal()
        mavenCentral()
        jcenter()
        maven { url "$rootDir/../node_modules/react-native/android" }
        maven { url "https://jitpack.io" }
        maven { url "https://maven.google.com" }
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

task wrapper(type: Wrapper) {
    gradleVersion = '4.7'
    distributionUrl = distributionUrl.replace("bin", "all")
}

subprojects { subproject ->
    afterEvaluate {
        if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                variantFilter { variant ->
                    def names = variant.flavors*.name
                    if (names.contains("reactNative51")
                      || names.contains("reactNative55")
                      || names.contains("reactNative56")
                      || names.contains("reactNative57")) {
                        setIgnore(true)
                    }
                }
            }
        }
    }
}

app/build.gradle

apply plugin: "com.android.application"

import com.android.build.OutputFile

project.ext.react = [
    entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

def enableSeparateBuildPerCPUArchitecture = false

def enableProguardInReleaseBuilds = false


android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId "com.company.app."
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57"
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a"
        }
    }
    signingConfigs {
      release
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
            def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }
}

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support' && requested.name != 'multidex-instrumentation' && requested.name != 'multidex') {
            details.useVersion "${rootProject.ext.supportLibVersion}"
        }
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:design:${rootProject.ext.supportLibVersion}"
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
    implementation project(':react-native-navigation')
    implementation project(':react-native-fbsdk')
    implementation (project(':react-native-google-signin')) {
      exclude group: 'com.google.android.gms', module: 'play-services-tasks'
      exclude group: 'com.google.android.gms', module: 'play-services-basement'
    }
    implementation "com.google.android.gms:play-services-base:${rootProject.ext.googlePlayServicesAuthVersion}"
    implementation project(':mapbox-react-native-mapbox-gl') {
      implementation ('com.squareup.okhttp3:okhttp:3.6.0') {
        force = true
      }
    }
    implementation project(':react-native-svg')
    implementation (project(':react-native-geolocation-service')) {
      exclude group: 'com.google.android.gms', module: 'play-services-location'
    }
    implementation "com.google.android.gms:play-services-location:${rootProject.ext.googlePlayServicesAuthVersion}"
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

// Load Keystores
def keystoreFile = rootProject.file('keystore.properties');
def props = new Properties();

if (keystoreFile.canRead()) {
  props.load(new FileInputStream(keystoreFile));

  if (props != null) {
    android.signingConfigs.release.storeFile file(props.KEYSTORE_FILE);
    android.signingConfigs.release.storePassword props.KEYSTORE_PASSWORD;
    android.signingConfigs.release.keyAlias props.KEYSTORE_ALIAS;
    android.signingConfigs.release.keyPassword props.KEYSTORE_ALIAS_PASSWORD;
  }
}

Thanks for helping

@jp928

This comment has been minimized.

Copy link
Contributor Author

@jp928 jp928 commented Jan 31, 2019

@fantasywind
I haven't tried your build.gradle but I just realise you ignored RN57 flavour as well. I don't think RRN community has built a flavour with RN58. So possibly solution might be keep the flavour with RN57.

@fantasywind

This comment has been minimized.

Copy link

@fantasywind fantasywind commented Feb 1, 2019

Hi, @jp928

RNN Community had a reactNative57_5 version for RN versions after 0.57.5, so the compile worked. Also, I tried remove ignore of 57 flavour, doesn’t work, unfortunately :(

Thanks u again

@magnudae

This comment has been minimized.

Copy link

@magnudae magnudae commented Feb 4, 2019

@joshperry131 Is altering utils/NoOpPromise.java a valid longterm solution?
Wondering if it should be PRed and integrated so it could be a more robust fix for other.

EDIT: Does the altering break in older versions of RN?

@hackdie

This comment has been minimized.

Copy link

@hackdie hackdie commented Feb 5, 2019

do we have any update on this?

@LRNZ09

This comment has been minimized.

Copy link

@LRNZ09 LRNZ09 commented Feb 6, 2019

I'm also having this issue on 2.9.0

@wesleyguirra

This comment has been minimized.

Copy link

@wesleyguirra wesleyguirra commented Feb 6, 2019

same issue

@garfiaslopez

This comment has been minimized.

Copy link

@garfiaslopez garfiaslopez commented Feb 6, 2019

Same here 😭

@denieler

This comment has been minimized.

Copy link

@denieler denieler commented Feb 9, 2019

I have this issue with 2.10.0

@guyca

This comment has been minimized.

Copy link
Collaborator

@guyca guyca commented Feb 10, 2019

Version 2.11.0 supports RN 0.58.x

@guyca guyca closed this Feb 10, 2019
@EskelCz

This comment has been minimized.

Copy link

@EskelCz EskelCz commented Feb 20, 2019

@guyca I'm confused, I don't see flavor 58 in the build.gradle code, only 57 and 57_5 which seem to translate to the same config. Why is there 57_5 then and why not the new 58?

I'm just following installation docs and don't know how what to use.

@guyca

This comment has been minimized.

Copy link
Collaborator

@guyca guyca commented Feb 21, 2019

From the documentation:

`reactNative57_5 - RN 0.57.5 and above

@Nourdinait

This comment has been minimized.

Copy link

@Nourdinait Nourdinait commented Mar 18, 2019

Is support added for IOS? I can't get it to work on IOS. I followed all the steps but i'm getting an error saying "Application BFApp has not been registered"

@krookten14

This comment has been minimized.

Copy link

@krookten14 krookten14 commented Mar 31, 2019

I downgraded my react-native-navigation to 2.11.0 for my react-native 0.58. but still got the same error and I can't seem to find my NoOpPromise.java in my /utils folder. Please I really need some help. I only followed the installation. Thank you so much for people with good heart!

@dhamdani666

This comment has been minimized.

Copy link

@dhamdani666 dhamdani666 commented Jul 7, 2019

hi all , im using react-native-navigation 2.11.0 and react-native version 0.58.3 why pushing screen not work ?

Navigation.push(this.props.componentId, {
component: {
name: 'Home',
}
});

@jp928

This comment has been minimized.

Copy link
Contributor Author

@jp928 jp928 commented Jul 8, 2019

@dhamdani666

Did you register the screen 'Home'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.