Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all 29586 articles
Browse latest View live

Command failed: gradlew.bat app:installDebug Error

$
0
0

I am getting an error while running command

react-native run-android

Something is wrong with gradlew.bat file file, but I can't find out what it is. My AVD emulator works fine, java is also in PATH. Anyone can help?Erorr screenshot here


Change background of Android 10 home button area?

$
0
0

I'd like to change the background color of the area that has the home handle on Android 10. My app is built with React Native, if there is a way to do it with some package through that, that would be great. I would also be happy with knowing what to change in the android project files to change the color too. Here is a picture of what I mean:

Picture of android handle on Android 10

How to get current route name in react-navigation?

$
0
0

I want the name of the current route or screen in react-navigation which I want to use inside if condition to make some changes.

How to make photo editor in react native

$
0
0

I'm looking for how to make a photo editor in react native with similar functionality.I need the ability to add stickers, use photo filters, adjust lighting and insert text over the photoPhoto editor

com.android.ddmlib.InstallException: Failed to establish session react-native

$
0
0

I am trying to run react-native android app in my nexus5 emulator

adb devicesList of devices attachedemulator-5554   device

started packager react-native start

running app - react-native run-android

Installing APK 'app-debug.apk' on 'reactnative(AVD) - 6.0'Unable to install examples/android/app/build/outputs/apk/app-debug.apk

com.android.ddmlib.InstallException: Failed to establish session        at com.android.ddmlib.Device.installPackages(Device.java:894)        at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:113)        at com.android.builder.testing.ConnectedDevice$installPackages$0.call(Unknown Source)        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)        at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.groovy:119)        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)        at java.lang.reflect.Method.invoke(Method.java:483)        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:226)

Stop big view (expansion) of notification in tray for Google FCM in React-Native implementation (react-native-firebase)

$
0
0

I'm using Firebase Messaging (FCM) in a React-Native setting.

When the notification is at the top on the tray, it expands by default (Big View). Also, it expands when user tries to expand it.However, there is no way mentioned in the documentation to turn off the expansion / big view. Not even for those notifications which aren't at the top of the tray.

The problem faced by me is the use of image in notification, which is square in shape (cannot use rectangular / landscape images), and gets cropped and looks really awkward.

I may be wrong, but if I've missed some parameter / flag that react-native-firebase provides to be used that can turn off big view, or set bigText to be null, or some other solution so that expansion of notification-item cannot happen, at least when its not on top of the tray.

Console Log is not showing in React-Native

Cordova React App - TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

$
0
0

Since I tried everything that I found recently on StackOverflow and similar sites(react-dev-tools up and downgraded, reinstalled, and so on), I'm gonna open my own thread.

So here is the problem: I work on a React App which is build with Cordova. I can start the app through npm start. My colleague uses the same repository and has no issues.

But every time i try to add the android platform i run into this Error-Message: (iOS platform works perfectly fine, it seems that the bug is only affecting the android side)

The "path" argument must be of type string. Received undefinedTypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined    at validateString (internal/validators.js:117:11)    at Object.join (path.js:1039:7)    at ConfigKeeper_get [as get] (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigKeeper.js:45:26)    at /usr/local/lib/node_modules/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js:346:51    at Array.forEach (<anonymous>)    at is_conflicting (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js:339:17)    at PlatformMunger.add_config_changes (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js:190:33)    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare.js:112:32    at _fulfilled (/Users/rmeier/lv-app/node_modules/q/q.js:854:54)    at /Users/rmeier/lv-app/node_modules/q/q.js:883:30

Here is the cordova info:

cordova-lib@9.0.1 with:  cordova-common@3.2.1  cordova-create@2.0.0  cordova-fetch@2.0.1  cordova-serve@3.0.0Environment:   OS: darwin  Node: v12.16.1  npm: 6.13.4Plugins:  cordova-plugin-androidx  cordova-plugin-androidx-adapter  cordova-plugin-file  cordova-plugin-firebasex  cordova-plugin-network-information  cordova-plugin-splashscreen  cordova-plugin-statusbar  cordova-plugin-whitelist  cordova-plugin-x-socialsharing  cordova-sqlite-ext  es6-promise-plugin

The config.xml:

