Git Product home page Git Product logo

Comments (9)

jawadrehman avatar jawadrehman commented on August 19, 2024 5

if any of you has this issue, then do this
cd android
./gradlew clean

from react-native-gcm-android.

jiw0220 avatar jiw0220 commented on August 19, 2024 1

https://facebook.github.io/react-native/docs/android-building-from-source.html
--> 4. Making 3rd-party modules use your fork

If you use 3rd-party React Native modules, you need to override their dependencies so that they don't bundle the pre-compiled library. Otherwise you'll get an error while compiling - Error: more than one library with package name 'com.facebook.react'.

Modify your android/app/build.gradle and replace compile project(':react-native-custom-module') with:

compile(project(':react-native-custom-module')) {
exclude group: 'com.facebook.react', module: 'react-native'
}

After run command

cd android

./gradlew clean

from react-native-gcm-android.

oney avatar oney commented on August 19, 2024

In android/app/build.gradle

android {
   ...
    dexOptions {
        javaMaxHeapSize "4g"
    }
    defaultConfig {
        ...
        multiDexEnabled true
    }

Please try adding these lines, may resolve the problem.

from react-native-gcm-android.

oney avatar oney commented on August 19, 2024

Other lines in my android/app/build.gradle

dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:23.0.1"
    compile "com.facebook.react:react-native:0.14.+"
   ...

from react-native-gcm-android.

ryanmcdermott avatar ryanmcdermott commented on August 19, 2024

Thanks that worked! Throw that in the README

from react-native-gcm-android.

oney avatar oney commented on August 19, 2024

Good! Will do.

from react-native-gcm-android.

 avatar commented on August 19, 2024

As multiDexEnable true is not recommended solution, maybe it would be better if changed the dependency from whole compile 'com.google.android.gms:play-services:8.1.0' to just the subset compile 'com.google.android.gms:play-services-gcm:8.1.0'. In my settings, it builds when you additionally add compile 'com.android.support:mediarouter-v7:23.0.+' to build.gradle of this project.

from react-native-gcm-android.

nabati avatar nabati commented on August 19, 2024

Let me just add an additional piece here; I had the same issue as above and despite a lot of tinkering, I still got the same error.

What worked for me was to delete the android/app/build folder after changing any of my *.gradle files.

from react-native-gcm-android.

lynndylanhurley avatar lynndylanhurley commented on August 19, 2024

@Herby - what is the issue with using multiDexEnable true? That is the only way I can get my app to build with this package.

from react-native-gcm-android.

Related Issues (20)

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.