GithubHelp home page GithubHelp logo

Comments (10)

migueldaipre avatar migueldaipre commented on April 28, 2024 1

Please add a minimal reproducer.

from react-navigation.

github-actions avatar github-actions commented on April 28, 2024

Hey @Giebmeyer! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro.

The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue.

You can provide a repro using any of the following:

A snack link is preferred since it's the easiest way to both create and share a repro. If it's not possible to create a repro using a snack, link to a GitHub repo under your username is a good alternative. Don't link to a branch or specific file etc. as it won't be detected.

Try to keep the repro as small as possible by narrowing down the minimal amount of code needed to reproduce the issue. Don't link to your entire project or a project containing code unrelated to the issue. See "How to create a Minimal, Reproducible Example" for more information.

You can edit your original issue to include a link to the repro, or leave it as a comment. The issue will be closed automatically after a while if you don't provide a repro.

from react-navigation.

github-actions avatar github-actions commented on April 28, 2024

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • @react-navigation/native (found: 6.1.3, latest: 6.1.17)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

from react-navigation.

Giebmeyer avatar Giebmeyer commented on April 28, 2024

REPRODUTOR MINIMO:

index.js:

import 'react-native-reanimated';
import { AppRegistry } from 'react-native';
import App from './src/App';
import { name as appName } from './app.json';

AppRegistry.registerComponent(appName, () => App);

App.tsx (Já tentei mudar para .js para ver se alterada o resultado, mas sem sucesso):


import * as React from 'react';
import { Button, View } from 'react-native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { NavigationContainer } from '@react-navigation/native';

function HomeScreen({ navigation }) {
  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Button onPress={() => navigation.navigate('Notifications')} title="Go to notifications" />
    </View>
  );
}

function NotificationsScreen({ navigation }) {
  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Button onPress={() => navigation.goBack()} title="Go back home" />
    </View>
  );
}

const Drawer = createDrawerNavigator();

export default function App() {
  return (
    <NavigationContainer>
      <Drawer.Navigator initialRouteName="Home">
        <Drawer.Screen name="Home" component={HomeScreen} />
        <Drawer.Screen name="Notifications" component={NotificationsScreen} />
      </Drawer.Navigator>
    </NavigationContainer>
  );
}

babel.config.js:

module.exports = { presets: ['module:metro-react-native-babel-preset'], plugins: [['react-native-reanimated/plugin'], ['react-native-worklets-core/plugin']], };
build.gradle:

`
buildscript {
ext {
googlePlayServicesVersion = "+" // default: "+"
firebaseMessagingVersion = "21.1.0" // default: "21.1.0"
buildToolsVersion = '33.0.0'
minSdkVersion = 26
compileSdkVersion = 33
targetSdkVersion = 33
ndkVersion = '23.1.7779620'
kotlin_version = '1.7.1'

    VisionCameraCodeScanner_targetSdkVersion = 31
    VisionCameraCodeScanner_compileSdkVersion = 31
}
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath("com.android.tools.build:gradle:7.3.1")
    classpath('org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20')
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

}

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

build.gralde (app):

`apply plugin: 'com.android.application'
apply plugin: "com.facebook.react"

def archiveBuildTypes = ["release", "debug"];
def distFolder = "\\10.1.1.110\Arquivos\Atualizacoes\vsApp"
def appName = "vsApp"

import com.android.build.OutputFile

