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
Related
I build an app using android studio 3, but when I want to publish it, market said "Your application must have a valid targetSdkVersion set. To solve this problem, you need to edit your AndroidManifest.xml file and upload again the .apk file."
I thought proguard make this problem so add -keep AndroidManifest.xml to rules. But it doesn't resolve my problem.
could you help me please?
I forgot to say I didn't have targetSdkVersion in my manifest. I added it manually but didn't resolve my problem.
my manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ir.farshidete.breathefree">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" /><!--optional-->
<uses-permission android:name="android.permission.VIBRATE" /><!--optional-->
<application
android:name=".G"
android:allowBackup="true"
android:icon="#drawable/icon128"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:theme="#style/AppTheme">
<activity android:name=".Main_Activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Relaxing_Activity" />
<activity android:name=".Setting_Activity" />
<activity android:name=".Info_Activity" />
<activity android:name=".Absorption_Activity" />
<activity android:name=".Capacity_Activity" />
<activity android:name=".Control_Activity" />
<activity android:name=".Program_Activity" />
<activity android:name=".Contact_Activity" />
<activity android:name="ir.tapsell.sdk.TapsellAdActivity"
android:configChanges="keyboardHidden|orientation|screenSize" >
</activity>
</application>
</manifest>
my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "ir.farshidete.breathefree"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
minifyEnabled false
// Uses new built-in shrinker http://tools.android.com/tech-docs/new-build-system/built-in-shrinker
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguardTest-rules.pro'
}
release {
minifyEnabled false
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguardTest-rules.pro'
}
}
}
dependencies {
api(name:'tapsell-sdk-android', ext:'aar')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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'
}
Finally I solved it by:
removing:
minSdkVersion 15
targetSdkVersion 28
from gradle.
and adding :
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="26" />
to manifest!
It seems slideme.org isn't up to date...
I'm using android studio to develop an app.
but today when I wanted to build my project , builder throw this error and I can't solve it.
Error:Execution failed for task ':app:processDebugManifest'.
com.android.manifmerger.ManifestMerger2$MergeFailureException: org.xml.sax.SAXParseException; lineNumber: 24; columnNumber: 10; Attribute name "l" associated with an element type "meta-data" must be followed by the ' = ' character.
I also create a new project but it throw this error again and don't build that project.
and also can't Rebuild project and throw this error again and again .
manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="gsoosk.zad.far.yadavar">
<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>
<activity android:name=".AddActivity" />
<activity android:name=".ShowActivity" />
<activity android:name=".RestartShowActivity" />
<activity android:name=".NoEventActivity" />
<activity android:name=".ListOfAllEventsActivity" />
</application>
</manifest>
build.gardle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "gsoosk.zad.far.yadavar"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
testCompile 'junit:junit:4.12'
}
I'm getting the following error.
FATAL EXCEPTION: main
VM with version 2.1.0 has multidex support
install
VM has multidex support, MultiDex support library is disabled.
install
VM has multidex support, MultiDex support library is disabled.
Shutting down VM
here is my build.gradle,i have enables the multidex in the android part,
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.0'
defaultConfig {
applicationId "com.mycompany.newlogin"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.guava:guava-jdk5:17.0'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
//compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient:4.5'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
}
and my manifest file is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompany.newlogin" >
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:name="android.support.multidex.MultiDexApplication">
<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=".Login"
android:label="#string/title_activity_login" >
</activity>
<activity
android:name=".Register"
android:label="#string/title_activity_register" >
</activity>
</application>
</manifest>
create a class lets name it App and extend from MultiDexApplication like this:
import android.support.multidex.MultiDexApplication;
public class App extends MultiDexApplication {
//you can leave this empty or override methods if you like so the thing is that you need to extend from MultiDexApplication
}
in your manifest add App as your application name just like this
<application
android:name=".App" // <<< this is the important line!
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name">
After adding everything make a clean build and it should work now :).
Override attachBaseContext method in your application class
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
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'
}
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.