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

Firebase signup with phone and email and then set password at first login

$
0
0

I have a mobile app with user signup by email and password working correctly. I want to change it as mentioned below.


I want to signup a user with his email and phone number without specifying the password. This is done by a system admin. Then at the first signing in, the user should be able to do a phone auth and then set the password. Do firebase support this? If yes, can someone point me out how to do it?


How to integrate @2x @3x images to React Native Project (Both Android & IOS)?

$
0
0

I had added the same image's versions (@2x @3x)into src>asssets to work our platform in all devices. Here is the problem, VSCode only recognizes i.e path.png (it doesnt recognize @2x and @3x). How can we deal with this problem?

Error: Map already consumed - React Native

$
0
0

Basically I am connecting native android module with react native and passing information from native to js.

try {
    WritableMap params = new WritableNativeMap();
    params.putInt("connectionStatus", 2);
    sendEvent(mreactContext, "bleConnectionStatus", params);
    promise.resolve(params);
} catch (Exception exe) {
    Log.d(TAG, "Exception--: " + exe);
    promise.reject(exe);
}

It is showing exception

Exception--: com.facebook.react.bridge.ObjectAlreadyConsumedException: Map already consumed

Note : I have already gone through this answer ObjectAlreadyConsumedException: Receiving map already consumed but it seems it was about ordering a line. I have written code in that order only still shows exception.

Couldn't start project on Android: Error running adb: adb: failed to run abb_exec. Error: closed adb: connect error for write: closed

$
0
0

Getting this error while trying to run react-native app on emulator through expo.

Couldn't start project on Android: Error running adb: adb: failed to run abb_exec. 
Error: closed adb: connect error for write: closed

How to resolve this ?

React-Native assembleRelease fails for task ':app:bundleReleaseJsAndAssets'

$
0
0

When I run ./gradlew assembleRelease build is failed with this error:

Error:Execution failed for task ':app:bundleReleaseJsAndAssets. 
> A problem occurred starting process 'command 'node'

I searched on the internet and found some topics about it, but I couldn't solve my problem.

React-Native version: 0.54.0

EDIT:
Now I'm running ./gradlew assembleRelease --info from the terminal instead of Android Studio and I get different error.
Here is the result:

> Task :app:processReleaseResources
Putting task artifact state for task ':app:processReleaseResources' into context took 0.007 secs.
file or directory '**/android/app/libs', not found
file or directory '**/node_modules/appcenter-crashes/android/libs', not found
file or directory '**/node_modules/appcenter-analytics/android/libs', not found
file or directory '**/node_modules/appcenter/android/libs', not found
file or directory '**/node_modules/react-native-interactable/lib/android/libs', not found
file or directory '**/node_modules/react-native-navigation/android/app/libs', not found
file or directory '**/android/app/libs', not found
file or directory '**/node_modules/appcenter-crashes/android/libs', not found
file or directory '**/appcenter-analytics/android/libs', not found
file or directory '**/node_modules/appcenter/android/libs', not found
file or directory '**/node_modules/react-native-interactable/lib/android/libs', not found
file or directory '**/node_modules/react-native-navigation/android/app/libs', not found
Executing task ':app:processReleaseResources' (up-to-date check took 0.035 secs) due to:
  Task has failed previously.
All input files are considered out-of-date for incremental task ':app:processReleaseResources'.
Unable do incremental execution: full task run
file or directory '**/android/app/libs', not found
file or directory '**/node_modules/appcenter-crashes/android/libs', not found
file or directory '**/node_modules/appcenter-analytics/android/libs', not found
file or directory '**/node_modules/appcenter/android/libs', not found
file or directory '**/node_modules/react-native-interactable/lib/android/libs', not found
file or directory '**/node_modules/react-native-navigation/android/app/libs', not found
file or directory '**/android/app/libs', not found
file or directory '**/node_modules/appcenter-crashes/android/libs', not found
file or directory '**/node_modules/appcenter-analytics/android/libs', not found
file or directory '**/node_modules/appcenter/android/libs', not found
file or directory '**/node_modules/react-native-interactable/lib/android/libs', not found
file or directory '**/node_modules/react-native-navigation/android/app/libs', not found
Aapt2QueuedResourceProcessor is using **/Android/sdk/build-tools/26.0.2/aapt2
Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
*
*
*
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> Failed to execute aapt


