I have created and published an application on the market...
However, on the market page it says: "Version required 1.0" while I know it needs at least version 2.0 (level 8) as it uses google maps..
I know that I have to include in the manifest file something like this:
I have tried to change the number 1 for another, but if I do it, the app crashes straight away with the following message:
android.view.InflateException: Binary XML file line #154: Error inflating class
Has anybody came across something similar?
Thanks
In your AndroidManifest.xml file, you need to include android:minSdkVersion and <uses-sdk> element. For example, I have this in my AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:minSdkVersion="4"
...
>
...
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="7"/>
...
</manifest>
Have a look here for more details: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
Related
Strange problem with Manifest Merger, Visual Studio Mac, Xamarin Forms (5.0.0.2125), Android project, SDK 29 to 30. Problem initiated from an extra ">" in the Properties/AndroidManifest.xml file. That generated the error below, indicating the xml structure wasn't closed; line 35, column 11 being was the last line and character of the Properties/AndroidManifest.xml.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error AMM0000: Error: org.xml.sax.SAXParseException; lineNumber: 35; columnNumber: 11; XML document structures must start and end within the same entity. (AMM0000)
So, I edited out the extra character, and the obj/debug/AndroidManifest.xml is created and looks right, however, the build error remains the same!
Subsequent complete rewrites and edits of the Properties/AndroidManifest.xml file have only 2 outcomes
Entering an erroneous xml format will generate the appropriate errors describing the error.
Entering a correct xml format, with any combination of entries, lines and characters will generate a correct obj/debug/AndroidManifest.xml file with the the correct Properties/AndroidManifest.xml content. However, the original build errors stay, with the " line 35, column 11 being was the last line and character of the Properties/AndroidManifest.xml." error.
So, something cached, somewhere, but no clue where. Started during an aborted simulator build and has been here ever since.
Have tried quite few things including:
cleaning, rebuilding and many combinations
remove obj and bin
removing/adding declarations in the AndroidManifest.xml
using different AndroidManifest.xml files
deleting AndroidManifest.xml and running
restoring from cloud a different version of solutions
commenting out Activity declaration on MainActivity
reinstall of VS for Mac
I think it is similar to this bug
Xamarin android Manifest being replaced on build. only solution seems to be to repair visual studio
Has anyone seen this type of bug before?
Help much appreciated as have run out of ideas here.
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="17" android:versionName="1.17" package="com.mycompany.myapp">
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="30" />
<application android:label="myapp" android:icon="#mipmap/ic_launcher" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>
Solved here, github.com/xamarin/xamarin-android/issues/6385. Was a problem in a Nuget Firebase library AndroidManifest.xml file. Unfortunately the error reporting in VS Mac Manifest merging doesn't report which of the 140+ AndroidManifest.xml files has the problem. However, with a bit of sleuthing, there is a way to eventually work it out.
I have an old Adobe AIR app that is working just fine on Android, except that it comes out in portrait mode. Without changing the source, just the application descriptor, I would like to fix this. Currently I have:
<application xmlns="http://ns.adobe.com/air/application/2.6">
...
<android>
<manifestAdditions>
<![CDATA[
<manifest android:installLocation="preferExternal">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<supports-screens android:normalScreens="true"/>
<application android:enabled="true">
...
Now, if I add this:
<initialWindow>
<aspectRatio>landscape</aspectRatio>
</initialWindow>
...within the inner <application> tag, ADT says:
application.xml: error 402: Current Android sdk version doesn't support initialWindow as xml tag
I tried changing the AIR version (yes, see AIR vs Android below) up to 3.9 with no difference.
If I put it within only the outer <application> I get this error instead:
application.xml(24): error 103: application.initialWindow is an unexpected element/attribute
So I'm guessing I have it in the right spot, but I need to add a version number.
However, after a bit of searching, I could not find documented anywhere which Android SDK version I would need to specify (using "the -platformsdk flag in the ADT command if the element was introduced after Android 2.2").
AIR vs Android
This <initialWindow> thing isn't actually an Android XML tag, but an Adobe XML tag, contrary to Adobe's documentation which says that child elements of the <manifest> tag are "Defined by the Android SDK." (Search for <initialWindow> and you'll find only Adobe AIR docs, not Android SDK docs. Which is too bad, because the latter are pretty good at telling you exactly which version an element was introduced in.)
Update 1: SDK 23.0.1 isn't new enough?
I added the -platformsdk option pointing to the Android SDK, which then complained about missing aadt.exe. Per https://stackoverflow.com/a/16831707 I copied in that from 23.0.1 under build-tools. I still get the same message. I also tried adding within the <manifest> tag <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="23" />, still the same result.
UPDATE 2: Compiled AndroidManifest.xml has lower Android SDK version!
Using aapt from the Android SDK, I found out that the AIR-made APK, despite the above line in Update 1, contains this:
E: uses-sdk (line=48)
A: android:minSdkVersion(0x0101020c)=(type 0x10)0x9
A: android:targetSdkVersion(0x01010270)=(type 0x10)0x13
Update 3: Also true with AIR SDK 19
Although with this difference:
A: android:minSdkVersion(0x0101020c)=(type 0x10)0x17
A: android:targetSdkVersion(0x01010270)=(type 0x10)0x17
Interestingly with SDK 19, the screen orientation is now also defined:
A: android:screenOrientation(0x0101001e)=(type 0x10)0x2
...but of course I want 0 (landscape), not 0x2 (user).
Maybe this could work
<android:screenOrientation="landscape">
I have not used Adobe air,this is just a suggestion
Actually, the initialWindow tag goes within the outermost application tag, as the docs say. At one point I had tried this and gotten an error, but I guess it was a coincidence with something else I was trying. I can confirm this fixes it on AIR 2.6, 3.9, and 19.
I am updating project in AndroidStudio, used target API 20 instead of 19. During this process I encounter this error:
[PathToMyProject]\myproject\build\exploded-aar\com.google.android.gms\play-services\4.0.30\AndroidManifest.xml:
Error:(1) Could not find element /manifest/application. //showing
several times
This is the file AndroidManifest.xml where is the error:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.gms"
android:versionCode="4030530"
android:versionName="4.0.30 (889083-30)" >
<uses-sdk android:minSdkVersion="8"/>
</manifest>
When I add <application/> tag and run Make or Rebuild, the manifest is for an unknown reason refreshed and does not contain added <application> tag and the error shows again...
I had the same problem.
You need to change the build.gradle to get the gms version for wearables.
So, add compile 'com.google.android.gms:play-services-wearable:+' to dependencies, and it should work.
My problem seems little different than here Test run failed: Instrumentation run failed due to 'Process crashed.' when testing multiple Android activity
I have followed steps given in the pdf. I have created test project "TestAndroidCalculatorBlackbox" (do we need to have two project one test and one main project, perhaps this could be the reason, cause in Robotium "Getting Started" link they want us to create projects for Notepad), and added jars robotium-solo-5.0.1.jar,robotium-solo-1.6.0.jar, to get rid of red error lines below solo. functions and jay.way package.
I am attaching the error screenshot:
y AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testcalculator"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.testcalculator" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" android:debuggable="true">
<uses-library android:name="android.test.runner" />
</application>
</manifest>
and I have package added in instrumentation list:
c:\> adb shell pm list instrumentation
instrumentation:PACKAGE.test.test/android.test.InstrumentationTestRunner (target=PACKAGE)
instrumentation:PACKAGE.test.test.test.test.test.test/android.test.InstrumentationTestRunner (target=PACKAGE.test.test)
instrumentation:com.example.android.apis/.app.LocalSampleInstrumentation (target=com.example.android.apis)
>> instrumentation:com.testcalculator/android.test.InstrumentationTestRunner (target=com.testcalculator) <<
For those migrating to or currently using Androidx, this error results from using
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" instead of testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner".
Using the latter resolves the error completely.
Don't attach more than one robotium library. robotium-solo-1.6.0.jar should be removed. It's deprecated and you really shouldn't use it anymore.
Is your target application already installed? It should be installed, if you are going to run tests for it. You can not install it only if your test project has reference to target project.
If you have separate APKs for application and instrumentation you should change package in your manifest. You actually have "com.testcalculator" and target package is the same - they should be different. By the way I don't see sources of application in your project, so application part should be removed.
Your error doesn't say much, it's always good to post stacktrace from LogCat.
Read manuals before you start writing tests:
http://developer.android.com/tools/testing/testing_android.html
https://code.google.com/p/robotium/w/list
Had this same problem and fixed it by setting up AndroidJUnitRunner https://developer.android.com/training/testing/junit-runner.html
For the developer who hasn't used androidx yet. Seeing the LogCat solved the issue for me which was deleting these line running in the wrong thread because of RxJava.
companion object {
#get:ClassRule #JvmStatic
val testSchedulerRule = RxImmediateSchedulerRule()
}
In my case it was a StrictMode policy violation caused by AndroidJUnitRunner:
D/StrictMode: StrictMode policy violation: android.os.strictmode.UntaggedSocketViolation: [...]
W/System.err: StrictMode VmPolicy violation with POLICY_DEATH; shutting down.
Disabling the check detectUntaggedSockets() when running an Espresso test fixed it for me. See this question for how to check for that.
I have published some apps and today I realized that they are available in the market only for devices with normal, large and xlarge screen... I would like my apps to be available for every screen dimensions... However, I have a galaxy s and a galaxy mini(small screen) and if I use any of then as emulator the app is running perfect. Please keep on mind that I have only one folder for my graphics(drawable). Searching the net, I have found that in order to have my app in all screen size market I should add that in my manifest:
<manifest ... >
...
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true" />
<application ... >
...
<application>
</manifest>
Is that right? Should I do it? I would like to have you opinion please
EDIT:
I just tried to add these line in my manifest and I'm getting error when I try to save it. The error is:
Multiple annotations found at this line:
- error: No resource identifier found for attribute 'largeScreens' in package
'android'
- error: No resource identifier found for attribute 'xlargeScreens' in package
'android'
- error: No resource identifier found for attribute 'normalScreens' in package
'android'
- error: No resource identifier found for attribute 'smallScreens' in package
'android'
It is right approach. Searching on market is based on
supports-screen
tag in the manifest file.
Attributes
android:smallScreens
android:normalScreens
android:largeScreens
are added in Android 1.6, while
android:xlargeScreens
in 3.0. Nevertheless, you should have them set to true in your manifest to have seaching on the market work correctly.
Make sure you have proper
<uses-sdk android:minSdkVersion="" />
This tag indicates minimum version of SDK your application requires. It based on API you have used.
You should try to publish a update for the application with those manifest changes and see if that solves it.
Its all very well documented at <support-screen> page. So there is no space for opinions here.
And yes, your solution should solve your problem.
Yes you should add those lines in your manifest file. Also you nedd to add: android:anyDensity="true"