Reputation: 3627
I have encountered an odd problem after I copied my Exclipse project.
In my workspace I have "my_base_project". When done, I wanted to create a copy of the project for a specific customer, so I copied the folder into same workspace root with folder name being "my_spinoff_project".
I then search and replaced all text strings "com.example.base" to "com.example.spinoff" in .java and .xml files. I then imported in Eclipse and got this far error free.
However, when running I get this error:
java.lang.RuntimeException: Unable to instantiate application com.example.spinoff.MicApp: java.lang.ClassNotFoundException: com.example.spinoff.MicApp
From AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.spinoff"
android:versionCode="1"
android:versionName="0.1"
>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17"
/>
<uses-permission android:name="com.example.spinoff.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<application
android:allowBackup="true"
android:icon="@drawable/replace__logo__app_110_110"
android:label="@string/MicAppName"
android:theme="@style/MicTheme"
android:name="com.example.spinoff.MicApp"
>
<uses-library
android:name="com.google.android.maps"
android:required="false"
/>
<activity android:name="com.example.spinoff.Main" android:label="@string/MicMainName" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.example.spinoff.Prefs" android:label="@string/titlePreferences" />
<activity android:name="com.example.spinoff.Browser" android:label="@string/titleBrowser">
</activity>
<activity android:name="com.example.spinoff.Contact" android:label="@string/titleContact" />
<activity android:name="com.example.spinoff.News" android:label="@string/titleNews" />
<activity android:name="com.example.spinoff.Catalog" android:label="@string/titleCatalog" />
<activity android:name="com.example.spinoff.Visit" android:label="@string/titleLinks" />
<activity android:name="com.example.spinoff.MSGallery" android:label="@string/titleGallery"
android:configChanges="orientation|keyboardHidden|screenSize"
/>
<activity android:name="com.example.spinoff.MSMap" android:label="@string/titleMaps" />
<activity android:name="com.example.spinoff.MSCalendar" android:label="@string/titleCalendar" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="" />
</application>
</manifest>
So... I don't understand that error. It can compile and run the project. Project just halts very early on when running with above error. Have I somehow missed replacing some text strings somewhere?
Upvotes: 1
Views: 244
Reputation: 4108
Go to Properties/ Java Build Path/ Libraries/ Add External JARs. Check the Jar files in the Properties/ Java Build Path/ Order and Export.
Upvotes: 4
Reputation: 1849
Use Right Click on your Project in Package explorer>Android Tools> Rename Application Package to do this.
Ensure that your Spinoff copy builds correctly before you do the app package rename.
Upvotes: 1