Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Map flashes black when opened from another activity #345

Open
genericusername3 opened this issue Apr 27, 2020 · 3 comments
Open

Map flashes black when opened from another activity #345

genericusername3 opened this issue Apr 27, 2020 · 3 comments
Labels

Comments

@genericusername3
Copy link

genericusername3 commented Apr 27, 2020

Mapbox SDK version: com.mapbox.mapboxsdk:mapbox-android-sdk:9.1.0

Steps to trigger behavior

  1. Use a real device, not an emulator, because emulators don't have the issue for some reason
  2. Open an activity with a map using an Intent
  3. Perform usual steps (set token, add style etc.)

Expected behavior

Map renders correctly

Actual behavior

Map flashes correctly rendered, then turns black with attribution still visible for more than a second and finally appears correctly rendered again.

Log (verbose):

2020-04-27 18:00:57.994 12598-12598/de.kaffeepott.mockup W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@c03d7e2
2020-04-27 18:00:58.019 12598-12598/de.kaffeepott.mockup I/FloatingActionButton: Setting a custom background is not supported.
2020-04-27 18:00:58.030 12598-12598/de.kaffeepott.mockup I/FloatingActionButton: Setting a custom background is not supported.
2020-04-27 18:00:58.112 12598-12598/de.kaffeepott.mockup E/Minikin: addFont failed to create font, invalid request
2020-04-27 18:00:58.126 12598-12598/de.kaffeepott.mockup V/Activity: mLastPackageName-de.kaffeepott.mockup.MapActivity
2020-04-27 18:00:58.113 12598-12598/de.kaffeepott.mockup I/chatty: uid=10204(de.kaffeepott.mockup) identical 2 lines
2020-04-27 18:00:58.114 12598-12598/de.kaffeepott.mockup E/Minikin: addFont failed to create font, invalid request
2020-04-27 18:00:58.167 12598-12941/de.kaffeepott.mockup I/Mbgl-EGLConfigChooser: In emulator: false
2020-04-27 18:00:58.175 12598-12598/de.kaffeepott.mockup V/Mbgl-ConnectivityReceiver: connected - true
2020-04-27 18:00:58.521 12598-12598/de.kaffeepott.mockup D/ViewRootImpl[MapActivity]: changeCanvasOpacity: opaque=true
2020-04-27 18:00:58.550 12598-12598/de.kaffeepott.mockup V/Activity: onStop mLastPackageResume = false de.kaffeepott.mockup.CafeActivity@8835bcf
2020-04-27 18:01:00.124 12598-12598/de.kaffeepott.mockup D/ViewRootImpl[MapActivity]: changeCanvasOpacity: opaque=false

I've tested this on multiple devices and emulators and this bug seems to affect devices prior to Android 10.

Note: 2020-04-27 18:01:00.124 12598-12598/de.kaffeepott.mockup D/ViewRootImpl[MapActivity]: changeCanvasOpacity: opaque=false happens at the same time as the map showing correctly again and I would guess canvasOpacity has something to do with this.

Overall, my issue sounds exactly like fixing this issue should have fixed it, but it still persists

@genericusername3
Copy link
Author

Here is a screen capture:
2020-04-27-18-13-27

@Chaoba
Copy link
Contributor

Chaoba commented May 11, 2020

@genericusername3 Thanks for reporting this. Can you upload your test project or create a new project that could reproduce this issue to GitHub and share it with me?

@UnclePetros
Copy link

Hello,
I want to report the same problem, but without the flashes;
my map is always rendered black, with only the mapbox logo visibile.
This happen either in emulator and real device.
I've tried to fix in many ways, like changing ndk version, changing emulator render engine, and other, but problem still persists.
I've noticed in the debug log, mapbox call tiles, symbols and icons of the map correctly, but unfortunately they are not showed on screen.
This is content of my build.gradle module file:

android {
    compileSdkVersion 28
    ndkVersion "21.1.6352462"
    buildToolsVersion "29.0.2"

    defaultConfig {
        applicationId "com.vintesmobile"
        minSdkVersion 28
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.annotation:annotation:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.squareup.okhttp3:okhttp:4.6.0'
    implementation 'org.conscrypt:conscrypt-android:2.2.1'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0'
}

Thank you in advance.
Let me know if you need further help.

Regards
UnclePetros

@stale stale bot added the archived label Nov 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants