Reputation: 5839
I try to import acra http://code.google.com/p/acra/source/checkout to eclipse but the eclipse assume that it is standard java project so eclipse show me errors in imports
import android.app.Application;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.preference.PreferenceManager;
import android.util.Log;
I mean any import related to Android causes errors, What is the ideal method to open acra source code in IDE ?
Upvotes: 4
Views: 365
Reputation: 15619
There is a difference between Java projects and Android projects in Eclipse. The project should be an Android project in order to resolve the Android imports properly. First make sure you have:
Then in Eclipse go to menu File > Import
, select Android
and then Existing Android code into workspace
Alternatively you can try the dirty way and change your existing .project
file to something like this
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ACRA</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Upvotes: 1