Currently, the minimum supported Android API level is 17. Technically, the {N} Android Runtime should work seamlessly with lower versions. We need to test the modules with various API levels and see what is the minimum we can come up with. Since we refer to AppCompat in the default project template, we may use it to access methods from higher API levels.
Refers to nativescript/android-runtime#198 & nativescript/nativescript-cli#846.
What is the status of this with the advent of https://github.com/NativeScript/android-runtime/issues/283 ?
API level 14 should be the baseline IMO.
Any status update on this. This is the only blocker that's stopping me from adopting Nativescript.
The android-runtime is supporting API level 10, this is a problem with the modules.
ping: @hshristov
@Plamen5kov I love NativeScript, but my clients or users doesn't. Here on Brazil is bigger the number of 4.1 devices.
I have tried to change the minimal SDK on app/App_Resources/Android/AndroidManifest.xml
, but I got no success. _When this feature will be release and how to build it with TNS?_
@calebeaires we have a scheduled task for this release to check if there are any problems running on API14. It will be of great help if you try it with your app and report any problems. As the others said, the NativeScript core framework for android is working with not problems, eventualy there will be errors in the JavaScript layer. If you see any please report here.
@valentinstoychev Thanks for your replay. May you give me a clue on how to build the app on lower API. Does I need to change some line code before the build process? Where..?
Once again, thanks!
@calebeaires You cannot change to a lower api level because tns-core-modules-widgets minVersion is 17.
@calebeaires I am modifying all of the associated projects in order to test this on 14-16.
Ping @hshristov
@vbresults what device did you run the tests on? Appears to be one lower than API Level 16. I believe we have a patch for the particular cause of the error you mentioned above as a PR in the android-runtime repository. https://github.com/NativeScript/android-runtime/pull/627/files .
Thanks for your contribution!
@Pip3r4o I tried 16, and after applying the patches and verifying it worked perfectly, I went down to 15, with the ultimate goal of 14 and stopping there.
I just manually applied the patch you linked to, and added the others above (updated). The result was, that on API level 15... it now loads the UI (rendering it perfectly) for a few seconds!
__NAME__
is intentionally there and so is the empty space, it is not a bug -- 15 is almost finished
It crashed almost immediately after displaying, with this:
I/ActivityManager( 1197): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.app/com.tns.NativeScriptActivity} from pid 2203
D/dalvikvm( 2227): Not late-enabling CheckJNI (already on)
I/ActivityManager( 1197): Start proc com.example.app for activity com.example.app/com.tns.NativeScriptActivity: pid=2227 uid=10044 gids={1015, 3003}
D/ ( 1197): HostConnection::get() New Host Connection established 0x973fed8, tid 1227
W/NetworkManagementSocketTagger( 1197): setKernelCountSet(10044, 1) failed with errno -2
D/dalvikvm( 2227): GC_CONCURRENT freed 166K, 3% free 9321K/9543K, paused 0ms+1ms
D/dalvikvm( 2227): Trying to load lib /data/data/com.example.app/lib/libNativeScript.so 0xa88e1398
D/dalvikvm( 2227): Added shared lib /data/data/com.example.app/lib/libNativeScript.so 0xa88e1398
I/TNS.Native( 2227): NativeScript Runtime Version 2.4.0, commit 440897629007580a6faafaddb79d9a057daf4120
D/TNS.Native( 2227): JNI_ONLoad
D/TNS.Native( 2227): JNI_ONLoad END
I/dalvikvm( 2227): Could not find method android.app.Activity.finishAffinity, referenced from method com.tns.ErrorReport.killProcess
W/dalvikvm( 2227): VFY: unable to resolve virtual method 291: Landroid/app/Activity;.finishAffinity ()V
D/dalvikvm( 2227): VFY: replacing opcode 0x6e at 0x0006
D/TNS.Native( 2227): Failed to load snapshot: Cannot load library: load_library[1091]: Library 'libsnapshot.so' not found
D/dalvikvm( 2227): GC_CONCURRENT freed 263K, 4% free 9505K/9863K, paused 0ms+0ms
D/OpenGLRenderer( 2203): Flushing caches (mode 1)
D/OpenGLRenderer( 2203): Flushing caches (mode 0)
D/TNS.Native( 2227): V8 version 5.2.361
D/TNS.Native( 2227): lenNodes=84036, lenNames=850680, lenValues=995261
D/TNS.Native( 2227): time=1
D/TNS.Java( 2227): Enabling NativeScript Debugger Agent
D/dalvikvm( 2227): GC_CONCURRENT freed 389K, 6% free 9547K/10055K, paused 0ms+0ms
F/libc ( 2227): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=128)
D/dalvikvm( 2227): GC_CONCURRENT freed 393K, 5% free 9575K/10055K, paused 1ms+0ms
D/dalvikvm( 2227): GC_CONCURRENT freed 426K, 6% free 9597K/10119K, paused 0ms+0ms
D/dalvikvm( 2227): GC_CONCURRENT freed 363K, 5% free 9643K/10119K, paused 0ms+0ms
D/dalvikvm( 2227): GC_CONCURRENT freed 341K, 5% free 9723K/10183K, paused 0ms+0ms
D/dalvikvm( 2227): GC_CONCURRENT freed 375K, 5% free 9753K/10247K, paused 0ms+1ms
I/Process ( 1197): Sending signal. PID: 2227 SIG: 3
I/dalvikvm( 2227): threadid=3: reacting to signal 3
I/dalvikvm( 2227): Wrote stack traces to '/data/anr/traces.txt'
D/dalvikvm( 2227): GC_CONCURRENT freed 408K, 6% free 9784K/10311K, paused 0ms+0ms
D/dalvikvm( 2227): GC_CONCURRENT freed 445K, 5% free 9804K/10311K, paused 0ms+0ms
D/dalvikvm( 2227): GC_CONCURRENT freed 382K, 5% free 9840K/10311K, paused 1ms+1ms
I/DEBUG ( 2067): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 2067): Build fingerprint: 'generic_x86/google_sdk_x86/generic_x86:4.0.4/MR1/3093080:eng/test-keys'
I/DEBUG ( 2067): pid: 2227, tid: 2241 >>> com.example.app <<<
I/DEBUG ( 2067): signal 11 (SIGSEGV), code 128 (?), fault addr 00000000
I/DEBUG ( 2067): eax 098f07d8 ebx a58abcdc ecx 00000014 edx 00000014
I/DEBUG ( 2067): esi a4b77c68 edi a4b77c68
I/DEBUG ( 2067): xcs 00000073 xds 0000007b xes 0000007b xfs 00000000 xss 0000007b
I/DEBUG ( 2067): eip a50f4622 ebp 00000006 esp a4b77aa4 flags 00010282
D/dalvikvm( 2227): GC_CONCURRENT freed 337K, 4% free 10033K/10439K, paused 0ms+0ms
I/DEBUG ( 2067): #00 eip: a50f4622 /data/data/com.example.app/lib/libNativeScript.so
I/DEBUG ( 2067): #01 eip: ffffffff
I/DEBUG ( 2067): #02 eip: ffffffff
I/DEBUG ( 2067): #03 eip: ffffffff
I/DEBUG ( 2067): #04 eip: ffffffff
I/DEBUG ( 2067): #05 eip: ffffffff
I/DEBUG ( 2067): #06 eip: ffffffff
I/DEBUG ( 2067): #07 eip: ffffffff
I/DEBUG ( 2067): stack:
I/DEBUG ( 2067): #00 a4b77aa4 a58abcdc /data/data/com.example.app/lib/libNativeScript.so
I/DEBUG ( 2067): #00 a4b77aa8 098f07a0 [heap]
I/DEBUG ( 2067): #00 a4b77aac 0000005f
I/DEBUG ( 2067): #00 a4b77ab0 a50eff99 /data/data/com.example.app/lib/libNativeScript.so
I/DEBUG ( 2067): #00 a4b77ab4 098f07a0 [heap]
I/DEBUG ( 2067): #00 a4b77ab8 098e05e8 [heap]
I/DEBUG ( 2067): #00 a4b77abc a50f2a09 /data/data/com.example.app/lib/libNativeScript.so
I/DEBUG ( 2067): #00 a4b77ac0 0000000c
I/DEBUG ( 2067): #00 a4b77ac4 a4b77c68 [stack:2241]
I/DEBUG ( 2067): #00 a4b77ac8 0000005f
I/DEBUG ( 2067): #00 a4b77acc a50f4409 /data/data/com.example.app/lib/libNativeScript.so
I/DEBUG ( 2067): #00 a4b77ad0 a58abcdc /data/data/com.example.app/lib/libNativeScript.so
I/DEBUG ( 2067): #00 a4b77ad4 00000005
I/DEBUG ( 2067): #00 a4b77ad8 0000005f
I/DEBUG ( 2067): #00 a4b77adc 098f0508 [heap]
I/DEBUG ( 2067): #00 a4b77ae0 a50f459c /data/data/com.example.app/lib/libNativeScript.so
I/DEBUG ( 2067): ...... ......
I/dalvikvm( 2227): Could not find method android.view.ViewGroup.onRtlPropertiesChanged, referenced from method android.support.v7.widget.Toolbar.onRtlPropertiesChanged
W/dalvikvm( 2227): VFY: unable to resolve virtual method 20740: Landroid/view/ViewGroup;.onRtlPropertiesChanged (I)V
D/dalvikvm( 2227): VFY: replacing opcode 0x6f at 0x0007
I/dalvikvm( 2227): Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations
W/dalvikvm( 2227): VFY: unable to resolve virtual method 1021: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
D/dalvikvm( 2227): VFY: replacing opcode 0x6e at 0x0002
I/dalvikvm( 2227): Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
W/dalvikvm( 2227): VFY: unable to resolve virtual method 1043: Landroid/content/res/TypedArray;.getType (I)I
D/dalvikvm( 2227): VFY: replacing opcode 0x6e at 0x0008
I/dalvikvm( 2227): Could not find method android.content.Context.getColorStateList, referenced from method android.support.v7.content.res.AppCompatResources.getColorStateList
W/dalvikvm( 2227): VFY: unable to resolve virtual method 753: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;
D/dalvikvm( 2227): VFY: replacing opcode 0x6e at 0x0006
W/dalvikvm( 2227): VFY: unable to resolve static field 364 (INTERSECT) in Landroid/graphics/Path$Op;
D/dalvikvm( 2227): VFY: replacing opcode 0x62 at 0x0000
I/dalvikvm( 2227): Could not find method android.widget.ImageView.hasOverlappingRendering, referenced from method android.support.v7.widget.AppCompatImageView.hasOverlappingRendering
W/dalvikvm( 2227): VFY: unable to resolve virtual method 21521: Landroid/widget/ImageView;.hasOverlappingRendering ()Z
D/dalvikvm( 2227): VFY: replacing opcode 0x6f at 0x0008
I/dalvikvm( 2227): Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable
W/dalvikvm( 2227): VFY: unable to resolve virtual method 984: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
D/dalvikvm( 2227): VFY: replacing opcode 0x6e at 0x0002
I/dalvikvm( 2227): Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity
W/dalvikvm( 2227): VFY: unable to resolve virtual method 986: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
D/dalvikvm( 2227): VFY: replacing opcode 0x6e at 0x0002
E/dalvikvm( 2227): Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
W/dalvikvm( 2227): VFY: unable to resolve instanceof 240 (Landroid/graphics/drawable/RippleDrawable;) in Landroid/support/v7/widget/AppCompatImageHelper;
D/dalvikvm( 2227): VFY: replacing opcode 0x20 at 0x000c
D/dalvikvm( 2227): GC_CONCURRENT freed 155K, 3% free 10293K/10567K, paused 0ms+1ms
D/dalvikvm( 2227): GREF has increased to 201
I/dalvikvm( 2227): Could not find method android.content.Context.getNoBackupFilesDir, referenced from method com.google.android.gms.common.util.zzw.getNoBackupFilesDir
W/dalvikvm( 2227): VFY: unable to resolve virtual method 765: Landroid/content/Context;.getNoBackupFilesDir ()Ljava/io/File;
D/dalvikvm( 2227): VFY: replacing opcode 0x6e at 0x0006
@vbresults since these are just warnings, they can be safely ignored, unless any of the methods/fields are accessed from within the code. I can take care of the android.app.Activity.finishAffinity
one in the error activity, but it's unlikely to be the cause of the errors you are facing. I also tried to figure out the c++ stack, but none of the addresses helped.
What versions of the components are you running? On what device, and what architecture (native android x86 emulator?)?
@Pip3r4o 2.4.0 of everything; yes, x86 emulator 3.7in WVGA (Nexus One)
Maybe when the finishAffinity is fixed, it will show the error activity with details instead of just crashing.
@vbresults you can comment out the line in platforms/android/src/debug/java/com/tns/
and test it yourself. I doubt though that that particular line is causing the problem.
@calebeaires Using the patches above it works seamlessly for me on API level 16/4.1.
@vbresults 16 is a big step. This api almost full all devices we can cover for the rest of us! 馃憤
hi everyone
Is there any prediction if the next release (2.5) will support API 16?
I am really excited with {N} and I want start a new project using {N} for my client, but this project need support at least Android 4.1.
Thank you very much for excelent work
Hello.
I am analysing some tools to work with mobile app (ReactNative, ionic and NativeScript).
My choice at this moment is NativeScript, but I am a little afraid because in my country (Brasil) many users of Android are using version 4.0 and 4.1.
So, my question is: "When will be possible to compile for Android API < 17?".
Subscribing also for "When will be possible to compile for Android API < 17?". This beautiful work will much more blossoming with < 17 support
I'm very sad, because I would like to re-use my knowledge about Angular2, but, because of my need to support android 4.0 and 4.1, I must go with xamarin forms (unfortunately).
I also agree that this should be a high priority for the android side of things since the user base on those lower apis continues to be pretty relevant.
@nonato @betosalvador @MiaranaDIY @andmm
Just finished all of the associated patches; when the last three are merged you will have 4.1/16 support. I also got 15 almost working as you can see from the screenshot above, so 14 isn't far off.
I understand how important 14-15 support is since I have a very international client base -- some countries use it a lot. That said, I do not have time to track down what's causing 14-15 to crash.
Edit: I do know that in 14 it crashes because of some ComponentCallbacks2
constants that aren't defined in that API level but hardcoded somewhere in the runtime metadata or declarations.
Ping @Pip3r4o
So will 4.1 / 16 support be available in the next release?
@betosalvador we cannot confirm that the Android runtime (core modules included) will support API 16, it is not on the 2.5 Roadmap, and it needs to go through testing, and be verified that it won't break. Stay tuned.
@Pip3r4o and @vbresults, thanks for response and working hard on this issue.
I can go with nativescript, if at least API16 be available in the next release.
I think a lot of people will like this support to api16.
Let me know if I can help on the tests.
Thanks, again!
Let me also know if I can help on the tests. All my resources to support TNS for API 16...
Let me also know if I can help on the tests. All my resources to support TNS for API 16 [2]
Hello guys!
Is there any updates about this issue?
Thanks in advance!
Hello - whats with Android API <17, at least API 16?
@vbresults, @Pip3r4o How to apply the patches? I tried to do so, but I had no success. What lines I must comment or what files I must change? Please, consider making notes so we could test NS 2.5 on or devices!
@calebeaires the changes have not made it in 2.5 because they are not sufficient to claim level 16 support.
I need to confess, I've been studying nativescript for months, but the only thing that keeps me from using it for work is this blessed incompatibility.
The framework is fantastic, but here in Brazil, we have a very large audience on API 16, and unfortunately you have not given it much importance in months, and you're probably losing a lot of public for it.
I'm sad because I still can not migrate to nativescript in the company where I work, because of a simple detail, that apparently you already have a solution almost ready, but do not go;
hug
@betosalvador I'm from Brazil as well and I'm about to go to production with Nativescript.
After I saw your post I decided to take a look on google analytics and there is no API 16 on the past 50k android sessions. Most of my audience are from SP and RJ, so I'm not sure on how huge this could be on other states.
@Cayan This could be true. On last year I saw 16,17,18 dropping.
80% of what I said are using 21+ :smile:
Hello guys, in my case, the problem is that the target public of my company are low-income people.
And, that public still are using api 16 (or lower).
I am from Hong Kong, my clients also require me to support SDK 16.
Could someone put a priority (p:n label) on this issue?
What's the current status of this issue? When can I use this?
any update on this? @hshristov: Is there currently any plan?
We are not actively working on this feature.
As of this moment (the 1st of January 2018), less than 2 percents of the worldwide Android devices are using API 16 with a stable tendency these percentages to shrink further.
Need support API 16.
There are a lot of smartphones in the world, that is obsolete for daily using, but can still solve some tasks.
Here, in the Brazil, we see a lot of people using API 16 or lower, because this are users that uses old smartphones yet.
In the last year, the company where I work, had to use xamarin forms (unfortunately) to build a app for a low-income people.
Believe me, if this research of Devices/API versions were done here in Brazil, the number of devices using API 16 or lower would be larger.
And probabily this must be a tendency in latin am茅rica countries
@betosalvador here you can track the usage of Android devices and API market shares in Brazil (and in any other country) - as of February 2018 the market share of Android 4.1 (API 16 in Brazil is approximately 3% (dropped 1.5% for the last 6 months)
Is it that much difficult to support api 16 or has Nativescript team just collectively decided to not do anything and wait for the world to upgrade. its been 3 years
@JoshKisb as you can read on the comment above yours, the api 16 usage is so low that is not worth wasting their time implementing the support for it.
@JoshKisb I have the same issue. Here in the Brasil (in poorer regions) so much people use android with verson 4.1.x.
This is so frustrating, because you have no conditions to use NativeScript if your target is poor people.
I鈥檓 closing this issue because it has been inactive for a few months and we are no longer actively working on this feature based on the Android market share data provided above.
Thank you!
WTF
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
@nonato @betosalvador @MiaranaDIY @andmm
Just finished all of the associated patches; when the last three are merged you will have 4.1/16 support. I also got 15 almost working as you can see from the screenshot above, so 14 isn't far off.
I understand how important 14-15 support is since I have a very international client base -- some countries use it a lot. That said, I do not have time to track down what's causing 14-15 to crash.
Edit: I do know that in 14 it crashes because of some
ComponentCallbacks2
constants that aren't defined in that API level but hardcoded somewhere in the runtime metadata or declarations.Ping @Pip3r4o