I am new on app's code. My project runs perfectly on emulators. However the apk is not running in my samsung device. Checking it with the Android Studio Analyzer the line xmlns:android="http://schemas.android.com/apk/res/android" in the manifest.xml returns in red. It seems that something is wrong with my project Manifest. Any Help? My manifest is copied below.
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0"
package="com.ferleecidade.a100dia11">
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26" />
<application
android:theme="#ref/0x7f0f0005"
android:label="#ref/0x7f0e001f"
android:icon="#ref/0x7f0c0000"
android:debuggable="true"
android:exported="true"
android:allowBackup="true"
android:supportsRtl="true"
android:roundIcon="#ref/0x7f0c0002">
<activity
android:name="com.ferleecidade.a100dia11.MainActivity">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.ferleecidade.a100dia11.MyCustomList" />
<meta-data
android:name="preloaded_fonts"
android:resource="#ref/0x7f020003" />
<meta-data
android:name="android.support.VERSION"
android:value="26.1.0" />
<meta-data
android:name="android.arch.lifecycle.VERSION"
android:value="27.0.0-SNAPSHOT" />
</application>
</manifest>
Help? Yes.
I am actively looking into this right now.
I don't believe your manifest is causing this or at least isn't the sole cause.
I have a project that I can run on my devices and emulators and deploy without a glitch.
I also get an error on the same line you do when analyzing the APK (Build/.Analyze APK).
If you hover your cursor over the red text you will see your error popup.
Mine says "URI is not registered (Settings | Languages and Frameworks | Schemes and DTDs)"
I performed a quick experiment.
created a brand new project in Android Studio with a single activity.
Cleaned the project.
Ran in an emulator.
Generated a signed APK.
Analyzed the APK and the error is there.
I suggest you try this.
This leads me to believe one of two things.
There is something wrong with my default project settings.
The error is being incorrectly reported by Android studio.
I hope this was useful.
Related
I have decided to try to learn some Android App Development however I am unable to follow even the most basic tutorial. My problem is that what ever I seem to do, the compiler complains about about the Manifest.
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]
However, this happens when the project is completely unchanged from when Android Studio created it.
The Manifest is below which is also unchanged but is copied below any way.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Toby.projecttoolkit" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Home"
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>
Can somebody shed some light on why this might be happening? Any help in this area would be really appreciated.
Many thanks
Toby
I had a similar issue, and I resolved it by changing the package name to begin with a lowercas later i.e use toby.projecttoolkit instead of Toby.projecttoolkit.
Apart from that the Manifest file looks fine.
Refactor the package, clean, refresh and build the project. Make sure your project as no errors and try to run it.
I have scoured the internet for this, but none of the "answers" I have found so far have fixed it for me. My app installs and runs 100% on my phone, which runs Android 4.1.2. It appears to install ok on my tablet too, which runs Android 4.3. But when I try to run it on the tablet, I get the "Application is not installed" error. What is even stranger is that if I run it using the App Manager inside ES File Explorer, it runs fine!
So my suspicion is that Android 4.3 is more strict about something that 4.1.2 lets through. But what? I just can't find it. And why it should run from within ES File Explorer is just weird. The app manifest is below. I have tried several different values for the target SDK, but nothing makes any difference. The app is signed using the Export Wizard in Eclipse, using a certificate created there.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="marshallarts.wordfinder"
android:versionCode="10"
android:versionName="1.10" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:permission="android.permission.WRITE_EXTERNAL_STORAGE"
android:theme="#style/AppTheme"
android:hasCode="true" >
<activity
android:name=".StartActivity"
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=".EnterActivity"
android:label="#string/title_activity_enter"
android:theme="#android:style/Theme.Dialog">
</activity>
<activity
android:name=".PlayActivity"
android:label="#string/title_activity_play" >
</activity>
</application>
</manifest>
Would add as a comment but don't have enough rep at the moment.
Have you changed your default launcher activity in your project recently? It could be that the link in your Android Home application is referencing the old activity.
Well I have solved this at last. It was (of course) my error - I had not correctly understood how to specify the app's permissions, and had not set them properly in the manifest. Corrected that, and it now runs happily. It is still a minor mystery why it ran on my phone - seems to me it should not have - but no matter, I am now on the right track.
I installed an instrumentation test APK from Eclipse(Run->Run As Android application) on device as the log shows below.
[2013-08-08 22:14:13 - SettingsTests] /SettingsTests/bin/SettingsTests.apk installed on device
However, on the home screen of the device, somehow the test APK does not show. In Settings->Application Manager, the list shows the test apk correctly.
Any idea what's going on?
The android system info shows:
Source:/data/app/PACKAGE.test.test-1.apk
data:/data/app/PACKAGE.test.test
Here's the test apk's manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="PACKAGE.test.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="17" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="my.package" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<uses-library android:name="android.test.runner" />
</application>
</manifest>
Only the activity defined in manifest like below will be shown. You must define at least one activty like that.
<activity
android:name="YourActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
What you are trying to install doesn't have an activity defined in the manifest.
As per the docs
An activity is that implements part of the application's visual user interface.
All activities must be represented by <activity> elements in the manifest file.
Any that are not declared there will not be seen by the system and will never be run.
You can refer the document so as to have an idea how activity works
It's quite normal behavior, as you don't have any activity in your instrumentation package. Didn't you mean to run it as Android JUnit Test?
I went through all the articles about the INSTALL_FAILED_MISSING_SHARED_LIBRARY issue in Google Maps projects but I couldn't find a case similar to mine nor a solution, so here is my problem:
I have a project with an activity (com.example.googleMaps.AndroidGoogleMapsActivity) that inherits from MapView to show a Google Map and do some stuff.
I run it on a Samsung Galaxy S II and it works fine: it shows the map and does the stuff it is supposed to do.
Now.
I want to use this project as a library for another project and show that activity as the first screen of another app.
So I checked the box Is Library, I created a new android project that builds against GoogleAPI and includes the library in the Android properties in Eclipse with the following manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-sdk android:minSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<uses-library android:name="com.example.googleMaps" required="true" />
<uses-library android:name="com.google.android.maps" required="true" />
<activity android:name="com.example.googleMaps.AndroidGoogleMapsActivity"
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>
I run this new project on my device and I get the infamous error:
INSTALL_FAILED_MISSING_SHARED_LIBRARY
and LogCat is totally silent.
I would like to point out that the activity inside the library works so none of the well know issues should apply.
In the client project I specify two uses-library tags (one for my library and one for the Google library), I build against GoogleAPI, include the library in the Android properties in Eclipse and run on a tested device.
Am I still missing something?
I had the same problem, just remove the line:
<uses-library android:name="com.example.googleMaps" required="true" />
and it should work.
Only Use com.google.android.maps. Please remove another one.
I have searched through the forum, but found no match for the issue I am currently facing:
I have an app, which installs and works ok, but when I try to update it (install again), the application does not update, but is installed separately one more time - I get two shortcuts, different app data, both versions work, etc.
I have not changed the application name, have observed the same behavior in adb and with actual phone and tablet, also tried with same and increased app version...
This is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rts.android.language" android:versionCode="1" android:versionName="1.1"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.VIBRATE"/>
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name="com.rts.android.language.ui.MainActivity"
android:label="#string/app_name"android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Any ideas what the reason might be?
Thanks!
please, make sure both applications contain same package name?
package="com.rts.android.language"
First, try to rename your activity:
from:
<activity android:name="com.rts.android.language.ui.MainActivity" />
to :
<activity android:name=".ui.MainActivity" />
Try to clean your project then build/rebuild...
When doing that you need to clean your Keystore:
%USERPROFILE%/.androidon Windows
~/.android/debug.keystore on Linux and Mac OS X