2

I searched a lot on google and stackoverflow i got this error

E/Minikin: addFont failed to create font /system/fonts/NanumGothic.ttf in fragment and fragment reloaded after that

please help me for this?I am taking runtime permission after the allow button fragment reloaded.

  if (PermissionChecker.checkSelfPermission(getActivity(),
                        android.Manifest.permission.CAMERA)
                        != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(getActivity(),
                        Manifest.permission.CAMERA)
                        != PackageManager.PERMISSION_GRANTED && PermissionChecker.checkSelfPermission(getActivity(),
                        Manifest.permission.READ_EXTERNAL_STORAGE)
                        != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(getActivity(),
                        Manifest.permission.READ_EXTERNAL_STORAGE)
                        != PackageManager.PERMISSION_GRANTED) {



                    requestPermissions(new String[]{Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE}, 1);

                    // ActivityCompat.requestPermissions(getActivity(),new String[]{android.Manifest.permission.CAMERA}, 0);
                } else {


                    //opening an intent


                }

here is my logcat.

    Failed sending reply to debugger: Broken pipe
 Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport
 addFont failed to create font /system/fonts/NanumGothic.ttf
 addFont failed to create font /system/fonts/DroidSansFallback.ttf
 addFont failed to create font /system/fonts/MTLmr3m.ttf
 getServiceInstance failed!
 ssl=0x7fb2458980 cert_verify_callback x509_store_ctx=0x7f8bd7e360 arg=0x0
ssl=0x7fb2458980 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_RSA

here is my dependencies

 compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:design:25.3.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile 'com.google.android.gms:play-services:9.4.0'

It perfectly fine if i create other project but why its not working at my side?

Pratik Gondil
  • 689
  • 1
  • 6
  • 17

4 Answers4

4

in my case ,it was because the ttf resource borken, so i re-copy it and fix

It might be a zip/unzip issue or copy/paste issue. So better to make sure if you are using a correct file with correct extension and just delete the existing and copy it again from the original source.

Neo
  • 3,546
  • 1
  • 24
  • 31
Lonie
  • 275
  • 2
  • 12
1
 if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
   verifyStoragePermissions(this);
 }
  public static void verifyStoragePermissions(Activity activity) {
// Check if we have read or write permission
      int writePermission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE);
int readPermission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.READ_EXTERNAL_STORAGE);

if (writePermission != PackageManager.PERMISSION_GRANTED || readPermission != PackageManager.PERMISSION_GRANTED) {
    // We don't have permission so prompt the user
    ActivityCompat.requestPermissions(
    activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE);
}

}

android_jain
  • 788
  • 8
  • 19
1

May be you try to use methods that are not exist in old OS versions. So, try this:

@SuppressLint("NewApi")
    private void if60level() {
        // TODO Auto-generated method stub
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
//yourcode

        } else {
//nothing to do
        }
    }

private boolean canAll() {
        return (canAccessLocation() && canCoarseLocation() && canGetAccounts());
    }
Vyacheslav
  • 26,359
  • 19
  • 112
  • 194
1

I got the weird solution

In your build gradle must have the targetsdkversion. I am removing for the development purpose.so fragment reloading stops after adding that.

Pratik Gondil
  • 689
  • 1
  • 6
  • 17