Java.Lang.Nosuchmethoderror: No Static Method Getfont(Landroid/Content/Context;Ilandroid/Util/
Typedvalue;Ilandroid/Widget/Textview;)

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



Leave a reply



Submit