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

Error: Unable to resolve module `api-ecommerce`

$
0
0

Im setting up a android app to connect with my wordpress woocommerce site.

when i run the setup i get a error code 500

error: bundling failed: Error: Unable to resolve module api-ecommerce from C:\Users\Ivo Kalu\Desktop\mstore-3.7.2\mstore-pro\src\Router.js: Module api-ecommerce does not exist in the Haste module map


How to call function instead of screen inside Drawer on React Navigation?

$
0
0

I Used "react-navigation": "^4.0.10", "react-navigation-drawer": "^2.3.2",

and implement a drawer and inside them, I added my item, one of them is "Call us" and it should open a phone so I used for it Linking and I don't know if that's a good way to invoke a function instead of Screen as default in RN-drawer

so I do that's But after click to this item my app crashed and stop to work!! so how can I achieve this?

const DrawerNavigator = createDrawerNavigator({
 ...
 CallUsDrawer: {
      screen: () => Linking.openURL(`tel:0597093830`),
      navigationOptions: {
        drawerLabel: 'call us',
        drawerIcon: () => <Icon name="ios-call" size={28} color="#1E558E" />,
      },
    },
 ...
}); 

My React Native App is working on iOS as expected but it's not working properly on Android

$
0
0

First of all, I have 3 Screens that get on the screen in total. I don't have any issue on my Home Screen but after when you press to play button it navigates you to Play screen and in Play Screen before you start to do anything I have a timer that counts down from 3 to 1. Even in that timer It's doesn't show "2" but it still waits and jumps to 1. This is the first problem.

My second problem is I have 2 Components that get rendered after timer as "gameBox" and "TextInput". Normally I have sub-components that get on the screen and slides down. But when you run the app in android it works for like 15 seconds and after that, it just acts weirds like words don't slide down, they just stay.

My last and third problem is that my TextInput component gets rendered but I can't click on it or I can't write anything on it and I can't click to submit button either.

I had warnings about "require cycle". I thought that could be the problem but no, it didn't fix it. Now I don't have any errors or warnings.

But like I said everything works so good on iOS. I think it's something about the environment but I'm not sure. If you can help me guys, I would be very grateful :)

[react-native]could not connect to development server on android

$
0
0

When I run "react-native run-android",it gives me error:"could not connect to development server...".

  • Package server is running and i can access it directly from browser in mobile device.
  • My android device connected to computer has debugging enabled i checked it using adb devices command.
  • My android version is 4.4.4 so i cannot use adb reverse command.
  • I have set the ip address and port in Dev setting.
  • Usb debug is on.
  • OS is windows7.

So how to fix the red error screen issue?Any suggestion is appreciated!

Error screen

Does React Native translates Java Script into native code in the background?

$
0
0

I am currently developing a hybrid mobile application using React Native library. But I am not sure how it executes in the Android or iOS platforms just like how a native application executes. So could someone please help me understand the background process of react native. Is it translating the Java Script code written into native code(Java or Objective C) and then compiles & executes the native code ?

Handling loss of internet connectivity on React Native

$
0
0

I've made a React Native App that scans for BLE devices using a foreground service on Android. The issue I have is dealing with the loss of internet connectivity. Once the internet is available, the pending actions added to the queue when the internet was not available are not executed.

Once a beacon is detected I send an event to React Native using NativeModules, Upon receiving the event I check if the internet is available or not like this. If it's not it's stored in a queue.

    const didEnterRegion = async (store, beacons) => {
      const { isConnected } = store.getState().connection;

      if (isConnected) {
        store.dispatch({
          type: REQUEST_CHECKIN,
          payload: beacons,
        });
      } else {
        NativeModules.BeaconFinder.sendNotification(
          'Looks like you entered a venue, but the internet is not reachable.',
          beacons.uuid.toString(),
        );
        store.dispatch({
          type: ADD_ACTION_TO_QUEUE,
          name: REQUEST_CHECKIN,
          payload: beacons,
        });
      }
    };

