Android Question Double Splash Screen Error

Zvi

Member
Licensed User
Hi,
I uploaded my app to Play Store and got the following report:
Double splash screen Warning

The crawler detected a blank loading screen or a custom splash screen that is shown in your app after the system splash screen. Users launching your app on Android 12 or higher will see two splash screens.
To fix this issue, update your app to use the SplashScreen API.

I checked the forum and found Erel’s code:

Erel's code:
#If JAVA
import androidx.core.splashscreen.SplashScreen;
public void _onCreate() {
    BA.Log("onCreate");
      SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
}
#End If

I put it in Main:
My code:
Sub Globals
    
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Dim pm As B4XPagesManager
    pm.Initialize(Activity)
End Sub

#If JAVA
import androidx.core.splashscreen.SplashScreen;
public void _onCreate() {
    BA.Log("onCreate");
      SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
}
#End If

#Region Delegates

Sub Activity_Resume
    B4XPages.Delegate.Activity_Resume
End Sub

But I get this error when I compile:

B4A Version: 12.00
Parsing code. (0.27s)
Java Version: 8
Building folders structure. (0.08s)
Compiling code. (0.24s)
Compiling layouts code. (0.02s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Compiling resources (0.08s)
Linking resources (1.21s)
Compiling generated Java code. Error
javac 1.8.0_381
src\com\learn\chess\main.java:3: error: package androidx.core.splashscreen does not exist
import androidx.core.splashscreen.SplashScreen;
^
Note: src\com\learn\chess\main.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

How do I solve this?
Any suggestions will be gratefully received :)
 

Shelby

Well-Known Member
Licensed User
My guess is that you will need to put more of your code herein to get any useful information from our members. Other mentions of spashscreen and Java will certainly be of value to any observers of your project.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
error: package androidx.core.splashscreen does not exist
To make use of an inlinejava import you have to add the right dependency first:

Try to add
B4X:
#AdditionalJar: androidx.core:core
or
B4X:
#AdditionalJar: androidx.arch.core:core-runtime
to your app.

Try the first one first.
 
Last edited:
Upvote 0

Zvi

Member
Licensed User
Thanks for your reply.
I tried both of your recommendations Manfred but I still get the same error when I try to compile:

B4A Version: 12.00
Parsing code. (0.24s)
Java Version: 8
Building folders structure. (0.02s)
Compiling code. (0.21s)
Compiling layouts code. (0.02s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Compiling resources (0.05s)
Linking resources (0.43s)
Compiling generated Java code. Error
javac 1.8.0_381
src\com\learn\chess\main.java:3: error: package androidx.core.splashscreen does not exist
import androidx.core.splashscreen.SplashScreen;
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

Without using:
B4X:
#If JAVA
import androidx.core.splashscreen.SplashScreen;
public void _onCreate() {
    BA.Log("onCreate");
      SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
}
#End If

#Region Delegates

it compiles without problems, but then I get an error from Google Play Console
"Users launching your app on Android 12 or higher will see two splash screens.
To fix this issue, update your app to use the SplashScreen API".

I haven't got a clue how to "update your app to use the SplashScreen API" on B4A
 
Upvote 0

Zvi

Member
Licensed User
Erel, I believe I know what the problem is.
Firstly, yes, I tried it on my Android 12 and there is no problem of two splash screens.
I think the folks at Google Play got confused by my app splash screen.
As you can see in the pics, the app starts with a splash screen and then, before the main program starts, in the unpaid version, there is an interstitial ad.
Google said I had to put a warning before the ad saying that there is now an interstitial ad "so users will not think that it is part of the app" (although I have never seen any other app on Google Play with a warning before an interstitial ad).
So after the splash screen there is a warning about a following ad. But it appears as a separate screen and I think that is the reason that they mention two splash screens.
I think that I will have to get rid of the timer and put the warning on the opening screen with a button to continue.
 

Attachments

  • Android Splash Free.jpg
    Android Splash Free.jpg
    53 KB · Views: 23
  • Android PreAd.jpg
    Android PreAd.jpg
    36.5 KB · Views: 22
  • Android InterAd.jpg
    Android InterAd.jpg
    17.7 KB · Views: 22
  • Android Main Screen.jpg
    Android Main Screen.jpg
    79.7 KB · Views: 23
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
So after the splash screen there is a warning about a following ad. But it appears as a separate screen and I think that is the reason that they mention two splash screens.
I think that I will have to get rid of the timer and put the warning on the opening screen with a button to continue.
If it is not a real issue then you can ignore that warning.
 
Upvote 0
Top