android 纯 java项目,在Android项目引用(纯Java)项目(找不到类)

I am trying to reference a pure java-Project in my Android-Project -> The Java-Project has a whole bunch of classes I need to use. Oh, and as the first response pointed out: I am using eclipse, yes :)

Only Problem is: I Always get Could not find class 'XXX', referenced from method com.example.helloworld.MainActivity.onCreate. I seem to have missed SOME step or error...?

What I already did:

The Project is added as Project into the Java Build Path (logically nessecary)

It is marked in "Order and Export" in the Java Build Path and pushed to the top (this solved the problem for someone else here when dealing with Jar-files)

Ir is marked in "Project References" on Project settings.

I added the folder where the relevant class is under "Libraries" in build Path... I am not sure if that should be nessecary.

The Java-Project I reference has a whole load of Jars, but if that is the reason, should I not get a different errormessage?

解决方案

I had the same issue and after some hours of frustration and search I have finally found the answer here:

Android, class not found from imported jar file

Basically, the issue was that the referenced pure-java project or the generated jar was built with Java 1.7, and Android projects are set to use 1.6.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值