0

I've implemented this solution in my app:

https://stackoverflow.com/a/708317/290043

And now that I my app won't start anymore. Here from the catlog:

Starting activity com.example.css.cih.ActivityMain on device 015d2994a6280018
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.css.cih/.ActivityMain }
ActivityManager: Error type 3
ActivityManager: Error: Activity class {com.example.css.cih/com.example.css.cih.ActivityMain} does not exist.

I did add the manifest element as stated in that question:

<application
    android:name="com.example.css.cih.MyApp"
    android:allowBackup="false"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
</application>

And, the class:

import android.app.Application;

public class MyApp extends Application {
    public boolean isCbpProject;
    public boolean isMrProject;
}

I should state that the app ran as expected before I implemented that solution.

Community
  • 1
  • 1
  • What is your main Activity's name? Is it really `ActivityMain` or the default `MainActivity`? – Sam Jan 03 '13 at 00:59
  • Hmm, do you have any `` tags inside your `` tag in your real manifest? – Sam Jan 03 '13 at 01:05
  • No, there are no activities in application. –  Jan 03 '13 at 01:06
  • Ah, I see. I need to move the `android:name` into the activity that already existed. Thanks for the help Sam! :) –  Jan 03 '13 at 01:08

2 Answers2

1

You need to use your existing <application> tags with at least one <activity> tag inside it.

<application
    android:name="com.example.css.cih.MyApp"
    android:allowBackup="false"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >

    <!-- Activity declaration here -->
    <activity android:name=".ActivityMain" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>
Sam
  • 86,580
  • 20
  • 181
  • 179
0

Check "android:installLocation" in your AndroidManifest.xml.

"preferExternal" will cause the problem.Like this:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="com.yourpackagename"
   android:installLocation="auto"
   android:versionCode="*"
   android:versionName="*" >
wangqi060934
  • 1,552
  • 16
  • 23