我有一个库项目,我有资产/字体/ Roboto – * .ttf文件.我已经完成了关于这个主题的其他问题,所有这些都提示拼写检查或文件夹检查(应该在资产/字体下).似乎没有一个问题.此代码适用于Android.
我在这里错过了什么?
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 made05-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.access0(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 made05-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解决方法 刚刚在androID文档中找到了这个.凉.我将Fonts文件夹移出了库项目并进入了应用程序项目,一切正常.
总结library projects cannot include raw assets
The tools do not support the use of raw asset files (saved in the assets/ directory) in a library project. Any asset resources used by an application must be stored in the assets/ directory of the application project itself. However,resource files saved in the res/ directory are supported.
以上是内存溢出为你收集整理的android – nokiax报告java.lang.RuntimeException:无法生成本机字体全部内容,希望文章能够帮你解决android – nokiax报告java.lang.RuntimeException:无法生成本机字体所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)