简体   繁体   English

将一个类从一个应用程序复制到另一个应用程序后,Android发出ClassNotFoundException异常

[英]ClassNotFoundException android after copy a class from one app to another one

I am programming two applications; 我正在编写两个应用程序; I have used some Classes from one of these applications into the other one. 我已经从这些应用程序中的一个到另一个应用程序中使用了一些类。 When I tried to instance the class it shows ClassNotFoundException. 当我尝试实例化该类时,它显示ClassNotFoundException。 (It's not an Activity Class) when it show me the error I notice that the path to the class it has used is from the first app. (这不是活动类),当它显示错误时,我注意到它使用的类的路径来自第一个应用程序。 The Class is inside my new app package. 该类位于我的新应用程序包中。 What can i do? 我能做什么? Help me please 请帮帮我

This may be obvius but, if you copied the files directly in the filesyste (outside eclipse) you have to do a File Refresh and then a Project clean inside eclipse for it to take the changes. 这可能很麻烦,但是,如果直接将文件复制到filesyste(Eclipse外)中,则必须先执行File Refresh(文件刷新),然后在Eclipse内部进行Project清洁,以使更改生效。

If you copied the classes inside eclipse, check that the import statements where you are using the classes are ok (referencing the correct project). 如果您在eclipse中复制了类,请检查使用这些类的import语句是否正确(引用正确的项目)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将数据从一个对象从一个类复制到Android中另一个类的另一个项目 - Copy data from one object from one class to another boject in another class in Android 将数据库从一个应用程序复制到另一个应用程序 - Copy database from one app to another app 将大多数属性从一个 class object 复制到另一个 class - Copy most attributes from one class object to another class Java-将静态arrayList从一个类复制到另一个类的HashMap - Java - copy static arrayList from one class to a HashMap in another class 将值从一个类传递到另一个android - passing values from one class to another android Android从一个应用转移到另一个 - Android moving from one app to another 在一个类中设置一个值并从Java中的另一个类中检索(Android应用程序) - Setting a value in one class and retrieving from another class in Java (Android app) 如何在Java中将数组列表从一个类复制到另一个类? - How do I copy an arraylist from one class to another in Java? 通过反射将一个 class 中字段的所有值复制到另一个 - Copy all values from fields in one class to another through reflection 将 java 对象/类从一个类加载器复制到另一个类加载器 - Copy java object/class from one classloader to another classloader
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM