Nokiax reports java.lang.RuntimeException: native font could not be created

NokiaX reports this exception for fonts used.

I have a library project in which I have assets/fonts/Roboto-*.ttf files. I considered other questions on this topic, they all hint at spell checking or folder checking (should be under assets/fonts ). None of them seem to be a problem. This code works well with Android.

What am I missing here?

 05-04 10:19:49.430: E/Crittercism(17208): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.taxeeta.nokiax/com.taxeeta.SplashScreen}: java.lang.RuntimeException: native typeface cannot be made 05-04 10:19:49.430: E/Crittercism(17208): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2067) 05-04 10:19:49.430: E/Crittercism(17208): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2092) 05-04 10:19:49.430: E/Crittercism(17208): at android.app.ActivityThread.access$600(ActivityThread.java:133) 05-04 10:19:49.430: E/Crittercism(17208): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1203) 05-04 10:19:49.430: E/Crittercism(17208): at android.os.Handler.dispatchMessage(Handler.java:99) 05-04 10:19:49.430: E/Crittercism(17208): at android.os.Looper.loop(Looper.java:137) 05-04 10:19:49.430: E/Crittercism(17208): at android.app.ActivityThread.main(ActivityThread.java:4807) 05-04 10:19:49.430: E/Crittercism(17208): at java.lang.reflect.Method.invokeNative(Native Method) 05-04 10:19:49.430: E/Crittercism(17208): at java.lang.reflect.Method.invoke(Method.java:511) 05-04 10:19:49.430: E/Crittercism(17208): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) 05-04 10:19:49.430: E/Crittercism(17208): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:559) 05-04 10:19:49.430: E/Crittercism(17208): at dalvik.system.NativeStart.main(Native Method) 05-04 10:19:49.430: E/Crittercism(17208): Caused by: java.lang.RuntimeException: native typeface cannot be made 05-04 10:19:49.430: E/Crittercism(17208): at android.graphics.Typeface.<init>(Typeface.java:175) 05-04 10:19:49.430: E/Crittercism(17208): at android.graphics.Typeface.createFromAsset(Typeface.java:149) 05-04 10:19:49.430: E/Crittercism(17208): at com.taxeeta.support.FontUtils.setRobotoFont(FontUtils.java:14) 05-04 10:19:49.430: E/Crittercism(17208): at com.taxeeta.SplashScreen.onCreate(SplashScreen.java:165) 05-04 10:19:49.430: E/Crittercism(17208): at android.app.Activity.performCreate(Activity.java:5180) 05-04 10:19:49.430: E/Crittercism(17208): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094) 05-04 10:19:49.430: E/Crittercism(17208): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2031) 05-04 10:19:49.430: E/Crittercism(17208): ... 11 more 
+6
source share
1 answer

Just found this in android docs. Cool. I moved the font folder from the library project to the application project, and everything was fine.

Library projects cannot include source assets

The tools do not support the use of source resource files (stored in the assets / directory) in the library project. Any resource resources used by the application must be stored in the assets / application directory of the application project itself. However, resource files stored in the res / directory are supported.

+6
source

All Articles