no suitable method found for show(MainActivity,boolean,int)
See original GitHub issueI followed the implementation for android platform showed on README.md file.
Environment:
OS: Linux 3.16 Node: 9.3.0 Yarn: 1.3.2 npm: 5.5.1 Watchman: 4.9.0 Xcode: N/A Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.0.0 => 16.0.0 react-native: 0.51.0 => 0.51.0
version of react-native-splash-screen
{ name: 'react-native-splash-screen',
description: 'A splash screen for react-native, hide when application loaded ,it works on iOS and Android.',
'dist-tags':
{ latest: '3.0.6' }
}
MainActivity.java
import android.os.Bundle;
import com.facebook.react.ReactActivity;
import org.devio.rn.splashscreen.SplashScreen;
public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// here show splash screen
SplashScreen.show(this, false, R.style.SplashScreenTheme);
super.onCreate(savedInstanceState);
}
...
compiling…
~$ export ENVFILE=.env.dev && react-native bundle --platform android --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && react-native run-android
and output below:
/android/app/src/main/java/com/adm/panel/MainActivity.java:13: error: no suitable method found for show(MainActivity,boolean,int)
SplashScreen.show(this, false, R.style.SplashScreenTheme);
^
method SplashScreen.show(Activity,boolean) is not applicable
(actual and formal argument lists differ in length)
method SplashScreen.show(Activity) is not applicable
(actual and formal argument lists differ in length)
1 error
:app:compileDebugJavaWithJavac FAILED
But in my colors.xml SplashScreenTheme
exists.
colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="status_bar_color">#2e2f2e</color>
<style name="SplashScreenTheme" parent="SplashScreen_SplashTheme">
<item name="colorPrimaryDark">@color/status_bar_color</item>
</style>
</resources>
styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowIsTranslucent">true</item>
</style>
</resources>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:9
Top Results From Across the Web
Error No suitable method found for add(int, Fragment)
Show activity on this post. Your DetailFragment need to extends from android.support.v4.app.Fragment instead of Fragment.
Read more >no suitable method found for onCreate(no arguments) - B4X
Hi everyone, again me, Im integrating the Huawei SDK and Analytics Kit, added all the JARS needed, and using this Java Inline code...
Read more >Solution for: error: no suitable method found for makeText
The toast used 'this' only. I have found that inside an onKeyListener you must use the activity name before the 'this. So it...
Read more >No suitable method found to override - Unity Forum
Heuristic(float[])': no suitable method found to override ... private bool onEpisode = false; ... int action = (int)vectorAction[0];.
Read more >Activity - Android Developers
The following diagram shows the important state paths of an Activity. ... public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This feature whilst documented on master hasn’t yet been released in v3.0.6. If you need to use it consider adding the following to your
package.json
dependencies.I have the same problem