java.lang.NoSuchMethodError: No static method getFont(Landroid/content/Context;ILandroid/util/
TypedValue;ILandroid/widget/TextView;)
Fix res/values/styles.xml and Manifest.xml like so:This solution is tested and don't forget to clean and build :
1.Manifest.xml
change the theme of HomeActivity to :
<activity
android:name=".ui.home.HomeActivity"
android:theme="@style/Base.Theme.AppCompat.Light" />
<activity android:name=".BaseActivity"></activity>
2. res/values/styles.xml
Make all your themes preceeded with Base :styles.xml will be like this :
<resources>
<!-- Base application theme. -->
<!--<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">-->
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar" parent="Base.Theme.AppCompat.Light">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="Base.ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="Base.ThemeOverlay.AppCompat.Light" />
Detailed explanation as requested: Theme.AppCompat.Light.DarkActionBar
is a subclass of the superclass Base
anyway. Ctrl+click (Android Studio) on it and you will be taken to the source:
<style name="Theme.AppCompat.Light.DarkActionBar" parent="Base.Theme.AppCompat.Light.DarkActionBar" />
3. GithubBrowser-Master.gradle
make support_version = "27.0.0"
and not support_version = "26.0.2
4.app.gradle :
compileSdkVersion 27
buildToolsVersion '27.0.0'
and not
compileSdkVersion 26
buildToolsVersion '26.0.2'
Getting error java.lang.NoSuchMethodError: No static method getFont... after rewriting XML files
The problem is that your buildtoolsversion major number 27.x.x is not the same as your compilesdkversion number 26 in your app: build.gradle file.
Each sdk release comes with a buildtools release specifically for that sdk, and they usually aren’t back ported, so your buildtools 27.x.x has no idea how to build with the sdk 26. Android Studio should have displayed a lint warning highlighting the error.
Error java.lang.NoSuchMethodError: No static method
Use this
compileSdkVersion 27.0.2
buildToolsVersion '27.0.2'
implementation 'com.android.support:appcompat-v7:27.0.2'
Instead of this
compileSdkVersion 26
implementation 'com.android.support:appcompat-v7:26.1.0'
I am getting error saying No static method getFont in android studio 3.1
I resolved it by upgrading the
Complie Sdk version and the dependencies
From 26 to 27
Complie Sdk version
And for dependencies
From
26.0.1
To
27.0.0
java.lang.NoSuchMethodError: No static method with(Landroid/content/Context;)Lcom/squareup/picasso/Picasso;
if anybody faces this problem, damijana, the guy who made the library is no longer supporting it.
But firdausmaulan is a developer and he made a library which is really not different that damijana, but it uses glide instead of picasso.
LINK TO github project:
https://github.com/firdausmaulan/GlideSlider
LINK to example:
https://github.com/firdausmaulan/GlideSlider-Example/blob/feature/1.3.2/app/src/main/java/com/glide/slider/example/MainActivity.java
Related Topics
Single Selection in Recyclerview
Passing Data Between Activities in Android
Java.Util.Zip.Zipexception: Duplicate Entry
Update an Android App (Without Google Play Store Visit)
Developing Cross Platform Mobile Application
How to Play an Android Notification Sound
How to Remove Lines Between Listviews on Android
What Does This Google Play APK Publish Error Message Mean
Show Dialogfragment with Animation Growing from a Point
Android Studio - Android Emulator Wifi Connected with No Internet
What Is the Fastest Way to Scrape HTML Webpage in Android
Android: How to Rotate a Bitmap on a Center Point
Overflow Auto Doesn't Work in Android Browser
Error:'Keytool' Is Not Recognized as an Internal or External Command, Operable Program or Batch File
Font-Face on Android 4.0.X Doesn't Work
Android Checkbox Listview Select All (Disable/Enable)
Linearlayout Not Expanding Inside a Scrollview
Should Have Subtitle Controller Already Set Mediaplayer Error Android