It seems gradle is looking for libs folder in all modules, but there are no libs folders in the node modules. It's true, but I don't know why gradle is looking for libs folder.

Cmd/React Native can't detect my JAVA_HOME environment variables

$
0
0

I'm trying to create a React Native app for Android. I use bash from the command line in Windows 10. I browse to the location of my React Native project and then run "react-native run-android". But then I get an error like this:

$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
/bin/sh: 1: adb: not found
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...

ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.


error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
    at checkExecSyncError (child_process.js:601:13)
    at execFileSync (child_process.js:621:13)
    at runOnAllDevices (/mnt/c/users/lenovo/documents/repositories/upself rn/upself/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

TL;DR it tells me to set the environment variable for JAVA_HOME. AFAIK.

The problem is I've already set the JAVA_HOME since I installed the Windows 10 in my laptop which was months ago. I use JDK 12 and have developed few native Android app using Android Studio using this same laptop and never have I encountered any missing JAVA_HOME issue.

This is what I've tried to try to solve this issue:

  • Run the cmd as administrator

  • Set the JAVA_HOME to c:\Program Files\Java\jdk-12.0.2\ and the one in Android Studio default SDK location C:\Users\lenovo\AppData\Local\Android\Sdk. Both dont work.

  • Restart my laptop and cmd (done it multiple times but it still doesnt work).

  • Put a quotation mark between the path (found this in a stack overflow question).

I've read many questions in stack overflow but none of those works.

So, could anyone help me to solve this problem? Why is it unable to detect the environment path?

Scroll View not working on android pixel simulator, but its working on ios devices and simulator

$
0
0
    return (
    <View style={{
        flexGrow: 1,
        flex: 1,
        height: Dimensions.get('window').height,
        flexDirection: 'column',
    }}> 
    <ScrollView horizontal={false} contentContainerStyle={{flexGrow: 1}} >

        {<View style={{
            flex: 1
        }}>
            <LocationPicker navigation={this.props.navigation} onLocationPicked={this.locationPickedHandler}/>
        </View>}
        </ScrollView>
    </View>);```

I have tried setting height, flex: 1, flexGrow: 1 everything but hard luck

Can anyone please help me in fixing this issue?

How to get ReactContext in a Android Service?

$
0
0

I want to start my service from ReactNative code. Here is the module I use to bridge.

public class HeartbeatModule extends ReactContextBaseJavaModule {
    public static final String REACT_CLASS = "Heartbeat";
    private static ReactApplicationContext reactContext;

    public HeartbeatModule(@Nonnull ReactApplicationContext reactContext) {
      super(reactContext);
      this.reactContext = reactContext;
    }

    @Nonnull
    @Override
    public String getName() {
      return REACT_CLASS;
    }

    @ReactMethod
     public void startService() {
     // Starting the heartbeat service

     this.reactContext.startService(new Intent(this.reactContext, HeartbeatService.class));
     }


    @ReactMethod
    public void stopService() {
        // Starting the heartbeat service

        this.reactContext.stopService(new Intent(this.reactContext, HeartbeatService.class));
    }
}

My question is how can I access this reactContext in my service. And how to sustain it when the service restarts.


React Native - Get file content

$
0
0

I am using react native and expo. I edit the app.json so any time I open local file from the device (click on the file) with "play" extension it open my app. The file contains text. This is some of my app.json:

"android": {
      "package": "com.myapp",
      "intentFilters": [
        {
          "action": "VIEW",
          "data": {
            "mimeType": "*/*",
            "host": "*",
            "pathPattern": ".*\\.play"
          },
          "category": [
            "DEFAULT"
          ]
        }
      ]
    }

How can I get the content of the file when the application is open?

React Native update version in existing app

$
0
0

I have very large app on play store with very complicated code on React Native and Android. Most android library code is customized as per requirement in this app. Now I want to update my app on play store but for that I need to make my app compatible with 64 bit as Google Play is not accepting my app as per new policies.

I googled it and find that I need to update React Native version to 0.59.0. I just changed React Native version in my package.json file from 0.57.7 to 0.59.8. and added below piece of code in my app level build.gradle file:

ndk {
            abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }

splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }

But here after adding above code when I run app its being crash on start with below error message:

java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so caused by: couldn't find DSO to load: libglog_init.so caused by: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libgnustl_shared.so caused by: dlopen failed: "/data/data/com.m_naira/lib-main/libgnustl_shared.so" is 32-bit instead of 64-bit
        at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:703)
        at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:564)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:500)
        at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:455)
        at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:18)
        at com.facebook.react.bridge.NativeMap.<clinit>(NativeMap.java:19)
        at com.facebook.react.bridge.JSCJavaScriptExecutorFactory.create(JSCJavaScriptExecutorFactory.java:21)
        at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:917)
        at java.lang.Thread.run(Thread.java:764)

Here is a piece of code from my package.json:

"dependencies": {
    "axios": "^0.18.0",
    "moment": "^2.22.2",
    "react": "16.6.3",
    "react-image-mapper": "0.0.14",
    "react-native": "^0.59.8",

    "react-native-animatable": "^1.3.0",
    "react-native-autocomplete-input": "^3.6.0",
    "react-native-camera": "^1.9.2",
    "react-native-contacts": "^2.2.4",
    "react-native-customized-image-picker": "^0.1.4",
    "react-native-datepicker-dialog": "0.0.9",
}

I don't know how to go with react native update process as it is harmful for existing app. Please let me know what is the feasible solution for this. Any help will be appreciated.

React native fail to run-android even when emulator running

$
0
0

Running the command react-native run-android fails with the following output:

Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug...
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

The curious thing about this problem is that an emulator is running. adb devices returns

List of devices attached 
emulator-5554   device

If these details help, its running in Linux, with the emulator set as Android 6.0 API Level 23, using Google APIs Intel Atom (x86).

Unable to load script from assets index.android.bundle on windows

$
0
0

I'm trying to run my first React Native project for first time on my device (Android 4.2.2).

And I get:

unable to load script from assets index.android.bundle

Commands that I used:

  1. cd (project directory)
  2. react-native start
  3. react-native run-android

How can I regenerate Android and IOS folders in React Native project version 0.61.x?

$
0
0

I tried to use

react-native upgrade

react-native upgrade --legacy true

react-native eject

no command is useful in this case

After Installing Admob, firebase version is conflicting - React Native

$
0
0

After installing the Admob https://www.npmjs.com/package/react-native-admob Npm package the firebase version is conflicting, I tired all previous version problem links, but after that also I can't fix that error.

What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[16.5.
  0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

  Dependency failing: com.google.android.gms:play-services-measurement-api:16.5.0 -> com.google.android.gms:play-services-
  measurement-impl@[16.5.0], but play-services-measurement-impl version was 17.0.0.

  The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
  ifact with the issue.
  -- Project 'app' depends onto com.google.firebase:firebase-analytics@{strictly 16.5.0}
  -- Project 'app' depends onto com.google.android.gms:play-services-ads@{strictly 18.2.0}
  -- Project 'app' depends on project 'react' which depends onto com.google.android.gms:play-services-ads@+
  -- Project 'app' depends onto com.google.android.gms:play-services-measurement-impl@{strictly 17.0.0}
  -- Project 'app' depends onto com.google.android.gms:play-services-ads-lite@{strictly 18.2.0}
  -- Project 'app' depends onto com.google.android.gms:play-services-measurement-api@{strictly 16.5.0}
  -- Project 'app' depends onto com.google.firebase:firebase-core@16.0.9
  -- Project 'app' depends onto com.google.android.gms:play-services-measurement-sdk@{strictly 17.0.0}
  -- Project 'app' depends onto com.google.firebase:firebase-core@{strictly 16.0.9}
  -- Project 'app' depends onto com.google.android.gms:play-services-measurement@{strictly 17.0.0}

  For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
  endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
  github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
  uild.gradle file.`

This is my build.gradle file android/app/gradle

   `implementation project(':react-native-admob')
    implementation project(':react-native-svg')
    implementation project(':react-native-share')
    implementation project(':@react-native-community_netinfo')
    implementation project(':react-native-document-picker')
    implementation project(':react-native-vector-icons')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.google.android.gms:play-services-base:16.1.0"
    implementation "com.google.firebase:firebase-core:16.0.9"
    implementation "com.google.firebase:firebase-storage:17.0.0"
    implementation "com.google.firebase:firebase-perf:17.0.2"
    implementation "com.facebook.react:react-native:+"  // From node_modules`

At the end of file

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) apply plugin: "com.android.application" apply plugin: "com.google.firebase.firebase-perf" apply plugin: 'com.google.gms.google-services'