In App.js I constantly check for internet connectivity. If it's available I execute all actions in queue.

    export default class App extends Component {
      componentDidMount() {
        const unsubscribe = NetInfo.addEventListener(state => {
          this._handleConnectionChange(state.isInternetReachable);
        });
      }

      componentWillUnmount() {
        //unsubscribe();
      }

      _handleConnectionChange = isConnected => {
        if (isConnected && _.size(store.getState().connection.actionQueue) > 0) {
          let queue = store.getState().connection.actionQueue;

          _.map(queue, action => {
            console.log(action);
            store.dispatch({
              type: action.name,
              payload: action.payload
            });
          });
        }
        store.dispatch({
          type: CHANGE_CONNECTION_STATUS,
          isConnected
        });
      };
      render...
}

This works when the app is in the foreground, but when the app is killed from the task switcher, the code executes randomly i.e. It works sometimes and doesn't work sometimes.

index.android.bundle not updating when creating release build

$
0
0

I'm working on a Project in ReactNative & it's working fine in debug build (When installing via react-native run-android but When I generate a release build it crashes as soon as I open it, according to logs it's unable to load script, and android/app/src/main/assets directory is empty.

To resolve this I had to run these commands: 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

rm -rf ./android/app/src/main/res/drawable-*

But now the file index.android.js won't update in a release build, so I have to run the above commands every time I need a release build, what am I doing wrong?

Here are my packages.json details:

"scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },



"react": "16.8.3",
    "react-native": "0.59.5"

In short: How to create or update index.android.bundle automatically when I generate a release build?

How to develope micro apps for mobile (both ios and android)

$
0
0

i have a react native app and another android application. i need to develop a micro app that can be integrated into both of the application . (mobile environment)

i heard about electrode react native. but i couldn't find even a Hello world application or steps to integrate into another application.

can you guys tell me a solution?


Detect if picture of picture taken in mobile app

$
0
0

I am working on a face recognition app where the picture is taken and sent to server for recognition.

I have to add a validation that user should capture picture of real person and of another picture. I have tried a feature of eye blink and in which the camera waits for eye blink and captures as soon as eye is blinked, but that is not working out because it detects as eye blink if mobile is shaken during capture.

Would like to ask for help here, is there any way that we can detect if user is capturing picture of another picture. Any ideas would help.

I am using react native to build both Android and iOS apps.

Thanks in advance.

Execution failed for task ':app:mergeReleaseResources'. react native realse build

$
0
0

I have tried multiple solutions online can't get the build to work

I get a Execution failed for task ':app:mergeReleaseResources'.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeReleaseResources'.

    [raw/app] C:\Users\Lenovo\Documents\GitHub\Marist-Mobile-App\android\app\src\main\res\raw\app.json [raw/app] C:\Users\Lenovo\Documents\GitHub\Marist-Mobile-App\android\app\build\generated\res\react\release\raw\app.json: Error: Duplicate resources

  • 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.org

BUILD FAILED in 3m 24s

at checkExecSyncError (child_process.js:616:11)
at execFileSync (child_process.js:634:15)
at runOnAllDevices (C:\Users\Lenovo\Documents\GitHub\Marist-Mobile-App\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (C:\Users\Lenovo\Documents\GitHub\Marist-Mobile-App\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\Users\Lenovo\Documents\GitHub\Marist-Mobile-App\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at async Command.handleAction (C:\Users\Lenovo\Documents\GitHub\Marist-Mobile-App\node_modules\@react-native-community\cli\build\cliEntry.js:160:7)

I don't know what to do

Can someone please help me...

Is there a way to change the background colour of the view for 1 second whenever the state changes in react native?

$
0
0

Is there a way to change the background colour of the view for one second then change it back to normal colour , whenever the state changes in react native ? How to approach this problem ? should we keep track of previous state and compare and make the blink , I am not getting any idea ? sorry if my question is silly, I am a beginner and still learning .

React Native Facebook SDK Login - App crashes on login

$
0
0

in my react native app crash on facebook login button. I use the 0.10.0 tree because the version of my react native is 0.59. https://github.com/facebook/react-native-fbsdk/tree/0.10.0-stable.

Error on platform: Android.

The app is currently on dev, is not on google store. I've generated the key on Linux using:

keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64

I put this key only in Facebook Developer when asked.

Facebook Settings

enter image description hereenter image description here

Settings Env

Settings.gradle

include ':react-native-fbsdk'
project(':react-native-fbsdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fbsdk/android')

MainApplication.java + MainActivity.java

All the modifications listed on: https://github.com/facebook/react-native-fbsdk/tree/0.10.0-stable

AndroidManifest.xml

The meta generated by Facebook developer tools:

<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> <activity android:name="com.facebook.FacebookActivity" android:configChanges= "keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" /> <activity android:name="com.facebook.CustomTabActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="@string/fb_login_protocol_scheme" /> </intent-filter> </activity>

strings.xml

<string name="facebook_app_id">XXXXXXXX</string> 
 <string name="fb_login_protocol_scheme">fbYYYYYYYYYY</string>

Test.js

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, TextInput, View, ScrollView, Dimensions,TouchableHighlight, TouchableOpacity, Image, ImageBackground, Button, Alert, FlatList, DeviceEventEmitter, PermissionsAndroid} from 'react-native';
import { LoginButton, AccessToken } from 'react-native-fbsdk';

class TestScreen extends React.Component {

    //props e constructor
    constructor(props){
      super(props);
      this.state = {
        error: null,
      credentials: null,
      }
    } //props e constructor


    componentDidMount(){
      console.log("Running on:"+appUrl);
      console.log("Current locale:"+locale);
    }

    //Rendering
    render() {

      return (
        <View style={styles.main}>

            <Text style={{ color:'#fff' }}>Test</Text>

            <LoginButton
          onLoginFinished={
            (error, result) => {
              if (error) {
                console.log("login has error: " + result.error);
              } else if (result.isCancelled) {
                console.log("login is cancelled.");
              } else {
                AccessToken.getCurrentAccessToken().then(
                  (data) => {
                    console.log(data.accessToken.toString())
                  }
                )
              }
            }
          }
          onLogoutFinished={() => console.log("logout.")}/>

       </View>

      ); //return
    } //Rendering
  }//WelcomeScreen

export default TestScreen;

Inside the app the login button appear. When i press it, app crash and in console.log appear this handler error:

Any advice?

UPDATE: putting the login button in the first route all works. If i put the button inside a page the error appears.

const MainStack = createStackNavigator(
  {
    Welcome: {
      screen: WelcomeScreen, // Works here
    },
    Menu: {
      screen: Menu,
    },
    Test: {
      screen: TestScreen,//Not here
    },
  },
  {
    defaultNavigationOptions: {
      headerStyle: {
        backgroundColor: '#1f1f1f',
        borderBottomColor: '#2c2828',
        borderBottomWidth:1,
        height:60
      },
      headerTintColor: '#cec7b5',
      headerTitleStyle: {
        fontWeight: 'bold',
      },
      headerTitle: <LogoTitle />,
    },
    initialRouteName: 'Welcome',
    mode: 'modal',
  }
);


//Routing Menu Navigation
//Collego app a React Navigation
const AppContainer = createAppContainer(MainStack);

//Lancio APP
export default class App extends React.Component {

  render() {
    return <AppContainer />;
  }

Menu Item:

<TouchableOpacity onPress={() => this.props.navigation.navigate('Test') }>
        <View style={styles.menuItemRow}>
            <View style={styles.menuItemSpanContainer}>
                <Text style={styles.menuItemSpan}>XX</Text>
            </View>
            <View style={styles.menuItem}>
                <Text style={styles.menuItemText}>Test</Text>
                <Icon style={styles.menuItemIcon} name={'chevron-right'} size={25} />
          </View>
        </View>
     </TouchableOpacity>

DEPS:

"dependencies": {
    "axios": "^0.18.1",
    "qs": "^6.7.0",
    "react": "16.8.3",
    "react-native": "0.59.9",
    "react-native-collapsible": "^1.5.1",
    "react-native-directed-scrollview": "^2.0.0",
    "react-native-easy-grid": "^0.2.2",
    "react-native-fbsdk": "^0.10.0",
    "react-native-flash-message": "^0.1.14",
    "react-native-gesture-handler": "^1.3.0",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-render-html": "^4.1.2",
    "react-native-super-grid": "^3.1.1",
    "react-native-swiper": "^1.5.14",
    "react-native-typography": "^1.4.1",
    "react-native-vector-icons": "^6.1.0",
    "react-navigation": "^3.11.0"
  },

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?

how to determine staging or production __dev__ in app

$
0
0

I have same app distribute with different config - staging or production, both is running on user physical phones.

I am wishing to use __DEV__ to determine if the app is running in development or production.

But __DEV__ only work on emulator or simulator, what about app staging app on user device?

Refresh contentComponent in react-navigation

$
0
0

I am using React-Navigation where I am using functionality of custom drawer by using contentComponent of React-Navigation.

const DrawerNavigation = DrawerNavigator({
  DrawerStack: { screen: DrawerStack }
}, {
  contentComponent: DrawerComponent,
  drawerWidth: 300
})

Here DrawerComponent is my custom navigation drawer where I have used custom navigation items like username, profile picture, email address and other menus.

Now whenever user updates their profile I want to refresh my DrawerComponent, I am not able to find any way to do it. Can anybody suggest me a good way to implement this?


React Native Android Firebase Crashlytics: Must Initialize Fabric before Using singleton()

$
0
0

I have a react native app that already has Firebase installed on it. I am attempting to get the Crashlytics firebase module installed on it now.

I have gotten iOS to build and seems to be doing some sort of reporting to the firebase Dashboard as the dashboard no longer is prompting to install crashlytics. For Android I have followed these instructions: https://rnfirebase.io/docs/v5.x.x/crashlytics/android and have gotten the app to build but within the react-native code when I try to use the API (something like firebase.crashlytics().log('hi there') on app initialization) iOS proceeds as expected but Android throws

"Must Initialize Fabric before Using singleton()".

I have tried getting around this with the method here: https://github.com/corymsmith/react-native-fabric/issues/82 by adding

  @Override
  public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());
  }

/android/app/src/main/java/host/exp/exponent/MainApplication.java file

When I try to do this the app then does not build and gives me the error:

error: cannot find symbol class Crashlytics

at the line (Fabric.with(this, new Crashlytics());). I'm not really sure where to proceed from here so some help would be appreciated.

I can not play video with m3u8 format

$
0
0

I am building a project in React Native and I used the react-native-video dependency to play video streaming, but it does not play anything when the file is m3u8. Will it be the file codec?

Video playback is successful in other formats, but entering this url does not work.

This is my configuration in the Video component:

Version: 4.3.1

<Video source={{uri: 
"https://s3.amazonaws.com/yojma/hls/movie/yvZmxnCwaHGSLUpKFzoTlYrOXRdWQgePIqihbfcs/main.m3u8", 
type:"m3u8"} }/>

And this in app/build.gradle:

dependencies { compile project(':react-native-video-exoplayer') 
implementation "com.facebook.react:react-native:+" // From node_modules 
implementation fileTree(dir: "libs", include: ["*.jar"]) implementation 
"com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" 
}

And this settings.gradle:

rootProject.name = 'Yojma' include ':react-native-video-exoplayer' 
project(':react-native-video-exoplayer').projectDir = new 
File(rootProject.projectDir, '../node_modules/react-native- 
video/android-exoplayer') include ':app'

How to Force React Native app to be just RTL?

$
0
0

I have an app is written in react native and all things in the app use "Arabic Language and layout"

So I want to force the app to be RTL & Layout too, so I use I18nManager from RN to do it and it's work fine in debugging version "when my mobile language LTR OR RTL it's work perfectly"

/**
 * @format
 */

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

I18nManager.forceRTL(true);

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

but when I release a apk version for play store when my mobile language RTL "Arabic" the layout and other things works fine, BUT when my mobile language be LTR "English" the layout changes and all of things

SO i want to force my app to be RTL whether the mobile language "Arabic or English"

Does React Native translates JavaScript into native code in the background?

$
0
0

I am currently developing a hybrid mobile application using the React Native library. But I am not sure how it executes in the Android or iOS platforms just like how a native application executes. So could someone please help me understand the background process of react-native. Is it translating the JavaScript code written into native code(Java or Objective C) and then compile & executes the native code?

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'
Viewing all 28474 articles
Browse latest View live


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