<?xml version='1.0' encoding='utf-8'?><widget id="censored" version="1.0.10" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android" ><name>censored</name><description>        censored</description><author email="censored" href="censored">        censored</author><content src="index.html" /><plugin name="cordova-plugin-whitelist" spec="1" /><access origin="*" /><allow-intent href="http://*/*" /><allow-intent href="https://*/*" /><allow-intent href="tel:*" /><allow-intent href="sms:*" /><allow-intent href="mailto:*" /><allow-intent href="geo:*" /><preference name="BackgroundColor" value="0x36642a"/><platform name="android"><allow-intent href="market:*" /><edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application"><application android:usesCleartextTraffic="true" /></edit-config><config-file platform="ios" parent="CFBundleDevelopmentRegion" overwrite="true"><string>Germany</string></config-file><icon src="res/android/hdpi.png" /><icon src="res/android/ldpi.png" density="ldpi" /><icon src="res/android/mdpi.png" density="mdpi" /><icon src="res/android/hdpi.png" density="hdpi" /><icon src="res/android/xhdpi.png" density="xhdpi" /><icon src="res/android/xxhdpi.png" density="xxhdpi" /><icon src="res/android/xxxhdpi.png" density="xxxhdpi" /><splash density="port-ldpi" src="res/android/splash-port-ldpi.png"/><splash density="port-mdpi" src="res/android/splash-port-mdpi.png"/><splash density="port-hdpi" src="res/android/splash-port-hdpi.png"/><splash density="port-xhdpi" src="res/android/splash-port-xhdpi.png"/><splash density="port-xxhdpi" src="res/android/splash-port-xxhdpi.png"/><splash density="port-xxxhdpi" src="res/android/splash-port-xxxhdpi.png"/><splash density="land-ldpi" src="res/android/splash-land-ldpi.png"/><splash density="land-mdpi" src="res/android/splash-land-mdpi.png"/><splash density="land-hdpi" src="res/android/splash-land-hdpi.png"/><splash density="land-xhdpi" src="res/android/splash-land-xhdpi.png"/><splash density="land-xxhdpi" src="res/android/splash-land-xxhdpi.png"/><splash density="land-xxxhdpi" src="res/android/splash-land-xxxhdpi.png"/><config-file target="AndroidManifest.xml" parent="/manifest/application"><meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" /></config-file><resource-file src="res/android/mdpi_mono.png" target="app/src/main/res/drawable-mdpi/notification_icon.png" /><resource-file src="res/android/hdpi_mono.png" target="app/src/main/res/drawable-hdpi/notification_icon.png" /><resource-file src="res/android/xhdpi_mono.png" target="app/src/main/res/drawable-xhdpi/notification_icon.png" /><resource-file src="res/android/xxhdpi_mono.png" target="app/src/main/res/drawable-xxhdpi/notification_icon.png" /><resource-file src="res/android/xxxhdpi_mono.png" target="app/src/main/res/drawable-xxxhdpi/notification_icon.png" /><resource-file src="res/android/xxxhdpi_large.png" target="app/src/main/res/drawable-xxxhdpi/notification_icon_large.png" /></platform><platform name="ios"><allow-intent href="itms:*" /><allow-intent href="itms-apps:*" /><preference name="StatusBarBackgroundColor" value="#36642a" /><!-- iOS 8.0+ --><icon src="res/ios/180.png"/><!-- iPhone 6 Plus  --><icon src="res/ios/180.png" width="180" height="180" /><!-- iOS 7.0+ --><!-- iPhone / iPod Touch  --><icon src="res/ios/60.png" width="60" height="60" /><icon src="res/ios/120.png" width="120" height="120" /><!-- iPad --><icon src="res/ios/76.png" width="76" height="76" /><icon src="res/ios/152.png" width="152" height="152" /><!-- iOS 6.1 --><!-- Spotlight Icon --><icon src="res/ios/40.png" width="40" height="40" /><icon src="res/ios/80.png" width="80" height="80" /><!-- iPhone / iPod Touch --><icon src="res/ios/57.png" width="57" height="57" /><icon src="res/ios/114.png" width="114" height="114" /><!-- iPad --><icon src="res/ios/72.png" width="72" height="72" /><icon src="res/ios/144.png" width="144" height="144" /><icon src="res/ios/167.png" height="167" width="167" /><!-- iPhone Spotlight and Settings Icon --><icon src="res/ios/29.png" width="29" height="29" /><icon src="res/ios/58.png" width="58" height="58" /><!-- iPad Spotlight and Settings Icon --><icon src="res/ios/50.png" width="50" height="50" /><icon src="res/ios/100.png" width="100" height="100" /><icon src="res/ios/1024.png" height="1024" width="1024" /><!--  Splash Screen   --><splash src="res/ios/Default@2x~iphone~anyany.png"/><splash src="res/ios/Default@2x~iphone~comany.png"/><splash src="res/ios/Default@3x~iphone~anyany.png"/><splash src="res/ios/Default@3x~iphone~comany.png"/><splash src="res/ios/Default@2x~ipad~anyany.png"/><splash src="res/ios/Default@2x~ipad~comany.png"/></platform></widget>

