Closed mixophrygian closed 6 years ago
@mixophrygian What happens when you attempt to run your android project directly from your IDE? You might get a clearer picture of what's happening from attempting to run from the IDE instead of run-android command - especially if it's some kind of dependency issue.
@mixophrygian You need to add google's maven repo to your repositories
allprojects {
repositories {
google()
// If you're using a version of Gradle lower than 4.1, you must instead use:
// maven {
// url 'https://maven.google.com'
// }
// An alternative URL is 'https://dl.google.com/dl/android/maven2/'
}
}
@rlepinski nailed it! TIL build.gradle can use multiple mavens. Here's where I landed in my react-native project to support this package as well as the new react-native-camera:
android/build.gradle
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
}
Heyo, running into some issues linking the UA library to my Android Manifest.
React-native-cli: 2.0.1 react-native: 0.53.3 node: v8.0.0 urbanairship-react-native: 1.4.2
I'm following the installation guide to a T, here are the tasks I suspect aren't quiet completing:
react-native link urbanairship-react-native
produces an Unhandled Promise Rejection Warning with "Error no such file or directory, open "/Users/me/Desktop/ourproj/android/app/src/main/java/com/teamname/projectname/MainApplication.java"In fact that file doesn't exist...but /Users/me/Desktop/ourproj/android/app/src/main/java/com/projectname/MainApplication.java does. Note the missing /teamname/
As a result MainApplication.java doesn't get updated... I did manually update this file to
import com.urbanairship.reactnative.ReactAirshipPackage;
and includenew ReactAirshipPackage()
in my packages array, though this didn't get me any further, possibly due to the following error:react-native run-android
after that results inLooks like it wants google play services but can't find it. So in my android/app/build.gradle I include the following dependencies:
Doesn't seem to have an effect. (Before running I installed the Google Play Services through the SDK Manager of Android Studio, version 46)
Other possibly relevant info in my app level build.gradle:
And the top level build.gralde:
Is this funkiness with the maven reference, do you think? Thanks.