So I have been developing an app for android and iOS for quite a while. Today was supposed to be the submission day! I have been doing all my android testing on a Samsung Galaxy S4 with Android 4.4.2.
I have been using Ti SDK 3.2.1 during this whole process. I've noticed there has been an update wanting to update titanium the past week or two but I have been ignoring it until I get this release out.
So today I am doing my final tests and my login screen now shows no text. I can type in the inputs and work all my buttons, just no text is visible.
The console is also throwing some new errors that just started showing today:
[WARN] : linker: libstlport_shared.so has text relocations. This is wasting memory and is a security risk. Please fix.
[WARN] : linker: libkroll-v8.so has text relocations. This is wasting memory and is a security risk. Please fix.
[WARN] : linker: libtiverify.so has text relocations. This is wasting memory and is a security risk. Please fix.
[WARN] : ApplicationPackageManager: getCSCPackageItemText()
[WARN] : V8Object: Runtime disposed, cannot set property 'userAgent'
[ERROR] : ViewSystem: ViewRootImpl #2 Surface is not valid.
Those weird "linker" errors. This just started showing today. So I try and remedy the problem by updating to that new Ti SDK 3.2.2. I get through that, update all the android SDKs, update the android NDK and still, same thing.
I've cleaned the project, removed it entirely from the phone, rebooted the phone, my computer and so on.
I can however see the text on an older android device that I have. It is n samsung galaxy stellar and when I compile I do not get those errors.
Can anyone think of what is going on here and WHY it just started happening today after no SDK updates?
I can type in the two fields no problem. I cant see any of the text. Also, the text on my button magically disappeared.
EDIT 2
I am thinking this has something to do with the screen density setting in tiapp.xml
if I change:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<uses-sdk android:targetSdkVersion="11"/>
<supports-screens android:anyDensity="false"
android:largeScreens="true" android:normalScreens="true"
android:smallScreens="true" android:xlargeScreens="true"/>
</manifest>
</android>
to this:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<uses-sdk android:targetSdkVersion="11"/>
<supports-screens android:anyDensity="true"
android:largeScreens="true" android:normalScreens="true"
android:smallScreens="true" android:xlargeScreens="true"/>
</manifest>
</android>
my text reappears. Other elements on the screen now appear smaller though..yay android...
Can you post some of your code for the text fields? Can't help you troubleshoot with just the error messages and tiapp.xml.
Also, I would try deleting the build folder in your workspace. Then for good measure just do a 'Project'->'Clean' command and run again.
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 run ./gradlew :app:lint task to generate a report.
One of them is Media Capabilities property not specified:
../../src/main/AndroidManifest.xml:6: The app accesses MediaStore.Video, but is missing a tag with a android.content.MEDIA_CAPABILITIES declaration
3 xmlns:tools="http://schemas.android.com/tools"
4 package="com.example.myapp">
5
6 <application
7 android:name=".App"
8 android:allowBackup="false"
9 android:icon="#mipmap/ic_launcher"
In Android 12 and higher, an app that opens media files should explicitly specify media formats that it doesn't support, so the OS can provide a transcoded file instead.
To suppress this error, use the issue id "MediaCapabilities" as explained in the Suppressing Warnings and Errors section.
How to fix it?
I am not using any media capabilities in my app, and will still get this lint issue.
I simply suppressed the error to "fix" it. Seems like a false positive with Android Lint.
<application
tools:ignore="MediaCapabilities">
</application>
We're getting the same warning and we don't have any video in our app - at least directly. I found this bug report, they state that it might be from a library you're using. Until a better solution has been made by Google I think the best would be to just ignore it (as suggested by Marius Kohmann) if you're certain you're not using video in your app.
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'm trying to understand a bit more about the JIT compiler optimization. Is this optimization automatically enabled? Why wouldn't I want this option enabled?
This is my manifest sdk target:
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="15" />
By default the JIT compiler optimizations are enabled which means the default vmSafeMode is set to "false", so by setting it to "true" you are turning off the JIT compiler.
Of course if the device is running an OS under API level 8 (froyo) which doesn't support JIT; it shouldn't make any difference.
(sources:)
embedded-vm-control from the Android open source project
Android 2.2 notes from developer.android.com
The JIT compiler can be disabled on a per-application basis ,default value is false for android:vmSafeMode by adding
android:vmSafeMode="true" in the application
tag in AndroidManifest.xml This can be useful if you
suspect that JIT compilation is causing your application to behave
incorrectly.
I hope this will help to understand more about android:vmSafeMode
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"