The package.json:

{"name": "censored","homepage": "./","version": "0.1.0","private": true,"dependencies": {"@babel/core": "7.4.3","@svgr/webpack": "4.1.0","@typescript-eslint/eslint-plugin": "1.6.0","@typescript-eslint/parser": "1.6.0","babel-eslint": "10.0.1","babel-jest": "^24.9.0","babel-loader": "8.0.5","babel-plugin-named-asset-import": "^0.3.4","babel-preset-react-app": "^9.0.2","bootstrap": "^4.3.1","camelcase": "^5.2.0","case-sensitive-paths-webpack-plugin": "2.2.0","cordova": "^9.0.0","cordova-android": "^8.1.0","cordova-ios": "^5.0.1","cordova-plugin-androidx": "1.0.2","cordova-plugin-androidx-adapter": "1.1.0","cordova-plugin-file": "6.0.1","cordova-plugin-firebasex": "6.1.0","cordova-plugin-network-information": "2.0.1","cordova-plugin-splashscreen": "5.0.3","cordova-plugin-statusbar": "^2.4.3","cordova-plugin-x-socialsharing": "^5.6.2","cordova-sqlite-ext": "3.0.0","css-loader": "2.1.1","dotenv": "6.2.0","dotenv-expand": "4.2.0","es6-promise-plugin": "4.2.2","eslint": "^5.16.0","eslint-config-react-app": "^4.0.1","eslint-loader": "2.1.2","eslint-plugin-flowtype": "2.50.1","eslint-plugin-import": "2.16.0","eslint-plugin-jsx-a11y": "6.2.1","eslint-plugin-react": "7.12.4","eslint-plugin-react-hooks": "^1.7.0","file-loader": "3.0.1","fs-extra": "7.0.1","html-webpack-plugin": "4.0.0-beta.5","identity-obj-proxy": "3.0.0","is-wsl": "^1.1.0","jest": "24.7.1","jest-environment-jsdom-fourteen": "0.1.0","jest-resolve": "24.7.1","jest-watch-typeahead": "0.3.0","mini-css-extract-plugin": "0.5.0","onsenui": "^2.10.10","optimize-css-assets-webpack-plugin": "5.0.1","pnp-webpack-plugin": "1.2.1","postcss-flexbugs-fixes": "4.1.0","postcss-loader": "3.0.0","postcss-normalize": "7.0.1","postcss-preset-env": "6.6.0","postcss-safe-parser": "4.0.1","react": "^16.11.0","react-app-polyfill": "^1.0.4","react-bootstrap": "^1.0.0-beta.14","react-datepicker": "^2.9.6","react-dev-utils": "^9.1.0","react-dom": "^16.11.0","react-onsenui": "^1.11.2","resolve": "1.10.0","sass-loader": "7.1.0","semver": "6.0.0","style-loader": "0.23.1","terser-webpack-plugin": "1.2.3","ts-pnp": "1.1.2","typescript": "^3.6.4","url-loader": "1.1.2","webpack": "4.29.6","webpack-dev-server": "3.2.1","webpack-manifest-plugin": "2.0.4","workbox-webpack-plugin": "4.2.0"  },"scripts": {"start": "node scripts/start.js","build": "node scripts/build.js","test": "node scripts/test.js"  },"eslintConfig": {"extends": "react-app"  },"browserslist": {"production": [">0.2%","not dead","not op_mini all"    ],"development": ["last 1 chrome version","last 1 firefox version","last 1 safari version"    ]  },"jest": {"collectCoverageFrom": ["src/**/*.{js,jsx,ts,tsx}","!src/**/*.d.ts"    ],"setupFiles": ["react-app-polyfill/jsdom"    ],"setupFilesAfterEnv": [],"testMatch": ["<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}","<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"    ],"testEnvironment": "jest-environment-jsdom-fourteen","transform": {"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest","^.+\\.css$": "<rootDir>/config/jest/cssTransform.js","^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"    },"transformIgnorePatterns": ["[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$","^.+\\.module\\.(css|sass|scss)$"    ],"modulePaths": [],"moduleNameMapper": {"^react-native$": "react-native-web","^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"    },"moduleFileExtensions": ["web.js","js","web.ts","ts","web.tsx","tsx","json","web.jsx","jsx","node"    ],"watchPlugins": ["jest-watch-typeahead/filename","jest-watch-typeahead/testname"    ]  },"babel": {"presets": ["react-app"    ]  },"devDependencies": {"cordova-plugin-whitelist": "^1.3.4"  },"cordova": {"plugins": {"cordova-plugin-whitelist": {},"cordova-plugin-file": {},"cordova-plugin-network-information": {},"cordova-sqlite-ext": {},"cordova-plugin-splashscreen": {},"cordova-plugin-x-socialsharing": {"ANDROID_SUPPORT_V4_VERSION": "24.1.1+","PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.","PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly."      },"cordova-plugin-statusbar": {},"cordova-plugin-firebasex": {"FIREBASE_ANALYTICS_COLLECTION_ENABLED": "false","FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "false","FIREBASE_CRASHLYTICS_COLLECTION_ENABLED": "false","ANDROID_ICON_ACCENT": "#FF00FFFF","ANDROID_PLAY_SERVICES_TAGMANAGER_VERSION": "17.0.0","ANDROID_FIREBASE_CORE_VERSION": "17.0.0","ANDROID_FIREBASE_MESSAGING_VERSION": "19.0.0","ANDROID_FIREBASE_CONFIG_VERSION": "18.0.0","ANDROID_FIREBASE_PERF_VERSION": "18.0.0","ANDROID_FIREBASE_AUTH_VERSION": "18.0.0","ANDROID_CRASHLYTICS_VERSION": "2.10.1","ANDROID_CRASHLYTICS_NDK_VERSION": "2.1.0","ANDROID_SHORTCUTBADGER_VERSION": "1.1.22"      }    },"platforms": ["ios"    ]  }}

settimeout function is not working in react native when i start app from activity

$
0
0

i am integrating react native application into android application.settimeout function is not working when i start app from android activity.

@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);

    mReactRootView = new ReactRootView(this);    mReactInstanceManager = ReactInstanceManager.builder()            .setApplication(getApplication())            .setBundleAssetName("index.android.bundle")            .setJSMainModulePath("index")            .addPackage(new MainReactPackage())            .setUseDeveloperSupport(BuildConfig.DEBUG)            .setInitialLifecycleState(LifecycleState.RESUMED)            .build();    // The string here (e.g. "YourAndroidApp") has to match    // the string in AppRegistry.registerComponent() in index.js    mReactRootView.startReactApplication(mReactInstanceManager, "YourAndroidApp", null);    setContentView(mReactRootView);}@Overridepublic void invokeDefaultOnBackPressed() {    super.onBackPressed();}

Duplicate files for camera while build app for android react native

$
0
0

I am using react-native-camera and expo-camera in my project. Along with this I am using few firebase features as well.

App is working fine for iOS but not for Android.

After removing firebase classes, I am able to run the app properly in simulator. While creating apk, I am getting following error.

I have to exclude this group from react-native-camera, but I have used latest react-native version. So, it is using auto linking and it's not implemented in build.gradle.

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {    ext {        buildToolsVersion = "29.0.3"        minSdkVersion = 21        compileSdkVersion = 29        targetSdkVersion = 29        supportLibVersion = "29.0.0"        playServicesVersion = "17.0.0" // or find latest version        androidMapsUtilsVersion = "1.2.1"    }    repositories {        google()        jcenter()    }    dependencies {        classpath('com.android.tools.build:gradle:4.0.0')        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files        // Check that you have the Google Services Gradle plugin v4.3.2 or later        // (if not, add it).        classpath 'com.google.gms:google-services:4.3.3'        // Add the Crashlytics Gradle plugin.        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'    }}allprojects {    repositories {        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")        }        maven {            // expo-camera bundles a custom com.google.android:cameraview            url "$rootDir/../node_modules/expo-camera/android/maven"        }        google()        jcenter()        maven { url 'https://www.jitpack.io' }        maven { url "https://maven.google.com" }    }}

android/app/build.gradle

apply plugin: "com.android.application"apply from: '../../node_modules/react-native-unimodules/gradle.groovy'apply plugin: 'com.google.gms.google-services' // Google Services Gradle plugin// Apply the Crashlytics Gradle pluginapply plugin: 'com.google.firebase.crashlytics'apply from: project(':react-native-config').projectDir.getPath() +"/dotenv.gradle"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://facebook.github.io/react-native/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: false,  // clean and rebuild if changing]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 = false/** * 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);project.ext.vectoricons = [        iconFontNames: [ 'MaterialIcons.ttf', 'MaterialCommunityIcons.ttf' ] // Name of the font files you want to copy]apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"android {    compileSdkVersion rootProject.ext.compileSdkVersion    compileOptions {        sourceCompatibility JavaVersion.VERSION_1_8        targetCompatibility JavaVersion.VERSION_1_8    }    defaultConfig {        applicationId "com.rnboilerplate"        minSdkVersion rootProject.ext.minSdkVersion        targetSdkVersion rootProject.ext.targetSdkVersion        versionCode 1        versionName "0.7.1.0"        multiDexEnabled true        missingDimensionStrategy 'react-native-camera', 'general'    }    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 {            storeFile file('rnapp-upload-key.keystore')            storePassword 'RNappkey'            keyAlias 'rnapp-key-alias'            keyPassword 'RNappkey'        }    }    buildTypes {        debug {            signingConfig signingConfigs.debug        }        release {            // Caution! In production, you need to generate your own keystore file.            // see https://facebook.github.io/react-native/docs/signed-apk-android.            signingConfig signingConfigs.debug            signingConfig signingConfigs.release            minifyEnabled enableProguardInReleaseBuilds            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"        }    }    packagingOptions {        pickFirst "lib/armeabi-v7a/libc++_shared.so"        pickFirst "lib/arm64-v8a/libc++_shared.so"        pickFirst "lib/x86/libc++_shared.so"        pickFirst "lib/x86_64/libc++_shared.so"    }    dexOptions {        javaMaxHeapSize "4g"    }    // 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            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 =                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode            }        }    }}dependencies {    implementation fileTree(dir: "libs", include: ["*.jar"])    //noinspection GradleDynamicVersion    def multidex_version = "2.0.1"    implementation "androidx.multidex:multidex:$multidex_version"    implementation "com.facebook.react:react-native:+"  // From node_modules    implementation project(':react-native-config')    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"    implementation project(':react-native-community-netinfo')    addUnimodulesDependencies()    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {      exclude group:'com.facebook.fbjni'    }    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {        exclude group:'com.facebook.flipper'    }    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {        exclude group:'com.facebook.flipper'    }    if (enableHermes) {        def hermesPath = "../../node_modules/hermes-engine/android/";        debugImplementation files(hermesPath +"hermes-debug.aar")        releaseImplementation files(hermesPath +"hermes-release.aar")    } else {        implementation jscFlavor    }    // Recommended: Add the Firebase SDK for Google Analytics.    implementation 'com.google.firebase:firebase-analytics:17.4.3'    // Add the Firebase Crashlytics SDK.    implementation 'com.google.firebase:firebase-crashlytics:17.0.1'    // Add the Firebase SDK for Dynamic Links.    implementation 'com.google.firebase:firebase-dynamic-links:19.1.0'}// Run this once to be able to run the application with BUCK// puts all compile dependencies into folder libs for BUCK to usetask copyDownloadableDepsToLibs(type: Copy) {    from configurations.compile    into 'libs'}apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

Error:

Type com.google.android.cameraview.AspectRatio$1 is defined multiple times: /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/node_modules/react-native-camera/android/build/.transforms/5ebdf9d41dc40332f9b99f153eb9b6a7/classes/classes.dex, /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/android/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes.dexcom.android.tools.r8.CompilationFailedException: Compilation failed to completecom.android.tools.r8.utils.b: Error: /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/node_modules/react-native-camera/android/build/.transforms/5ebdf9d41dc40332f9b99f153eb9b6a7/classes/classes.dex, Type com.google.android.cameraview.AspectRatio$1 is defined multiple times: /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/node_modules/react-native-camera/android/build/.transforms/5ebdf9d41dc40332f9b99f153eb9b6a7/classes/classes.dex, /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/android/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes.dexError: /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/node_modules/react-native-camera/android/build/.transforms/5ebdf9d41dc40332f9b99f153eb9b6a7/classes/classes.dex, Type com.google.android.cameraview.AspectRatio$1 is defined multiple times: /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/node_modules/react-native-camera/android/build/.transforms/5ebdf9d41dc40332f9b99f153eb9b6a7/classes/classes.dex, /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/android/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes.dex

Deferred deep linking in React Native for android

$
0
0

Please, share your expierience in implementing deferred deep linking in React Native for android.I've set deep linking and it works good only if user has installed app. But if hasn't, it would be great to redirect them to Play market... And I can't figure it out how to implement such functionality.Thanks in advance.

Expo standalone android app crashes with face detector error

$
0
0

SDK Version: 38.0.8Platforms(Android/iOS/web/all): Android

Expo standalone android app crashes with face detector error: Illegal argument exception: Invalid image data size

The image shows the error I am getting

<Camera            style={styles.camera}            type={this.state.type}            ratio="16:9"            pictureSize="16:9"            flashMode={Camera.Constants.FlashMode.auto}            onFacesDetected={this.handleFacesDetected}            faceDetectorSettings={{              mode: FaceDetector.Constants.Mode.fast,              detectLandmarks: FaceDetector.Constants.Landmarks.all,              runClassifications:                FaceDetector.Constants.Classifications.all,              tracking: true,            }}

How can I add some kind of error catching to the onFacesDetected function in the camera module.

Running RN View in existing android app gives error Unable to load script

$
0
0

I have integrated existing android app in react native app. When I run using react native cli it opens the app and after clicking a button to open RN view it gives the error Unable to load script Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release (refer image)

If I manually create the index.android.js using command

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

and run the app, it works fine.

Also I can see bundle on this url

http://localhost:8081/index.bundle?platform=android&dev=true&minify=false

Any idea what I am missing on?

Errror

Bundler opens liek this but but on clicking RR, it says No apps connected (refer image)

Metro bundler

Multiple files for cameraview while build app for android react native

$
0
0

I am using react-native-camera and expo-camera in my project. Along with this I am using few firebase features as well.

App is working fine for iOS but not for Android.

After removing firebase classes, I am able to run the app properly in simulator. While creating apk, I am getting following error.

I have to exclude this group from react-native-camera, but I have used latest react-native version. So, it is using auto linking and it's not implemented in build.gradle.

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {    ext {        buildToolsVersion = "29.0.3"        minSdkVersion = 21        compileSdkVersion = 29        targetSdkVersion = 29        supportLibVersion = "29.0.0"        playServicesVersion = "17.0.0" // or find latest version        androidMapsUtilsVersion = "1.2.1"    }    repositories {        google()        jcenter()    }    dependencies {        classpath('com.android.tools.build:gradle:4.0.0')        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files        // Check that you have the Google Services Gradle plugin v4.3.2 or later        // (if not, add it).        classpath 'com.google.gms:google-services:4.3.3'        // Add the Crashlytics Gradle plugin.        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'    }}allprojects {    repositories {        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")        }        maven {            // expo-camera bundles a custom com.google.android:cameraview            url "$rootDir/../node_modules/expo-camera/android/maven"        }        google()        jcenter()        maven { url 'https://www.jitpack.io' }        maven { url "https://maven.google.com" }    }}

android/app/build.gradle

apply plugin: "com.android.application"apply from: '../../node_modules/react-native-unimodules/gradle.groovy'apply plugin: 'com.google.gms.google-services' // Google Services Gradle plugin// Apply the Crashlytics Gradle pluginapply plugin: 'com.google.firebase.crashlytics'apply from: project(':react-native-config').projectDir.getPath() +"/dotenv.gradle"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://facebook.github.io/react-native/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: false,  // clean and rebuild if changing]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 = false/** * 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);project.ext.vectoricons = [        iconFontNames: [ 'MaterialIcons.ttf', 'MaterialCommunityIcons.ttf' ] // Name of the font files you want to copy]apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"android {    compileSdkVersion rootProject.ext.compileSdkVersion    compileOptions {        sourceCompatibility JavaVersion.VERSION_1_8        targetCompatibility JavaVersion.VERSION_1_8    }    defaultConfig {        applicationId "com.rnboilerplate"        minSdkVersion rootProject.ext.minSdkVersion        targetSdkVersion rootProject.ext.targetSdkVersion        versionCode 1        versionName "0.7.1.0"        multiDexEnabled true        missingDimensionStrategy 'react-native-camera', 'general'    }    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 {            storeFile file('rnapp-upload-key.keystore')            storePassword 'RNappkey'            keyAlias 'rnapp-key-alias'            keyPassword 'RNappkey'        }    }    buildTypes {        debug {            signingConfig signingConfigs.debug        }        release {            // Caution! In production, you need to generate your own keystore file.            // see https://facebook.github.io/react-native/docs/signed-apk-android.            signingConfig signingConfigs.debug            signingConfig signingConfigs.release            minifyEnabled enableProguardInReleaseBuilds            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"        }    }    packagingOptions {        pickFirst "lib/armeabi-v7a/libc++_shared.so"        pickFirst "lib/arm64-v8a/libc++_shared.so"        pickFirst "lib/x86/libc++_shared.so"        pickFirst "lib/x86_64/libc++_shared.so"    }    dexOptions {        javaMaxHeapSize "4g"    }    // 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            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 =                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode            }        }    }}dependencies {    implementation fileTree(dir: "libs", include: ["*.jar"])    //noinspection GradleDynamicVersion    def multidex_version = "2.0.1"    implementation "androidx.multidex:multidex:$multidex_version"    implementation "com.facebook.react:react-native:+"  // From node_modules    implementation project(':react-native-config')    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"    implementation project(':react-native-community-netinfo')    addUnimodulesDependencies()    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {      exclude group:'com.facebook.fbjni'    }    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {        exclude group:'com.facebook.flipper'    }    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {        exclude group:'com.facebook.flipper'    }    if (enableHermes) {        def hermesPath = "../../node_modules/hermes-engine/android/";        debugImplementation files(hermesPath +"hermes-debug.aar")        releaseImplementation files(hermesPath +"hermes-release.aar")    } else {        implementation jscFlavor    }    // Recommended: Add the Firebase SDK for Google Analytics.    implementation 'com.google.firebase:firebase-analytics:17.4.3'    // Add the Firebase Crashlytics SDK.    implementation 'com.google.firebase:firebase-crashlytics:17.0.1'    // Add the Firebase SDK for Dynamic Links.    implementation 'com.google.firebase:firebase-dynamic-links:19.1.0'}// Run this once to be able to run the application with BUCK// puts all compile dependencies into folder libs for BUCK to usetask copyDownloadableDepsToLibs(type: Copy) {    from configurations.compile    into 'libs'}apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

Error:

Type com.google.android.cameraview.AspectRatio$1 is defined multiple times: /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/node_modules/react-native-camera/android/build/.transforms/5ebdf9d41dc40332f9b99f153eb9b6a7/classes/classes.dex, /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/android/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes.dexcom.android.tools.r8.CompilationFailedException: Compilation failed to completecom.android.tools.r8.utils.b: Error: /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/node_modules/react-native-camera/android/build/.transforms/5ebdf9d41dc40332f9b99f153eb9b6a7/classes/classes.dex, Type com.google.android.cameraview.AspectRatio$1 is defined multiple times: /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/node_modules/react-native-camera/android/build/.transforms/5ebdf9d41dc40332f9b99f153eb9b6a7/classes/classes.dex, /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/android/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes.dexError: /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/node_modules/react-native-camera/android/build/.transforms/5ebdf9d41dc40332f9b99f153eb9b6a7/classes/classes.dex, Type com.google.android.cameraview.AspectRatio$1 is defined multiple times: /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/node_modules/react-native-camera/android/build/.transforms/5ebdf9d41dc40332f9b99f153eb9b6a7/classes/classes.dex, /Users/smritiibm/Desktop/Projects/ReactNativeAccelerators/reactnativedemo/android/app/build/intermediates/external_libs_dex/release/mergeExtDexRelease/classes.dex

How To Send & Receive Data Over Wifi Without Internet In React-Native

$
0
0

I am developing a game on React-Native that works completely offline without needing internet connection,

The game will be multiplayer 1vs1 game, and players will join via Wifi Hotspot (also known as wifi Direct) The game will also allow users to chat with eachother

and this all should be done without internet by just using the wifi..

I have tried "React-Native-Wifi-Hotspot" but there is no documentation about how to send and receive data

I want to send and receive objects/arrays over wifi hotspot between 2 connected devices. P2P

I have also readed about react-native-wifi-p2p library but it's documentation says that we need a local server or something i am really not sure about how to do that.


How can I show a route map from the current location to some destination (some address) location?

$
0
0

In React Native I am developing a sample application using react-native-maps. It's working fine, but I didn't find out: How can I show RouteMap from the current location to another address or Location?

Here this is my code:

<MapView    ref='map'    style={styles.map}    region={this.state.mapRegion}    showsUserLocation={true}    followUserLocation={true}    zoomEnabled={true}    pitchEnabled={true}    showsCompass={true}    showsBuildings={true}    showsTraffic={true}    showsIndoors={true}    onRegionChange={this.onRegionChange.bind(this)}    onPress={this.onMapPress.bind(this)}>    {this.state.markers.map(marker => (<MapView.Marker                coordinate={{                  latitude:  marker.Latitude  || this.state.lastLat  || region.latitude,                  longitude: marker.Longitude || this.state.lastLong || region.longitude                }}                image = {                 marker.EmergencyService == true ?(                   require('./Imgs/emergencyService.png')):                   (require('./Imgs/regularService.png'))                }                onCalloutPress={() => this.bookDoctorsAppointment(marker)}>                <MyCustomMarkerView marker={marker}  navigator={this.props.navigator}/></MapView.Marker>    ))}</MapView>

Actually in this code I am showed some list of markers, but I don't need the all markers route map... I want only some of the particular markers to the current location.

Here I attached the image I want like this:

Enter image description here

What is the difference between accessible, accessibilityLabel and accessibilityHint properties of Text component in react native?

$
0
0

What is the difference between accessible, accessibilityLabel and accessibilityHint properties of Text component in react native? React native documentation is not enough to understand. Examples would be more appreciated.

Text is getting cut off in android for react native

$
0
0

I am working on React native and I am new to this. I am trying to display text, But, It's showing in an android end of the text ... and not showing complete text. It's only happening in android, working fine in iOS.

I have written following code

<Text    numberOfLines={1}    adjustsFontSizeToFit    minimumFontScale={0.1}    style={labelStyle} //labelStyle nothing I have written></Text>

Can anyone suggest me, where I am doing wrong in the code?

enter image description here

running a react native project on android studio

$
0
0

I've followed exactly the official tutorial on how to configure RN environment this one, every thing seems to be good, but when i created a simple project and tried to run it by react-native run-android i got this error

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.Jetifier found 967 file(s) to forward-jetify. Using 4 workers...info Starting JS server...info Installing the app...> Task :app:mergeDebugResources FAILEDDeprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.Use '--warning-mode all' to show the individual deprecation warnings.See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings7 actionable tasks: 2 executed, 5 up-to-dateFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:mergeDebugResources'.> Multiple task action failures occurred:> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade> AAPT2 aapt2-3.5.3-5435860-linux Daemon #0: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade> AAPT2 aapt2-3.5.3-5435860-linux Daemon #1: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade> AAPT2 aapt2-3.5.3-5435860-linux Daemon #3: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade> AAPT2 aapt2-3.5.3-5435860-linux Daemon #2: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade> AAPT2 aapt2-3.5.3-5435860-linux Daemon #4: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade> AAPT2 aapt2-3.5.3-5435860-linux Daemon #5: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade> AAPT2 aapt2-3.5.3-5435860-linux Daemon #7: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade> AAPT2 aapt2-3.5.3-5435860-linux Daemon #6: AAPT2 is not supported on 32-bit Linux, see supported systems on https://developer.android.com/studio#system-requirements-a-namerequirementsa* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.orgBUILD FAILED in 8serror Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

I did some research and all i found is that the linux os is not compatible, but in my case i have a 64 bit linux, here is my lcpu result

Architecture:        x86_64CPU op-mode(s):      32-bit, 64-bitByte Order:          Little EndianCPU(s):              4On-line CPU(s) list: 0-3Thread(s) per core:  2Core(s) per socket:  2Socket(s):           1NUMA node(s):        1Vendor ID:           GenuineIntelCPU family:          6Model:               142Model name:          Intel(R) Core(TM) i5-7300U CPU @ 2.60GHzStepping:            9CPU MHz:             2625.481CPU max MHz:         3500.0000CPU min MHz:         400.0000BogoMIPS:            5399.81Virtualization:      VT-xL1d cache:           32KL1i cache:           32KL2 cache:            256KL3 cache:            3072KNUMA node0 CPU(s):   0-3

Knowing that my laptop is a company laptop, does that may be the problem ? i have the sudo access though

How to add in app purchase to react native app?

$
0
0

So paid pages in my app, when a user click to open any of these pages i want to run a function to check if the product is purchased and if it's not then buy the product, I have found two packages which are react-native-iap and expo-in-app-purchase but did not find clear instructions on how to achieve the process i need..

const paidPage = async (productId , navTo) => { // PASS THE PRODUCT ID AND A FUNCTION THAT NAVIGATE TO THE PAGE // HERE I WANT TO CHECK IF THE PRODUCT IS PURCHASED, IF YES THEN NAVIGATE TO THE PAGE// IF NO THEN PURCHASE THE PRODUCT }
Viewing all 29586 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>