android/build.gradle

       `classpath("com.android.tools.build:gradle:3.4.1")
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.google.firebase:perf-plugin:1.2.1'`

App published but not indexed in Google Play after 2 weeks

$
0
0

For a client of ours we've created an app which has to be available by the 11th of October. The app is already available in the iOS App store but Google Play seems to be a problem.

I have added the package to the release track on the 26th of September, hoping it would be reviewed & published shortly after which, luckily, it did. I can use a direct link to the app (taken from the play console) which indicates it is published correctly. The console does not list any errors. Device and country settings have been double checked and all seems to be correct.

Google support has been contacted a few days ago but, unfortunately, there is still no reply from them.

With the deadline coming closer i'm getting less sleep each night.

Does anyone have any experience with this particular issue and hopefully a solution?

Notes

  • App is created with React Native version 0.59.9
  • No advertisements but uses AdMob SDK for Firebase Analytics
  • Package name is "com.kunstmuseum.kunstmuseum"
  • Searching the Play store for: "pub:Kunstmuseum Den Haag" does give me a result.

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.kunstmuseum.kunstmuseum"
android:versionCode="1"
android:versionName="1.0">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 

<application
  android:name=".MainApplication"
  android:allowBackup="true"
  android:label="@string/app_name"
  android:icon="@mipmap/ic_launcher"
  android:roundIcon="@mipmap/ic_launcher_round"
  android:theme="@style/AppTheme">
  <activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
    android:screenOrientation="portrait"
    android:windowSoftInputMode="adjustResize">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
  </activity>
  <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
  <service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService">
    <intent-filter>
      <action android:name="com.google.firebase.MESSAGING_EVENT" />
    </intent-filter>
  </service>
  <service android:name="io.invertase.firebase.messaging.RNFirebaseInstanceIdService">
    <intent-filter>
      <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
    </intent-filter>
  </service>