/**

  • The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
  • and bundleReleaseJsAndAssets).
  • These basically call react-native bundle with the correct arguments during the Android build
  • cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
  • bundle directly from the development server. Below you can see all the possible configurations
  • and their defaults. If you decide to add a configuration block, make sure to add it before the
  • apply from: "../../node_modules/react-native/react.gradle" line.
  • project.ext.react = [
  • // the name of the generated asset file containing your JS bundle
  • bundleAssetName: "index.android.bundle",
  • // the entry file for bundle generation. If none specified and
  • // "index.android.js" exists, it will be used. Otherwise "index.js" is
  • // default. Can be overridden with ENTRY_FILE environment variable.
  • entryFile: "index.android.js",
  • // https://reactnative.dev/docs/performance#enable-the-ram-format
  • bundleCommand: "ram-bundle",
  • // whether to bundle JS and assets in debug mode
  • bundleInDebug: false,
  • // whether to bundle JS and assets in release mode
  • bundleInRelease: true,
  • // whether to bundle JS and assets in another build variant (if configured).
  • // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
  • // The configuration property can be in the following formats
  • // 'bundleIn${productFlavor}${buildType}'
  • // 'bundleIn${buildType}'
  • // bundleInFreeDebug: true,
  • // bundleInPaidRelease: true,
  • // bundleInBeta: true,
  • // whether to disable dev mode in custom build variants (by default only disabled in release)
  • // for example: to disable dev mode in the staging build type (if configured)
  • devDisabledInStaging: true,
  • // The configuration property can be in the following formats
  • // 'devDisabledIn${productFlavor}${buildType}'
  • // 'devDisabledIn${buildType}'
  • // the root of your project, i.e. where "package.json" lives
  • root: "../../",
  • // where to put the JS bundle asset in debug mode
  • jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
  • // where to put the JS bundle asset in release mode
  • jsBundleDirRelease: "$buildDir/intermediates/assets/release",
  • // where to put drawable resources / React Native assets, e.g. the ones you use via
  • // require('./image.png')), in debug mode
  • resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
  • // where to put drawable resources / React Native assets, e.g. the ones you use via
  • // require('./image.png')), in release mode
  • resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
  • // by default the gradle tasks are skipped if none of the JS files or assets change; this means
  • // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
  • // date; if you have any other folders that you want to ignore for performance reasons (gradle
  • // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
  • // for example, you might want to remove it from here.
  • inputExcludes: ["android/", "ios/"],
  • // override which node gets called and with what additional arguments
  • nodeExecutableAndArgs: ["node"],
  • // supply additional arguments to the packager
  • extraPackagerArgs: []
  • ]
    */

project.ext.react = [
enableHermes: true, // clean and rebuild if changing
]

project.ext.reanimated = [
buildFromSource: true
]

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

/**

  • Set this to true to create two separate APKs instead of one:
    • An APK that only works on ARM devices
    • An APK that only works on x86 devices
  • The advantage is the size of the APK is reduced by about 4MB.
  • Upload all the APKs to the Play Store and people will download
  • the correct one based on the CPU architecture of their device.
    */
    def enableSeparateBuildPerCPUArchitecture = false

/**

  • Run Proguard to shrink the Java bytecode in release builds.
    */
    def enableProguardInReleaseBuilds = true

/**

  • The preferred build flavor of JavaScriptCore.
  • For example, to use the international variant, you can use:
  • def jscFlavor = 'org.webkit:android-jsc-intl:+'
  • The international variant includes ICU i18n library and necessary data
  • allowing to use e.g. Date.toLocaleString and String.localeCompare that
  • give correct results when using with locales other than en-US. Note that
  • this variant is about 6MiB larger per architecture than default.
    */
    def jscFlavor = 'org.webkit:android-jsc:+'

/**

  • Whether to enable the Hermes VM.
  • This should be set on project.ext.react and mirrored here. If it is not set
  • on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
  • and the benefits of using Hermes will therefore be sharply reduced.
    */
    def enableHermes = project.ext.react.get('enableHermes', false)

/**

  • Architectures to build native code for in debug.
    */
    def nativeArchitectures = project.getProperties().get('reactNativeDebugArchitectures')

android {
ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
    applicationId 'br.inf.visualsoftware.vsapp'
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 231
    versionName '3.3.3.1'
    missingDimensionStrategy 'react-native-camera', 'general'
    missingDimensionStrategy 'react-native-camera', 'mlkit'
}
splits {
    abi {
  reset()
  enable enableSeparateBuildPerCPUArchitecture
  universalApk false  // If true, also generate a universal APK
  include 'armeabi-v7a', 'x86', 'arm64-v8a', 'x86_64'
    }
}
signingConfigs {
    debug {
  storeFile file('debug.keystore')
  storePassword 'android'
  keyAlias 'androiddebugkey'
  keyPassword 'android'
    }
     release {
        if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
            storeFile file(MYAPP_UPLOAD_STORE_FILE)
            storePassword MYAPP_UPLOAD_STORE_PASSWORD
            keyAlias MYAPP_UPLOAD_KEY_ALIAS
            keyPassword MYAPP_UPLOAD_KEY_PASSWORD
        }
    }
}
buildTypes {
    debug {
  signingConfig signingConfigs.debug
  if (nativeArchitectures) {
    ndk {
      abiFilters nativeArchitectures.split(',')
    }
  }
    }
    release {
  // Caution! In production, you need to generate your own keystore file.
  // see https://reactnative.dev/docs/signed-apk-android.
  signingConfig signingConfigs.debug
  minifyEnabled enableProguardInReleaseBuilds
  proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  signingConfig signingConfigs.release
    }
}

