-
Notifications
You must be signed in to change notification settings - Fork 1.3k
6.0.0-beta.1 crashing at startup time #11125
Comments
This issue wasn't introduced as part of #10733, reverting that commit doesn't resolve the issue. there an issue with the release build in general. |
Could you add your build.gradle from |
buildscript {
ext.kotlinVersion = '1.1.2-4'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
repositories {
mavenCentral()
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.pguardiola.uiagesturegen"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
androidTest.java.srcDirs += 'src/androidTest/kotlin'
main.java.srcDirs += 'src/main/kotlin'
test.java.srcDirs += 'src/test/kotlin'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.4.0'
compile 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.0.0-beta.1'
testCompile 'junit:junit:4.12'
} |
The crash itself indicates that it's not able to find the geojson classes when starting, changing the deps config to something as: dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.0.0-beta.1@aar'
implementation "com.mapbox.mapboxsdk:mapbox-android-telemetry:2.2.9@aar"
implementation "com.mapbox.mapboxsdk:mapbox-java-geojson:2.2.9@jar"
implementation "com.mapbox.mapboxsdk:mapbox-java-core:2.2.9@jar"
implementation "com.squareup.okhttp3:okhttp:3.9.1"
implementation "com.google.code.gson:gson:2.8.0"
implementation "com.jakewharton.timber:timber:4.5.1"
} can be used as temporary workaround, I'm currently looking into why the dependencies from the maps sdk aren't available in downstream projects. This issue stems from the new Gradle 3.0.0 plugin with the introduction of the api/implementation keywords. |
Figured out the issue, see this SO post for more info but it boils down that the publish to maven requires some rework for gradle 3.0.0. Seeing that Chris Banes repo hasn't been updated in 4 years we will need to move to a more maintained one as android-maven-gradle-plugin. |
After trying to implement android-maven-gradle-plugin as suggested, I was able to force proper compile/runtime dependency structure as you can see in this POM file (the old one for comparison), but I'm running into leaking dependencies issue, as they are still available to the user despite the Another thing that I noticed is that required dependency set to run
Both of the missing dependencies should've been taken from |
After digging into this found that there's some kind of conflict when including transitive dependencies which use different versions of Gradle. That's why updating Gradle in MAS 2.x (mapbox/mapbox-java#716) so that it uses the same version fixes the issue. Also confirmed that #10920 solved OP because MAS 3.0 uses the same Gradle version. So no need for switching plugins. During the process, also found that MAS 3.0 is leaking some unnecessary dependencies to the end users and we should fix it. |
I've just tested using the latest |
When solving OP found and reported a couple of issues 👀 Also #11165 cherry picks #11161 into We're good here. Closing. |
When including
'com.mapbox.mapboxsdk:mapbox-android-sdk:6.0.0-beta.1'
in a simple project that only loads a simple map, the app crashes at startup time.Tested the same scenario using
'com.mapbox.mapboxsdk:mapbox-android-sdk:5.4.0'
and it's working fine.I guess the issue was introduced in #10733
because it’s crashing when trying to load the native library when calling
ConnectivityReceiver.instance(appContext)
Logcat
👀 @tobrun @LukasPaczos @osana @cammace @lilykaiser @zugaldia
The text was updated successfully, but these errors were encountered: