I have an AVD emulator set at API 18 and my manifest is as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="pushpindesigns.com.lines"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="12" android:targetSdkVersion="20"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".mainActivity"
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>
<activity
android:name=".Level_1"
android:label="#string/title_activity_level_1" >
</activity>
</application>
Updated build.gradle file that includes the compilesdkversion = 18
apply plugin: 'com.android.application'
android {
compileSdkVersion 18
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "pushpindesigns.com.lines"
minSdkVersion 8
targetSdkVersion 'L'
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.+'
}
Code above is updated and still doesn't work.................Let me know what you think
Replace android-L with something else -- 20 or 19 would be likely choices. The "L" Developer Preview will not work on anything but "L"-equipped devices and emulators.
Also, the targetSdkVersion in your build.gradle overrides that which is in your manifest. Replace the targetSdkVersion in your build.gradle to 20.
Related
I use Android studio & gradle v2.2.3 and have tried to merge manifests from src/main folder and src/androidTest or src/debug folders.
This is manifest from main folder:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.beloo.chipslayoutmanager.sample"
>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:name="com.beloo.chipslayoutmanager.sample.Application"
>
<activity android:name="com.beloo.chipslayoutmanager.sample.ui.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
and from androidTest or debug folder (no matter where it is located):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.beloo.chipslayoutmanager.sample">
<application
android:allowBackup="true"
android:label="#string/app_name"
android:supportsRtl="true"
android:name="com.beloo.chipslayoutmanager.sample.Application"
>
<activity
android:name="com.beloo.chipslayoutmanager.sample.ui.TestActivity"/>
</application>
The problem is that manifest from debug or androidTest folder is completely ignored. But i try to declare TestActivity only in the test manifest. Result manifest after merge is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.beloo.chipslayoutmanager.sample"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="25" />
<application
android:name="com.beloo.chipslayoutmanager.sample.Application"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity android:name="com.beloo.chipslayoutmanager.sample.ui.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Also any mention about missed manifest doesn't present in manifest-merger-debug-report. There are only main and libraries manifests.
also android part of app build.gradle:
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
testBuildType "debug"
defaultConfig {
applicationId "com.beloo.chipslayoutmanager.sample"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
As you see i've tried to mention explicitly testBuildType "debug" here, that haven't help.
and project build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
project.ext {
compileSdkVersion = 25
buildToolsVersion = "25.0.2"
minSdkVersion = 15
targetSdkVersion = 25
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Maybe you will be able to see my mistake, because i can't.
I have added a new dependency to my build.grade.after adding there is a error in my manifest.XML.the error is ERROR PARSING XML: UNBOUND PREFIX
Here is my manifest.XML
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ravakri.wm" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
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>
<provider
android:authorities="com.ravakri.wm.notesprovider"
android:name=".NotesProvider"
android:exported="false"/>
</application>
</manifest>
Here is my build.grade
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
applicationId "com.ravakri.wm"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
compile 'it.neokree:MaterialTabs:0.11'
}
Thanks in advance
manifest tag is not closed add
</manifest>
in the last line of your manifest file
I have recently finished building my first android app. I published it to the store today but it says it supports 0 devices. Here is my manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.guessthepicturespazam.guessit" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="נחש את המילה"
android:theme="#style/Theme.AppCompat.NoActionBar" >
<activity
android:name=".MainActivity"
android:configChanges="orientation"
android:label="נחש את המילה"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".GameActivity"
android:configChanges="orientation"
android:label="#string/title_activity_game"
android:screenOrientation="portrait" >
</activity>
<activity
android:name=".Splash"
android:configChanges="orientation"
android:label="נחש את המילה"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".StoreActivity"
android:label="#string/title_activity_store" >
</activity>
<activity
android:name=".GameOverActivity"
android:label="#string/title_activity_game_over" >
</activity>
</application>
<supports-screens
android:anyDensity="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:resizeable="true" />
</manifest>
This is my build.grade file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.GuessTheWordZahal.guessit"
minSdkVersion 10
targetSdkVersion 23
versionCode 2
versionName "1.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
compile 'com.google.android.gms:play-services-ads:7.8.0'
}
I tried looking this problem up online but I couldn't find a problem similar to mine. Most apps have no supported devices because they use features that are only available in some or in no devices. I just can't figure out what's wrong in mine. I've actually tested this app on my samsung galaxy and it worked fine.
You need to provide supported sdkVersion
<uses-sdk
android:minSdkVersion="minimum(e.g "8")"
android:targetSdkVersion="maximum(e.g "22")" />
if you are using Eclipse then mention your minSdkVersion & maxSdkVersion in your manifest file and if you are using Android Studio then mention these in build.gradle file.
For Eclipse
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.guessthepicturespazam.guessit"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="21"/>
.......................
</manifest>
For Android Studio
edit your build.gradle file like as below
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.guessthepicturespazam.guessit"
minSdkVersion 8
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Note: Version name and Version code is important if you want to update your application in future.
Your manifest is incorrect.
<supports-screens>
is currently placed in application tag but should be moved up, to manifest tag.
Check out manifest structure https://developer.android.com/guide/topics/manifest/manifest-intro.html#filestruct
I suppose play-store parser couldn't find supports-screens information and decided that there is no screen supported. Please, correct manifest and let us know. Very interesting issue.
gradle placeholder support problem :
my placeholder looks like ${com.nssb.zssb}
how can gradle deal with this situation, I tried the following command:
manifestPlaceholders = [com.nssb.zssb:"djdssb"]
but it didnt worked. any suggestion? many thanks~~~~~
my mainifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="differentbuild.com.mike.differentbuild" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="${com.nssb.zssb}"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="${com.nssb.zssb}" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SecondActivity"
android:label="${com.nssb.zssb}" >
</activity>
</application>
</manifest>
my build gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "differentbuild.com.mike.differentbuild"
minSdkVersion 19
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
production {
applicationId "differentbuild.com.mike.differentbuild"
manifestPlaceholders = [com.nssb.zssb:"SecondActivity"]
versionName "1.0-pro"
}
pros {
applicationId "differentbuild.com.mike.differentbuild"
manifestPlaceholders = [com.nssb.zssb:"SecondActivity111"]
versionName "1.0.1-pro"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
}
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.