I am building a demo app using actionbar sherlock in android studio and i was facing problem , mentioned in following link :-
Previous Problem
now after following the replies posted on above link i did some changes and now i am facing this
Gradle: Execution failed for task ':SherlockTest:processDebugManifest'.
> Manifest merging failed. See console for more info.
my application manifest file is :-
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sherlocktest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="16" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.sherlocktest.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>
</application>
</manifest>
and actionbar sherlock manifest file is :-
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="440"
android:versionName="4.4.0"
package="com.actionbarsherlock">
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="16"/>
<application/>
</manifest>
i am not able to figure out what is the problem here, please help
Make sure that in all your build.gradle scripts the minSdkVersion and targetSdkVersion correspond to those you have in your manifests:
android {
defaultConfig {
minSdkVersion 10
targetSdkVersion 16
}
}
This worked for me, I hope it does the trick for you, cheers.
For what I can see, if you have a multi-module project with Android Studio and gradle, the IDE try to merge manifest files from every module into a Main manifest.
If you have a module A and a module B, and in the A manifest you declare some activity from B module, gradle will enconter a issue when merging.
Try removing cross-module reference in manifest files.
That worked for me when adding the Google Play Services
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 10
targetSdkVersion 16
}
}
That works for me.
My library project AndroidManifest.xml miss a application element
add one will fix it.
<application
android:allowBackup="true"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
</application>
I use gradle clean projectName --info get the error information, and solve it.
Related
I've added the ability to enter admob classes in my project with Android Studio , as well .:
The problem is that since I added this option , I go into conflict sdk credo..non are very handy Android sorry.
How can I fix the problem ? I should then bring up an interstitial banner :
InterstitialAd interstitialAd ;
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mygame.game.android"
android:versionCode="1"
android:versionName="1" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="22" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/GdxTheme" >
<activity
android:name="com.mygame.game.android.AndroidLauncher"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Error:
Error:(7, 5) uses-sdk:minSdkVersion 8 cannot be smaller than version 9
declared in library C:\Users\myuser\Documents\my
game\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-ads\8.4.0\AndroidManifest.xml
Error:Execution failed for task ':android:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library
C:\Users\myuser\Documents\mygame\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-ads\8.4.0\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.google.android.gms.ads" to
force usage
how to solve ???
This error is telling you that the play-services-ads library (aka AdMob) supports a minimum SDK of 9, but your application is trying to declare a min SDK of 8.
Since that library only supports back to version 9, your application cannot support anything older than that.
how to solve ???
Either stop supporting version 8 of Android (which currently accounts for just .1% of users globally), or remove the ads library.
I am creating any android application and the want to upload in play store.My problem is the that when i try to change the version i am AndroidMainfest.xml and try to build the apk then version of application change to previous one.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.menubar"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<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>
</application>
</manifest>
in Android Studio just change Version value in Build.gradle this will override values with manifest.xml
defaultConfig {
applicationId "YourID"
.......
versionCode 001
versionName '0.0.1'
}
If you are using Eclipse then just change version in manifest.xml and clean and built new apk. I am damn sure this'll change your app version.
android:versionCode="1.1"
android:versionName="1.0.1"
If you are using Android Studio, you must change the App Version in gradle.
When you build your application, Gradle replace values from manifest.
If you are using eclipse, check if you do not change AndroidManifest.xml placed on build folder.
If this does not work, try to project > clean, make changes and rebuild.
i am following the Training section of developer.android.com where i can read :
One of the most important elements your manifest should include is the
element.
But, the automaticaly generated manifest i have is :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.david.myapplication" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.david.myapplication.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>
</application>
</manifest>
Where i can't see any .
Must i consider it as normal behaviour ? Must i add this by myself ?
May be usefull : i am using AndroidStudio instead of Eclipse/ADT
Android Studio uses the newer Gradle-based build system. Its manifest merger creates the actual manifest for you, based on the information in the AndroidManifest.xml files and build.gradle files.
In particular, the uses-sdk information is usually derived from build.gradle.
For android studio, the compile sdk version is in the build.gradle. like this:
defaultConfig {
applicationId "com.eyespage.sdk.accounts"
minSdkVersion 11
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
so you don't have to include it in manifest
I am trying to use renderscript in my Android project. I installed sdk tools 22.6.2 and sdk build tool 19.0.3 and then updated my adt to the latest version. But now I get error that
"The import android.support.v8 cannot be resolved" on the line where I wrote import android.support.v8.renderscript.*. I have also made the following changes in projects.properties
renderscript.target=18
renderscript.support.mode=true
sdk.buildtools=19.0.3
manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amazing.imazing"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.amazing.imazing.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>
</application>
I am new to Android programming.
I removed all the entries from the project.properties except the one 'target=android-18' and copied the renderscript-v8.jar to the libs folder of my project. I found this jar file in sdk/build-tools/18.1.0/renderscript/lib. I stopped getting that error.
I repeated this process in another project and it works.
Try this
renderscript.target=18
renderscript.support.mode=true
sdk.buildtools=18.1.0
Which IDE are you using? Pay attention to the fact that Android Studio/Gradle-based builds are not yet supported by the RenderScript support library.
In addition, IntelliJ IDEA ignores the project.properties file, even if you are using the default build system ("make").
I have an project, build with Gradle in Android Studio v 0.3.2.
My project has dependencies to two other modules(android library). The project structure is well defined with build.gradle files.
The problem is... when i run the project on an Android device, i get installed 3 apk's on my device. One is the main project(the only right one) and the other two are from the imported modules(theese two i don't want to get installed).
How can i achieve this? Or what i'm doing wrong?
Project Structure:
MyLibModule
MainProject
MainProject->libraries->MyOtherModule
Where MyLibModule is at the same path as the Main project, because i also need this module in a other project.
Just to be clear: The whole project build's OK, all dependencies are OK, but why do i get 3 APK's on my device?
After a whole day struggling with this problem, i located the cause of this strange behaviour. The problem was the manifest of library module. Before i switched to Android studio i used Eclipse. And i had a testActivity declared in the manifest of the library project. Removing all test activities from the manifest's of my library modules solved the problem. Now Android Studio installs only the MainProject apk.
Some code:
The manifest of MyLibModule:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.mylibmodule"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7"/>
<application>
<activity
android:name=".TestActivity"
android:label="#string/app_name">
</activity>
</application>
</manifest>
Changed to:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.mylibmodule"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7"/>
<application>
</application>
</manifest>
....And the same for MyOtherModule.
NOTE: the empty application node must stay in the manifest, to avoid build errors.
remove the intent-filter from your library's launch activity
<application>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Changed to
<application>
<activity android:name=".MainActivity"/>
</application>
It's because your libraries are defined in their build.gradle files as being applications instead of libraries. Look for this line:
apply plugin: 'android'
and replace it with:
apply plugin: 'android-library'
You may need to make other adjustments to the buildfile as well because not everything that applies to applications can be specified in a library buildfile. See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Library-projects for more information.