Error while creating uses-permission from a package - java

I am trying to create an android application that bluetooth connects to a third party device and saves the data collected into a database. The problem I am currently having is adding the uses-permission for broadcasting and reading the data from a package. my code is as follows in android manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.daotec.bgextract">
<uses-permission android:name="com.b3inc.sbir.mdrs.permission.READ_DATA”/>
<uses-permission android:name="com.b3inc.sbir.mdrs.permission.BROADCAST"/>
<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>
</manifest>
after i placed in the READ DATA permission i got errors all throughout my xml file and the broadcast permission has an error Attribute is missing the Android namespace prefix. When i run the application i am getting error The value of attribute "android:name" associated with an element type "uses-permission" must not contain the '<' character.

I think you have copied this line <uses-permission android:name="com.b3inc.sbir.mdrs.permission.READ_DATA”/>, Try to replace the double quotes "

After ...permission.READ_DATA, you have a formatted quote - ”. Replace it with the appropriate quote - ".

Hello try out below code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.daotec.bgextract">
<uses-permission android:name="com.b3inc.sbir.mdrs.permission.READ_DATA" />
<uses-permission android:name="com.b3inc.sbir.mdrs.permission.BROADCAST" />
<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>
</manifest>
Replace below line then your issue solved.
<uses-permission android:name="com.b3inc.sbir.mdrs.permission.READ_DATA" />
Issue is Replace ” with "

Related

Android Studio Cannot resolve symbol 'MainActivity in Android Manifest.xml

I am not sure if I caused this error by re-nameing an older working directory to use as a new application, but my application does not launch. Maybe its best just to build new that copy? The problem seemed to have started when I copied in some new java code, but that code seems to run fine.
I get the following error when trying to launch the emulator: Could not identify launch activity: Default Activity not found Error while Launching activity
Now I also notice I have the following error in AndroidManifest.xml. Cannot resolve symbol 'MainActivity in AndroidManifest.xml
I have read other posts that state to Invalidate the Cache are restart, but that does not fix my problem.
Below is my AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.nettools">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
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>
</manifest>
Here is the AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.NetTools">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="NetTools"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name="com.example.android.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
You are using relative reference to MainActivity (note . (dot) at the beginning). The reference should be relative to package. So make sure that your MainActivity class is located under package com.example.android.nettools
It must be reachable at location com.example.android.nettools.MainActivity

Problems with Android Manifest file

Here is the Code, I keep getting errors with what I believe is syntax, but I'm not able to fix, I'm new to android development and I need to complete this project by next week, if there's a resource someone could direct me towards to help solve this problem that would be great!
(android studio specifically is telling me multiple root tags, tag name expected,tag start was not closed, and unexpected end of file)
EDIT: sorry about formatting I think I fixed it
EDIT2: I've narrowed it down to just one multiple root tag, still unsure of how to solve problem
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="shake.shake"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainPage">
<intent-filter>
<action
android:name="android.intent.action.MAIN"
/>
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="shake.shake.ShakePage"
android:label="#string/title_activity_shake_page"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="#style/FullscreenTheme"
android:parentActivityName="shake.shake.MainPage">
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="shake.shake.MainPage" />
</activity>
</application>
You have excluded <application> from <manifest> tag.
The <application> must reside within <manifest> tag (parent).
<manifest>
<application>
...
</application>
</manifest>
< Original<?xml version="1.0" encoding="utf-8"?>
It seems to me that this line has no end tag to be found throughout the codes that you provide up there.. hehe.. not sure whether it is this ;)
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="shake.shake">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainPage">
<intent-filter>
<action
android:name="android.intent.action.MAIN"
/>
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="shake.shake.ShakePage"
android:label="#string/title_activity_shake_page"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="#style/FullscreenTheme"
android:parentActivityName="shake.shake.MainPage">
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="shake.shake.MainPage" />
</activity>
</application>
</manifest>
How about trying this
Just try to get the meta-data tag out from here and put it under the closing activity tag and see. For instance;
<activity
android:name="shake.shake.ShakePage"
android:label="#string/title_activity_shake_page"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="#style/FullscreenTheme"
android:parentActivityName="shake.shake.MainPage">
</activity>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="shake.shake.MainPage" />

How to correct this : Content is not allowed in prolog

I am trying to open my project in Android Studio , but i get this error : Content is not allowed in prolog. My code is this :
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.myapp.mobile" platformBuildVersionCode="8" platformBuildVersionName="2.2">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<application android:allowBackup="true" android:icon="#drawable/icon" android:label="#string/app_name" android:screenOrientation="portrait" android:theme="#android:style/Theme.Light.NoTitleBar">
<activity android:label="myapp" android:name="com.myapp.mobile.Splash">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name="com.myapp.mobile.Main">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name="com.myapp.mobile.ChooseMenu"/>
<activity android:name="com.myapp.mobile.LocalMenu"/>
<activity android:name="com.myapp.mobile.LocalMenuProducts"/>
<activity android:name="com.myapp.mobile.Cart"/>
<activity android:name="com.myapp.mobile.FinishOrder"/>
<activity android:name="com.myapp.mobile.ReserveTable"/>
</application>
I had myapp.apk and decompiled using Android Decompiler
You may wanna check all your XML files manifest + layouts (by copying them into Notepad++ or whatever) and see if there's any special characters like this one � and remove them.
Do you have typo here (myaspp)
<activity android:label="myapp" android:name="com.myaspp.Splash">
and the intention was
<activity android:label="myapp" android:name="com.myapp.Splash">
You have two XML declarations in your file:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8"?>
Delete one. There may only be at most one XML declaration in a file, and it can only appear at the very top.
See also: Are multiple XML declarations in a document well-formed XML?

Google play supported devices 0 with pdfbox-android

Have a problem with an already-published application on Google Play.
The application is in the store, but no one can download, because of an error Supported devices 0.
I did refactor the project, removed all unnecessary with the manifest. Compiled a new apk, and again "Supported devices 0".
I use pdfbox-android-1.8.8.jar.
If I remove the pdfbox from project, then are "Supported devices 7700".
I build project with Eclipse.
What does this mean?
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.firm.project"
android:versionCode="3"
android:versionName="1.01" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="21"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:name=".App"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name=".StartActivity"
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=".OneActivity" android:screenOrientation="portrait">
</activity>
</application>
</manifest>

Android Studio states [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

I'm not quite sure how I would go about fixing this manifest. I have one activity with one fragment for reference, and this is just the manifest that was generated by Android Studio.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Enayet.minigma" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Main"
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>
The android documentation states that package names can contain both upper case and lower case letters, however, this issue seems to occur when using upper case. Try changing your package name to
enayet.minigma

Categories