</application>

build.gradle

apply plugin: "com.android.application"
apply plugin: "com.google.firebase.firebase-perf"
apply plugin: 'io.fabric'

import com.android.build.OutputFile

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

    // Sometimes (like if you use Android API<17) adb forwards don't work, so you need a bundle in the dev APK
    bundleInDebug: project.hasProperty("bundleInDebug") ? project.getProperty("bundleInDebug") : false,
]

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

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.kunstmuseum.kunstmuseum"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 5
        versionName "1.4"

        // Needed to support API<21, though there is a small chance proguard shrinks things sufficiently
        multiDexEnabled true
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    signingConfigs {
        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 {
        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, "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 project(':react-native-zip-archive')
    implementation project(':react-native-proximity')
    implementation project(':react-native-webview')
    implementation project(':rn-fetch-blob')
    implementation project(':react-native-video')
    implementation project(':react-native-svg')
    implementation project(':react-native-sound')
    implementation project(':react-native-shake')
    implementation project(':react-native-audio-jack')
    implementation project(':@react-native-community_async-storage')
    implementation project(':react-native-gesture-handler')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules

    /* ----------------------------
    *    REACT NATIVE FIREBASE
    * ---------------------------- */

    // Library as defined in settings.gradle
    implementation project(path: ':react-native-firebase')

    // Required dependencies
    //noinspection GradleCompatible
    implementation "com.google.firebase:firebase-core:16.0.9"
    implementation "com.google.android.gms:play-services-base:16.1.0"

    /* -------------------------
    *   OPTIONAL FIREBASE SDKS
    * ------------------------- */

    implementation('com.google.firebase:firebase-ads:15.0.1') {
      // exclude `customtabs` as the support lib version is out of date
      // we manually add it as a dependency below with a custom version
      exclude group: 'com.android.support', module: 'customtabs'
    }

    // Authentication
    implementation "com.google.firebase:firebase-auth:17.0.0"
    // Analytics
    implementation "com.google.firebase:firebase-analytics:16.5.0"
    // Performance Monitoring
    implementation "com.google.firebase:firebase-perf:17.0.0"
    // Remote Config
    implementation "com.google.firebase:firebase-config:17.0.0"
    // Cloud Storage
    implementation "com.google.firebase:firebase-storage:17.0.0"
    // Dynamic Links
    implementation "com.google.firebase:firebase-dynamic-links:17.0.0"
    // Real-time Database
    implementation "com.google.firebase:firebase-database:17.0.0"
    // Cloud Functions
    implementation "com.google.firebase:firebase-functions:17.0.0"
    // Cloud Firestore
    implementation "com.google.firebase:firebase-firestore:19.0.2"
    // Cloud Messaging / FCM
    implementation "com.google.firebase:firebase-messaging:18.0.0"
    // Crashlytics
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
        transitive = true
    }

    /* --------------------------------
    *  OPTIONAL SUPPORT LIBS
    * -------------------------------- */

    // Needed to support API<21, though there is a small chance proguard shrinks things sufficiently
    implementation "com.android.support:multidex:1.0.3"

    // For Firebase Ads
    //noinspection GradleCompatible
    implementation "com.android.support:customtabs:27.1.1"

    // For React Native Firebase Notifications
    implementation 'me.leolin:ShortcutBadger:1.1.22@aar'

    // For animated GIF support
    implementation 'com.facebook.fresco:animated-gif:1.10.0'
}