applicationVariants.all { variant ->
    variant.outputs.all { output ->
        if (variant.buildType.name in archiveBuildTypes) {
                String name = "vsApp-${defaultConfig.versionName}.apk"
                outputFileName = new File(name)

            def taskSuffix = variant.name.capitalize()
            def assembleTaskName = "assemble${taskSuffix}"

            if (tasks.findByName(assembleTaskName)) {
                def copyAPKFolderTask = tasks.create(name: "archive${taskSuffix}", type: org.gradle.api.tasks.Copy) {
                    def sourceFolder = "$buildDir/outputs/apk/${output.baseName.replace("-", "/")}"
                    def destinationFolder = "$distFolder"

                    print "Copying APK folder from: $sourceFolder into $destinationFolder\n"

                    from(sourceFolder)
                    into destinationFolder
                    eachFile { file ->
                        file.path = file.name 
                    }
                    includeEmptyDirs = false
                }
                tasks[assembleTaskName].finalizedBy = [copyAPKFolderTask]
            }
        }
    }
}

// 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:
  // https://developer.android.com/studio/build/configure-apk-splits.html
  // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
  def versionCodes = ['armeabi-v7a': 1, 'x86': 2, 'arm64-v8a': 3, 'x86_64': 4]
  def abi = output.getFilter(OutputFile.ABI)
  if (abi != null) {  // null for the universal-debug, universal-release variants
    output.versionCodeOverride =
                    defaultConfig.versionCode * 1000 + versionCodes.get(abi)
  }
    }
}
// dexOptions {
// incremental true
// javaMaxHeapSize '4g'
// }

packagingOptions {
    pickFirst 'lib/x86/libc++_shared.so'
    pickFirst 'lib/x86_64/libjsc.so'
    pickFirst 'lib/arm64-v8a/libjsc.so'
    pickFirst 'lib/arm64-v8a/libc++_shared.so'
    pickFirst 'lib/x86_64/libc++_shared.so'
    pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}

}

dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation 'com.github.mwiede:jsch:0.1.62'
implementation project(':watermelondb')
implementation "com.facebook.react:react-android"
implementation "com.facebook.react:hermes-android"
implementation 'com.google.mlkit:barcode-scanning:17.2.0'

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
    exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
if (hermesEnabled.toBoolean()) {
    implementation("com.facebook.react:hermes-android")
} else {
    implementation jscFlavor
}

}

// 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.implementation
into 'libs'
}

apply from: file('../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle'); applyNativeModulesAppBuildGradle(project)
`

MainActivity.java:

`package br.inf.visualsoftware.vsapp;

import com.facebook.react.ReactActivity;
import android.os.Bundle;

public class MainActivity extends ReactActivity {
/**

  • Returns the name of the main component registered from JavaScript. This is used to schedule
  • rendering of the component.
    */
    @OverRide
    protected String getMainComponentName() {
    return "vsApp";
    }

@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}
}
`

MainApplication.java:

`package br.inf.visualsoftware.vsapp;

import com.facebook.react.bridge.JSIModulePackage;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.rnfs.RNFSPackage;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
import com.nozbe.watermelondb.WatermelonDBPackage;
import com.zoontek.rnpermissions.RNPermissionsPackage;
import com.horcrux.svg.SvgPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;`

from react-navigation.

Giebmeyer avatar Giebmeyer commented on April 28, 2024

Please add a minimal reproducer.

Adicionado no comentário acima.

from react-navigation.

migueldaipre avatar migueldaipre commented on April 28, 2024

Please add a minimal reproducer.

Adicionado no comentário acima.

Add a GitHub repo link or expo snack.

from react-navigation.

Giebmeyer avatar Giebmeyer commented on April 28, 2024

Please add a minimal reproducer.

Adicionado no comentário acima.

Add a GitHub repo link or expo snack.

The project is private and for-profit.

Furthermore, I can't import it into expo snack because not all dependencies are not compatible with expo.

Is there any other way?

from react-navigation.

migueldaipre avatar migueldaipre commented on April 28, 2024

Please add a minimal reproducer.

Adicionado no comentário acima.

Add a GitHub repo link or expo snack.

The project is private and for-profit.

Furthermore, I can't import it into expo snack because not all dependencies are not compatible with expo.

Is there any other way?

Create a new github project with your comment above.

from react-navigation.

Giebmeyer avatar Giebmeyer commented on April 28, 2024

Ajustado.

\android\app\build.gradle

project.ext.react = [
enableHermes: false, // changed to 'false'
]

from react-navigation.

github-actions avatar github-actions commented on April 28, 2024

Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro.

from react-navigation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.