在Android的应用程序改变的名称之后的ClassNotFoundException [英] ClassNotFoundException after changing app's name in Android

查看:153
本文介绍了在Android的应用程序改变的名称之后的ClassNotFoundException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为 com.quarlityaq.quarlityaqcall.QuarlityaqCall

完成编程后我已经改变了应用程序的名称为JCall就业
通过更改 APP_NAME 的strings.xml 来JCall就业

After finishing programming I've changed the app name to "JCall for jobs" by changing app_name under strings.xml to "JCall for jobs"

android:label="@string/app_name"   
android:name="@string/app_name"

在我的设备,它工作得很好,但在其他一些设备崩溃并引发:

On my device it works just fine, but on some other devices it crashes and throws:

java.lang.RuntimeException: Unable to instantiate application com.quarlityaqcall.QuarlityaqCall.JCall for jobs: 
java.lang.ClassNotFoundException: com.quarlityaqcall.QuarlityaqCall.JCall for jobs 
in loader dalvik.system.PathClassLoader[/data/app-private/com.quarlityaqcall.QuarlityaqCall-1.apk]


Caused by: java.lang.ClassNotFoundException: 
com.quarlityaqcall.QuarlityaqCall.JCall for jobs in loader
dalvik.system.PathClassLoader[/data/app-private/com.quarlityaqcall.QuarlityaqCall-1.apk]

我不明白为什么它会查找类名JCall就业而不是QuarlityaqCall,为什么它只发生在某些设备上?

I don't understand why it looks for the class name "JCall for jobs" instead of "QuarlityaqCall", and why it only happens on some devices?

推荐答案

在清单应用程序名称指的是您的应用程序类。如果你还没有实现自己的应用程序类,你不应该有name属性在您的清单文件。如果你已经实现了一个单位部门应确保该属性指向正确的类。

Application name in manifest refers to your Application class. If you have not implemented your own Application class you should not have name attribute in in your manifest file. If you have implemented one ou should make sure that the attribute refers to correct class.

您不能导出name属性strings.xml中,因为它是为您的应用技术参数。标签是一个对用户是可见的。

You should not export the name attribute to strings.xml as it is a technical parameter for your app. Label is the one that is visible to users.

这篇关于在Android的应用程序改变的名称之后的ClassNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