-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crashing on Android 7.0 #869
Comments
Is this happening on master? |
@nitaliano: not sure if the commits are the same but I am using the same version as stated on current |
Master contains the newest Mapbox iOS and Android SDK, which could have potentially fixed this issue |
@nitaliano: installed from master from commit f3b8c8f, still the same thing:
|
@lucasbento does your app also bring in google play services? |
@nitaliano: I'm not sure, this is my entire apply plugin: "com.android.application"
import com.android.build.OutputFile
import groovy.json.JsonSlurper
def getNpmVersion() {
def inputFile = new File("../package.json")
def packageJson = new JsonSlurper().parseText(inputFile.text)
return packageJson["version"]
}
def getGitVersion() {
def process = "git rev-list develop --first-parent --count".execute()
return process.text.toInteger()
}
project.ext.react = [
entryFile: "index.js"
]
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
/**
* Versioning
*/
def userVersion = getNpmVersion()
def googleVersion = getGitVersion()
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.horsha.app"
minSdkVersion 16
targetSdkVersion 26
multiDexEnabled true
versionCode googleVersion
versionName userVersion
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
dexOptions {
jumboMode true
javaMaxHeapSize "4g"
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
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]
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 {
compile project(':yfuks-react-native-action-sheet')
compile project(':bugsnag-react-native')
compile project(':mapbox-react-native-mapbox-gl')
compile project(':react-native-prompt-android')
compile project(':react-native-fcm')
compile 'com.google.firebase:firebase-core:10.0.1' //this decides your firebase SDK version
compile project(':react-native-svg')
compile project(':react-native-background-geolocation')
compile project(':react-native-version-number')
compile project(':react-native-camera')
compile project(':react-native-image-resizer')
compile project(':react-native-fs')
compile project(':react-native-document-picker')
compile project(':react-native-photo-view')
compile project(':react-native-photo-view')
compile project(':react-native-fbsdk')
compile fileTree(dir: "libs", include: ["*.jar"])
compile(name: 'tslocationmanager', ext: 'aar')
compile 'com.facebook.react:react-native:+'
// compile 'com.facebook.fresco:animated-gif:1.0.1'
compile 'com.android.support:multidex:1.0.1'
}
repositories {
flatDir {
dirs "../../node_modules/react-native-background-geolocation/android/libs"
}
}
// 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' |
@nitaliano: do you have any hint of what is going on? |
The Android SDK also uses google play services what happens if you add
to your gradle file? |
@nitaliano: thanks for replying. This is what I get by adding that line: |
@lucasbento I've run the codebase with Android 7 on hardware and haven't seen a crash. Which leads me to believe that multiple deps are bringing in google play services and the versions are messing with each other. I found this issue in react-native-maps react-native-maps/react-native-maps#1408 it looks similar. Also found this issue in this repo #814 |
@nitaliano: already tried the first one, will try #814 and it again, will let you know whether it works or not, thanks! |
@nitaliano: fixed it by doing this: Thanks! |
I'm trying to run the library on an Android device, it crashes as soon as I reach a view using
<MapView />
and after that the app doesn't open and crashes as soon as I try to open it.Initial crash:
All the other crashes:
Versions
react-native
:0.49.3
react-native-mapbox-gl
:6.0.1
Android
:7.0
Device
:Moto X
The text was updated successfully, but these errors were encountered: