I am new to Android development and I want first to get the Hello World
application running.
I am using Eclipse IDE and the Android 4.0.3 version 15 SDK. I copi
It is due to android:targetSdkVersion="@string/app_name"
in your manifiest file.
Change it to:
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="15"/>
The targetSdkVersion
should be an integer, but @string/app_name
would be a string. I think this causing the error.
EDIT:
You have to add a default intent-filter
in your manifiest
file for the activity. Then only android can launch the activity. otherwise you will get the below error in your console window.
[2012-02-02 09:17:39 - Test] No Launcher activity found!
[2012-02-02 09:17:39 - Test] The launch will only sync the application package on the device!
Add the following to your <activity>
tag.
<activity android:name="HelloAndroid" android:launchMode="standard" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
In my case I edited a project having this in the AndroidManifest.xml file, and which was ginving me the above error, at runtime:
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
What I did just, was to change minSdkVersion="17", to minSdkVersion="16". My resulting tag was:
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="17" />
Now I'm not getting the error anymore..
Hope this helps
I am on Android Studio. I got this error when min/targetSDKVersion were set to 17. While looking thro this thread, I tried to change the minSDKVersion, voila..problem fixed. Go figure.. :(
android:minSdkVersion="17"
android:targetSdkVersion="17" />
This error occurs when the sdk-version installed on your device (real or virtual device) is smaller than android:minSdkVersion
in your android manifest.
You either have to decrease your android:minSdkVersion
or you have to specify a higher api-version for your AVD.
Keep in mind, that it is not always trivial to decrease android:minSdkVersion
as you have to make sure, your app cares about the actual installed API and uses the correct methods:
AsyncTask<String, Object, String> task = new AsyncTask<String, Object, String>() {
@Override
protected Boolean doInBackground(String... params) {
if (params == null) return "";
StringBuilder b = new StringBuilder();
for (String p : params) {
b.append(p);
}
return b.toString();
}
};
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,"Hello", " ", "world!");
} else {
task.execute("Hello", " ", "world!");
}
Using the android-support-library and/or libraries like actionbar-sherlock will help you dealing especially with widgets of older versions.
If you are totally new like me, you must install the minimum SDK at first. Check the link.
This worked out perfectly for me:
Same problem other post with a good solution
Regards,
Khaled.
This means the version of android of your avd is older than the version being used to compile the code