I updated the Android Studio to version 3.1 and the Gradle for my Project to version 3.1.0.
Since then I had some problems related to merging multiple files, but that I was able to solve.
Then I had this error:
> Manifest merger failed :
Attribute activity#com.aware.ui.PermissionsHandler#launchMode
value=(singleTop) from [com.awareframework:aware-core:4.0.555]
AndroidManifest.xml:35:13-43 is also present at
[com.github.denzilferreira:aware-client:4.0.555]
AndroidManifest.xml:44:13-42 value=(standard).
Suggestion: add 'tools:replace="android:launchMode"' to <activity>
element at AndroidManifest.xml:30:9-37:66 to override.
So, first I tried to use tools:replace="android:launchMode" inside the mentioned Activity:
<activity android:name=".MainActivity"
...
tools:replace="android:launchMode"
android:launchMode="standard">
</activity>
But it did not solve the problem, then I searched and found some similar questions and their responses.
One of them said to delete the proposed attribute from the libraries that were conflicting:
<activity
android:name="com.aware.ui.PermissionsHandler"
android:configChanges="keyboardHidden|orientation|screenSize"
android:excludeFromRecents="true"
android:exported="true"
android:launchMode="singleTop" //deleted this line from Manifests
android:noHistory="true"
android:theme="#style/Theme.AppCompat.Translucent" />
But again, with no success. I also tried to use tools:replace="android:launchMode" inside the application tag:
<application
...
tools:replace="android:launchMode">
An then use the android:launchMode="standard" inside the activity tag.
<activity android:name=".MainActivity"
....
android:launchMode="standard">
</activity>
But it throws a different error:
tools:replace specified at line:16 for attribute android:launchMode,
but no new value specified
I also tried to reorder the dependencies inside the Gradle files, like #GLee answered here but it did not make any difference.
This is one of the libraries I'm using that is conflicting: Aware Activity Recognition Plugin.
And this is the tutorial I used to create the application: Creating a standalone application.
Another relevant thing to say is that the two dependencies conflicting are in different modules, the com.awareframework:aware-core:4.0.555 dependency is inside the app module and the com.github.denzilferreira:aware-client:4.0.555 is inside the activity_recognition module.
Finally, this is my App Gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "app.miti.com.iot_reduce_daily_stress_application"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
...
}
dependencies {
...
implementation "com.awareframework:aware-core:${aware_libs}"
implementation "com.android.support:appcompat-v7:${support_libs}"
implementation "com.android.support:cardview-v7:${support_libs}"
implementation "com.google.android.gms:play-services-location:${gms_libs}"
implementation "com.google.android.gms:play-services-maps:${gms_libs}"
implementation "com.google.android.gms:play-services-places:${gms_libs}"
implementation 'com.android.support:preference-v14:${support_libs}'
implementation "com.android.support:design:${support_libs}"
implementation 'pub.devrel:easypermissions:1.2.0'
implementation 'com.android.support:multidex:1.0.3'
implementation "com.google.firebase:firebase-core:${firebase_libs}"
implementation "com.google.firebase:firebase-messaging:${firebase_libs}"
...
}
And this is my activity_recognition module Gradle file:
apply plugin: 'com.android.library'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 19
targetSdkVersion 27
versionCode version_code
versionName version_readable
multiDexEnabled true
}
...
}
dependencies {
...
implementation "com.google.android.gms:play-services-location:${google_libs}"
implementation "com.android.support:appcompat-v7:${support_libs}"
api "com.github.denzilferreira:aware-client:${aware_libs}"
implementation "com.koushikdutta.ion:ion:2.1.6"
implementation "org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2"
}
This is the App AndroidManifest.xml (error URL directs to this file):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="app.miti.com.iot_reduce_daily_stress_application">
... //permissions
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:name="android.support.multidex.MultiDexApplication">
<activity android:name=".MainActivity"
android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SettingsActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:parentActivityName=".MainActivity"
tools:ignore="UnusedAttribute">
</activity>
</application>
</manifest>
Since this is not a dependencies version problem, like many other questions I found, and because I have to use this library dependencies in my Project, how can I solve this problem?
P.S: I have already tried the usual methods:
Invalidate Caches/Restart
Deleted Gradle
Clean Project and Rebuild Project
...
The problem is with com.aware.ui.PermissionsHandler, which is why putting attributes on .MainActivity will not help, as that is a different activity. Since you are using artifacts in your posted Gradle files, I'm not sure where you were modifying the manifests of the libraries.
In your app's manifest, add:
<activity
android:name="com.aware.ui.PermissionsHandler"
android:launchMode="..."
tools:replace="android:launchMode"
/>
where ... is your desired launchMode value, perhaps after some discussion with the developers of those libraries to determine what the right answer is.
You shouldn't need any other attributes or child elements — they should all get merged in via the manifest merger process.
Related
I am having a build issue with the following error code:
A problem was found with the configuration of task ':app:processDebugManifest' (type 'ProcessMultiApkApplicationManifest').
File 'E:\DK\app\build\intermediates\merged_manifest\debug\out\AndroidManifest.xml' specified for property 'mainMergedManifest' does not exist.
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.sample"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:26.1.0')
// Declare the dependency for the Firebase Authentication library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.android.material:material:1.2.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.5'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.firebase:firebase-database:19.5.1'
implementation 'com.google.firebase:firebase-storage:19.2.0'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.google.gms:google-services:4.3.4'
implementation 'androidx.browser:browser:1.2.0'
}
apply plugin: 'com.google.gms.google-services'
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sample">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/logo"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".Activities.SplashActivity"
android:theme="#style/AppTheme.Launcher"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="portrait"
android:configChanges="orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activities.LoginActivity"
android:screenOrientation="portrait"
android:configChanges="orientation"/>
<activity android:name=".Activities.MainActivity"
android:windowSoftInputMode="adjustPan"
android:screenOrientation="portrait"
android:configChanges="orientation"/>
<activity android:name=".Activities.SignUpActivity"
android:screenOrientation="portrait"
android:configChanges="orientation"/>
<activity android:name=".Activities.DebugActivity"
android:screenOrientation="portrait"
android:configChanges="orientation"/>
</application>
I am new to this and I can't seem to figure out what the issue may be.
We are working on an application together and noone seems to know the issue.
We are beginners, with little to no experience.
In your build.gradle, you have these 2 lines:
compileSdkVersion 29
and
targetSdkVersion 29
The error you have shown occurs when that sdk version is not installed or does not match that of the API version on the virtual device (assuming you are using the emulator).
There are 2 things to check:
In Tools->SDK Manager, check what SDK version is installed. Your project is compiling for SDK version 29, so if you don't have 29 installed and want to use that, install it. Or if you have version 30 installed, simply change those 2 lines in your build.gradle from "29" to "30".
In Tools->AVD Manager, check the API level of your virtual device. Does it match? If not, create a new device that matches, or just simply install the matching API or change the 2 lines of code as described above.
Also, for this line:
minSdkVersion 21
Make sure SDK version 21 is installed too.
I was getting same error :
"app\build\intermediates\merged_manifest\debug\out\AndroidManifest.xml' specified for property 'mainMergedManifest' does not exist."
Solution:
Update Project Structure
Update in the Project Structure->Module->Properties
Compile SDK Version= 30 (API 30 Android 11.0(R))
Build tools verision= 30 .0.2
Update in the Project Structure->Module->Default Config
Target SDK Version = 30 (API 30 Android 11.0(R))
Update 2 files as the next:
file: build.gradle
classpath "com.android.tools.build:gradle:4.0.2"
file: gradle-wrapper.properties
Line:
distributionUrl=https://services.gradle.org/distributions/gradle-6.4.1-bin.zip
here are the video with the solution Step 2
https://www.youtube.com/watch?v=U420dx6C60I
SPANISH: ¿Problema con React Native?
Resolví el error moviendo el proyecto al disco C: y además usar el mismo SDK que recomiendan en la documentación de React Native.
ENGLISH: From React Native?
I solved this, moving my project to local disk C:, make sure you have the same SDK that de documentation recommends.
I keep getting this message on all of my projects which were previously working as of yesterday: "Error running 'app': Default Activity not found"
Sorry, I've read similar posts with the same issue but haven't figured out a solution. It's not the Manifest files because I've compared them to the ones in other posts. I've pulled up two projects from about a week ago and those won't work now either.
Build --> Clean Project didn't work.
I've also tried this two or three times: File---->Invalidate Caches/Restart. Click on it and choose Invalidate Caches/Restart
I installed an update yesterday. I'm not sure what to do, I'd appreciate any help/feedback. I'm new to android studio, so please feel free to over simplify lol. :)
Here's the code I have in the AndroidManifest.xml through a project I made through a Udacity course. This one has the same error as the other projects:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.birthdaycard">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Here's the Android Manifest file from a new project (comparing two toys - yes, I'm an adult who collects toys lol) same issue:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.example.newapplication">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".BarbieOne">
</activity>
<activity android:name=".BarbieTwo">
</activity>
</application>
Here's the build.gradle (Module:app) for the same project - Sorry, not sure if this was the right build gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "android.example.newapplication"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-
optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'
}
Bro Let me explain first about your problem. Few months ago I faced same problem that's mean you want to run your app but build shows error like Default Activity not found. while before this problem your code was running very well.I know you tried lots of answer but in new studio may be from 3.0 this problem may be occurred.Some time studio does not read your launcher code from manifest file of app. OK now you have two choices.
Before this try to Rebuild, Invalidate and clean project one time again.
First Choice
Try to add one or two new activity and make them launcher one by one may be android studio read your launcher code in manifest file and you can run your app.
Note: It works only your luck.
Second choice
You can copy your code paste in new project.
Note: This is last option.
Hope so You have great luck.
I recently tried to edit my 4 year old android application in the recently appeared Android Studio 2.3.1.
After importing the code I can launch it on my mobile phone. However the action bar seems to have disappeared. What has gone wrong?
How can I tell android to display the action bar?
I have implemented the action bar activity like this:
public class MainActivity extends ActionBarActivity
My build.gradle looks like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "de.my.app"
minSdkVersion 8
targetSdkVersion 17
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:18.0.0'
}
I also tried to replace the compile command with something newer one:
compile 'com.android.support:appcompat-v7:25.3.1'
but already the syncing in android studio fails like this, throwing the following error:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library [com.android.support:appcompat-v7:25.3.1] /home/user/.android/build-cache/815cafa5312f1d889eb1134b2184a62b3f88d8a3/output/AndroidManifest.xml
Suggestion: use tools:overrideLibrary="android.support.v7.appcompat" to force usage
I haven't done much android coding in the last 4 years so I assume the ActionBar stuff has changed profoundly but shouldn't there be a way to compile the old code as it is using android studio?
Edit:
This is the manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.myApp.myAppDemo"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/icon_app"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="de.myApp.myAppDemo.Splash"
android:label="#string/app_name"
android:screenOrientation="landscape" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="de.myApp.myAppDemo.MainActivity"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:theme="#style/Theme.AppCompat.Light">
<intent-filter>
<action android:name="de.myApp.myAppDemo.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="de.myApp.myAppDemo.PropertiesAssign"
android:label="#string/app_name"
android:screenOrientation="landscape" >
<intent-filter>
<action android:name="de.myApp.myAppDemo.PROPERTIESASSIGN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="de.myApp.myAppDemo.PropertiesView"
android:label="#string/app_name"
android:screenOrientation="landscape" >
<intent-filter>
<action android:name="de.myApp.myAppDemo.PROPERTIESVIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Meanwhile I got at least the ActionBar to be displayed. However I had to increase the MinSDK and targetSdkVersion / compileSdkVersion bigly: From 8,17 to 15,23. Moreover I had to look in the SDK-Manager to see which exact version of Android Support Library was installed on my system (23.2.0) and adapt the corresponding line in build.gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23 //->modified
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "de.Geo.geodraw"
minSdkVersion 15 //->modified
targetSdkVersion 23 //->modified
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile "com.android.support:appcompat-v7:23.2.0" //->modified
}
Not sure whether it was relevant or necessary but following this page I also added
allprojects {
repositories {
jcenter()
maven { //->modified
url "https://maven.google.com" //->modified
} //->modified
}
}
in another build.gradle file.
If there is another solution without drastically changing minSdk and targetSdk I will accept that answer.
I published an Android app on the google play store but it says that it is incompatible with ALL devices:
Why is this? Just before this, I published another app and it really wasn't that much different from this one but it is compatible with almost all devices.
This is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.yy" >
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/app"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- register our ContentProvider -->
<provider
android:name=".data.app"
android:authorities="#string/content_authority"
android:exported="false"
android:syncable="true" />
<activity
android:name=".DetailActivity"
android:label="#string/title_activity_detail"
android:parentActivityName=".FavoritesActivity"
android:launchMode="singleTask">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xxx.yyy.MainActivity" />
>
</activity>
<activity
android:name=".FavoritesActivity"
android:label="#string/title_activity_favorites"
android:parentActivityName=".MainActivity"
android:launchMode="singleTask">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xxx.yyy.MainActivity" />
</activity>
</application>
</manifest>
And this is my gradle.build file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.xxx.yy"
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'org.json:json:20150729'
compile 'org.apache.directory.studio:org.apache.commons.codec:1.8'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'com.android.support:design:22.2.0'
}
I'm really lost here because I only have one permission, INTERNET..
I found out the culprit!
It was this line in my gradle file:
compile 'org.apache.directory.studio:org.apache.commons.codec:1.8'
This weird: Native platforms thing was showing up before all because of that gradle dependency!
Which does not make sense for me... I guess I have to find another dependency or something. Could someone explain to me why a dependency like that would cause this to happen?
I removed that line and upon reuploading my APK I now see this:
You appear to have an extra > in your manifest --
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.xxx.yyy.MainActivity" />
> <==== DELETE THIS
</activity>
<activity
Not sure why your even able to make a build with that, but I tested a similar scenario and it made an APK for me. I would guess when you upload the .apk that is messing with google play's parsing for device compatibility.
Im using AndroidStudio and Im trying to put some ads on my app, according to the setting up google play API - https://developer.android.com/google/play-services/setup.html
Adter i sync the project with the grandle files i get this error:
Error:Failed to find: com.google.android.gms:play-services:5.0.77
Install Repository and sync project<br>Open File<br>Open in Project Structure dialog
This is my gradle.build:
apply plugin: 'com.android.application'
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.pachu.fartsounds"
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
compile 'com.google.android.gms:play-services:5.0.77'
}
My Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pachu.fartsounds">
<application
android:allowBackup="true"
android:icon="#drawable/fart_icon"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".FartActivity"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Any ideas? Thanks !
You are missing critical components of your manifest. The SDK error you are receiving is because the compiler doesn't know at what SDK level to compile your app - you're missing <uses-sdk.
And while we're at it, you're also missing your package name, version name, and version code. These are all critical components to your app. Here's an example of a well-formed manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.exampleapp"
android:versionCode="2"
android:versionName="v0.2-Alpha" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.GET_TASKS" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.exampleapp.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:enabled="true" android:name="com.example.exampleapp.MyService" />
</application>
</manifest>
Notice at the very top: the sections that read package, android:versionCode, and android:versionName. And also, below those, the entire section that starts with <uses-sdk... These are all required.
Add this to your build.gradle:
android {
compileSdkVersion 20
buildToolsVersion '20.0.0'
}
I had the same issue and fixed it next way:
in build.gradle file of module (usually in app, not in root project directory) I set
android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 19
// your application version and id settings
}
where 19 - is and SDK I have completely loaded in Android SDK Manager
(same values checked in Studio module settings, Properties and Flavors tabs).
So, may be your problem is a cause of minSdkVersion 8 value, when you don't have 8 API installed.
I had the same error.
In my case the package 'Extras\Google Repository' was not installed.
So after installing it in SDK Manager the problem had gone.