// 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'

How can i check push notification permission for both ios and android in react native?

$
0
0

I want to check push notification permission for both ios and android. I want to see if user has switched off the push notification permission from his device settings. Is there any plugin or any code i can take reference from if needed to be coded in native.

XMLHttpRequest error in ReactNative Debug mode

$
0
0

I delete my android emulator and create a new one after this when i build my react native project and active debug mode this error appears on emulator but i dont have any problems with Previous emulator :

Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://localhost:8083/create_session'.

and this on browser's console :

Must first create RPC session with a valid host

what should i do?

When run react-native run-android for run emulator adb android studio, show error app:installDebug FAILED

$
0
0

When run react-native run-android show error :

Task :app:installDebug FAILED
com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_FAILED_VERSION_DOWNGRADE

React Native GeoLocation is not working on Android

$
0
0

Can anyone confirm if React Native Geolocation is actually working on Android? I am stuck with location request timed out while using getCurrentPosition() method and no error message while using watchPosition() method.

I have added the required permission (FINE LOCATION) on AndroidManifest.xml and location permission is allowed for the app.

Here is my implementation:

componentWillMount() {
 navigator.geolocation.getCurrentPosition((position) => {
        console.log('+++++++');
        console.log(position.coords.longitude);
        this.setState({
          longitude: position.coords.longitude,
          error: null,
        });
      },
      (error) => {
        console.log(error);

      },

    );
}

React Native Version : 0.42

How to display WiFi network (SSID) list on react native app using expo?

$
0
0

Is there a way to display all Wifi list in react native using expo for Android. I have seen a few libraries but mostly for android and even those don't work properly. Any suggestions?

I want like :

enter image description here

Viewing all 28473 articles
Browse latest View live