Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run app libNativeScript.so: class not found com.tns.NativeScriptActivity #2352

Closed
victorhugom-zz opened this issue Dec 14, 2016 · 9 comments

Comments

@victorhugom-zz
Copy link

I`m trying to build and run the app in two new machines and in both I have the same error:

The configs of both machines are the same: Windows 10, with the latest {N} and the Android SDK is instaled in the same way of the main machine, with the same SDK versions and all extras installed

W/linker  (28338): libNativeScript.so: unused DT entry: type 0x6ffffffe arg 0x2ba8
W/linker  (28338): libNativeScript.so: unused DT entry: type 0x6fffffff arg 0x3
I/TNS.Native(28338): NativeScript Runtime Version 2.4.1, commit b6676b88f846e551e0e20e67e9bc09d60dfb3089
D/TNS.Native(28338): JNI_ONLoad
D/TNS.Native(28338): JNI_ONLoad END
D/TNS.Native(28338): Failed to load snapshot: dlopen failed: library "libsnapshot.so" not found
D/TNS.Native(28338): V8 version 5.2.361
D/TNS.Native(28338): lenNodes=83940, lenNames=850129, lenValues=1031540
D/TNS.Native(28338): time=5
D/TNS.Java(28338): Enabling NativeScript Debugger Agent
D/AndroidRuntime(28338): Shutting down VM
W/System.err(28338): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.geteventz.app/com.tns.NativeScriptActivity}: java.lang.ClassNotFoundException: Didn't find class "com.tns.NativeScriptActivity" on path: DexPathList[[zip file "/data/app/com.geteventz.app-1/base.apk"],nativeLibraryDirectories=[/data/app/com.geteventz.app-1/lib/arm, /vendor/lib, /system/lib]]
W/System.err(28338): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2250)
W/System.err(28338): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)
W/System.err(28338): 	at android.app.ActivityThread.access$800(ActivityThread.java:155)
W/System.err(28338): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
W/System.err(28338): 	at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err(28338): 	at android.os.Looper.loop(Looper.java:135)
W/System.err(28338): 	at android.app.ActivityThread.main(ActivityThread.java:5343)
W/System.err(28338): 	at java.lang.reflect.Method.invoke(Native Method)
W/System.err(28338): 	at java.lang.reflect.Method.invoke(Method.java:372)
W/System.err(28338): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
W/System.err(28338): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:702)
W/System.err(28338): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.tns.NativeScriptActivity" on path: DexPathList[[zip file "/data/app/com.geteventz.app-1/base.apk"],nativeLibraryDirectories=[/data/app/com.geteventz.app-1/lib/arm, /vendor/lib, /system/lib]]
W/System.err(28338): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
W/System.err(28338): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
W/System.err(28338): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
W/System.err(28338): 	at android.app.Instrumentation.newActivity(Instrumentation.java:1089)
W/System.err(28338): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2240)
W/System.err(28338): 	... 10 more
W/System.err(28338): 	Suppressed: java.lang.ClassNotFoundException: com.tns.NativeScriptActivity
W/System.err(28338): 		at java.lang.Class.classForName(Native Method)
W/System.err(28338): 		at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
W/System.err(28338): 		at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
W/System.err(28338): 		at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
W/System.err(28338): 		... 13 more
W/System.err(28338): 	Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
I/Process (28338): Sending signal. PID: 28338 SIG: 9```
@petekanev petekanev changed the title Cannot run app libNativeScript.so: unused DT entry Cannot run app libNativeScript.so: class not found com.tns.NativeScriptActivity Dec 15, 2016
@petekanev
Copy link
Contributor

@victorhugom what versions of the nativescript-cli, and the android runtime package are you using (tns info)?

@victorhugom-zz
Copy link
Author

victorhugom-zz commented Dec 15, 2016

@Pip3r4o I`m using the latest versions of the cli and the runtime, but the same problem was occurring when using an older version (CLI 2.4.1 and runtime 2.4.1).

nativescript: 2.4.2
tns-core-modules: 2.4.1
tns-android: 2.4.1

@petekanev
Copy link
Contributor

petekanev commented Dec 15, 2016

@victorhugom
I was unable to reproduce the issue with those versions of the packages. I tried running the app both in release and debug configurations.

Please post a complete console output of your build/run. Thank you!

@victorhugom-zz
Copy link
Author

@Pip3r4o the output:

Executing before-prepare hook from C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\hooks\before-prepare\nativescript-dev-android-snapshot.js
Executing before-prepare hook from C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\hooks\before-prepare\nativescript-dev-typescript.js
Found peer TypeScript 2.1.4
app/app.ios.ts(89,5): error TS2304: Cannot find name 'GMSServices'.
app/app.ios.ts(97,16): error TS2304: Cannot find name 'FBSDKApplicationDelegate'.
app/app.ios.ts(101,16): error TS2304: Cannot find name 'FBSDKApplicationDelegate'.
app/app.ios.ts(105,9): error TS2304: Cannot find name 'FBSDKAppEvents'.
app/utils/camera-service.ios.ts(2,28): error TS2307: Cannot find module 'nativescript-imagepicker'.
app/utils/facebook-login.android.ts(7,9): error TS2339: Property 'facebook' does not exist on type 'typeof com'.
app/utils/facebook-login.android.ts(9,41): error TS2339: Property 'facebook' does not exist on type 'typeof com'.
app/utils/facebook-login.android.ts(11,9): error TS2339: Property 'facebook' does not exist on type 'typeof com'.
app/utils/facebook-login.android.ts(13,28): error TS2339: Property 'facebook' does not exist on type 'typeof com'.
app/utils/facebook-login.android.ts(14,33): error TS2339: Property 'facebook' does not exist on type 'typeof com'.
app/utils/facebook-login.android.ts(17,28): error TS2339: Property 'facebook' does not exist on type 'typeof com'.
app/utils/facebook-login.ios.ts(5,5): error TS2304: Cannot find name 'FBSDKLoginManager'.
app/utils/push-service.ts(1,29): error TS2307: Cannot find module 'nativescript-push-notifications'.
Project successfully prepared (android)
Executing after-prepare hook from C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\hooks\after-prepare\nativescript-dev-android-snapshot.js

:config phase: createDefaultIncludeFiles
+found plugins: nativescript-background-http
+found plugins: nativescript-camera
+found plugins: nativescript-facebook-plugin
+found plugins: nativescript-geolocation
+found plugins: nativescript-google-analytics
+found plugins: nativescript-google-maps-sdk
+found plugins: nativescript-push-notifications
+found plugins: nativescript-snackbar
+found plugins: nativescript-telerik-ui
+found plugins: tns-core-modules-widgets

:config phase: createPluginsConfigFile
Creating product flavors include.gradle file in C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android/configurations folder...

:config phase: pluginExtend
+applying configuration from: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\configurations\include.gradle
+applying configuration from: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\configurations\nativescript-background-http\include.gradle
+applying configuration from: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\configurations\nativescript-camera\include.gradle
+applying configuration from: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\configurations\nativescript-facebook-plugin\include.gradle
+applying configuration from: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\configurations\nativescript-geolocation\include.gradle
+applying configuration from: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\configurations\nativescript-google-analytics\include.gradle
+applying configuration from: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\configurations\nativescript-google-maps-sdk\include.gradle
+applying configuration from: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\configurations\nativescript-push-notifications\include.gradle
+applying configuration from: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\configurations\nativescript-snackbar\include.gradle
+applying configuration from: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\configurations\nativescript-telerik-ui\include.gradle
+applying configuration from: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\configurations\tns-core-modules-widgets\include.gradle

:config phase: copyAarDependencies

:config phase: addAarDependencies
+adding dependency: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\libs\aar\android-upload-service.aar
+adding dependency: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\libs\aar\Common-2016.3.1118-dev-release.aar
+adding dependency: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\libs\aar\Data-2016.3.1118-dev-release.aar
+adding dependency: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\libs\aar\List-2016.3.1118-dev-release.aar
+adding dependency: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\libs\aar\Primitives-2016.3.1118-dev-release.aar
+adding dependency: C:\Users\rodri\Projetos\Metheora\eventz\src\Eventz.App\platforms\android\libs\aar\widgets-release.aar
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preF0F1F2F3F4F5F6F7F8F9DebugBuild UP-TO-DATE
:checkF0F1F2F3F4F5F6F7F8F9DebugManifest
:preF0F1F2F3F4F5F6F7F8F9ReleaseBuild UP-TO-DATE
:prepareAndroidUploadServiceLibrary UP-TO-DATE
:prepareAppRuntimeUnspecifiedLibrary UP-TO-DATE
:prepareComAndroidSupportAnimatedVectorDrawable2510Library UP-TO-DATE
:prepareComAndroidSupportAppcompatV72510Library UP-TO-DATE
:prepareComAndroidSupportDesign2510Library UP-TO-DATE
:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:prepareComAndroidSupportRecyclerviewV72510Library UP-TO-DATE
:prepareComAndroidSupportSupportCompat2510Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUi2510Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUtils2510Library UP-TO-DATE
:prepareComAndroidSupportSupportFragment2510Library UP-TO-DATE
:prepareComAndroidSupportSupportMediaCompat2510Library UP-TO-DATE
:prepareComAndroidSupportSupportV42510Library UP-TO-DATE
:prepareComAndroidSupportSupportVectorDrawable2510Library UP-TO-DATE
:prepareComAndroidSupportTransition2510Library UP-TO-DATE
:prepareComFacebookAndroidFacebookAndroidSdk480Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesAnalytics1001Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl1001Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBase1001Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBasement1001Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesGcm1001Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesIid1001Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesMaps1001Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesTagmanagerV4Impl1001Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesTasks1001Library UP-TO-DATE
:prepareCommon201631118DevReleaseLibrary UP-TO-DATE
:prepareData201631118DevReleaseLibrary UP-TO-DATE
:prepareList201631118DevReleaseLibrary UP-TO-DATE
:preparePrimitives201631118DevReleaseLibrary UP-TO-DATE
:prepareWidgetsReleaseLibrary UP-TO-DATE
:prepareF0F1F2F3F4F5F6F7F8F9DebugDependencies
:compileF0F1F2F3F4F5F6F7F8F9DebugAidl UP-TO-DATE
:compileF0F1F2F3F4F5F6F7F8F9DebugRenderscript UP-TO-DATE
:generateF0F1F2F3F4F5F6F7F8F9DebugBuildConfig UP-TO-DATE
:cleanLocalAarFiles
:ensureMetadataOutDir
:collectAllJars
:setProperties
:generateTypescriptDefinitions SKIPPED
:copyTypings SKIPPED
:asbg:generateInterfaceNamesList
:asbg:traverseJsFiles
:asbg:runAstParser UP-TO-DATE
:asbg:generateBindings UP-TO-DATE
:mergeF0F1F2F3F4F5F6F7F8F9DebugShaders UP-TO-DATE
:compileF0F1F2F3F4F5F6F7F8F9DebugShaders UP-TO-DATE
:generateF0F1F2F3F4F5F6F7F8F9DebugAssets UP-TO-DATE
:mergeF0F1F2F3F4F5F6F7F8F9DebugAssets UP-TO-DATE
:generateF0F1F2F3F4F5F6F7F8F9DebugResValues UP-TO-DATE
:generateF0F1F2F3F4F5F6F7F8F9DebugResources UP-TO-DATE
:mergeF0F1F2F3F4F5F6F7F8F9DebugResources UP-TO-DATE
:processF0F1F2F3F4F5F6F7F8F9DebugManifest UP-TO-DATE
:processF0F1F2F3F4F5F6F7F8F9DebugResources UP-TO-DATE
:generateF0F1F2F3F4F5F6F7F8F9DebugSources UP-TO-DATE
:incrementalF0F1F2F3F4F5F6F7F8F9DebugJavaCompilationSafeguard UP-TO-DATE
:compileF0F1F2F3F4F5F6F7F8F9DebugJavaWithJavac UP-TO-DATE
:compileF0F1F2F3F4F5F6F7F8F9DebugNdk UP-TO-DATE
:compileF0F1F2F3F4F5F6F7F8F9DebugSources UP-TO-DATE
:prePackageMarkerForF0F1F2F3F4F5F6F7F8F9Debug
:transformClassesWithDexForF0F1F2F3F4F5F6F7F8F9Debug
Result compacted from 7158,0KiB to 5441,7KiB to save 1716,3KiB
Merged dex #1 (69 defs/105,2KiB)
Merged dex #2 (205 defs/310,8KiB)
Merged dex #3 (46 defs/56,5KiB)
Merged dex #4 (5 defs/15,0KiB)
Merged dex #5 (359 defs/589,4KiB)
Merged dex #6 (206 defs/295,8KiB)
Merged dex #7 (10 defs/24,7KiB)
Merged dex #8 (157 defs/334,3KiB)
Merged dex #9 (691 defs/605,8KiB)
Merged dex #10 (138 defs/248,9KiB)
Merged dex #11 (70 defs/100,0KiB)
Merged dex #12 (73 defs/177,8KiB)
Merged dex #13 (221 defs/221,7KiB)
Merged dex #14 (1 defs/0,7KiB)
Merged dex #15 (15 defs/47,9KiB)
Merged dex #16 (83 defs/85,0KiB)
Merged dex #17 (491 defs/559,6KiB)
Merged dex #18 (2 defs/2,0KiB)
Merged dex #19 (133 defs/167,5KiB)
Merged dex #20 (314 defs/281,3KiB)
Merged dex #21 (318 defs/318,6KiB)
Merged dex #22 (28 defs/42,1KiB)
Merged dex #23 (8 defs/23,9KiB)
Merged dex #24 (311 defs/252,8KiB)
Merged dex #25 (225 defs/192,6KiB)
Merged dex #26 (29 defs/20,9KiB)
Merged dex #27 (152 defs/283,3KiB)
Merged dex #28 (34 defs/35,3KiB)
Merged dex #29 (23 defs/30,7KiB)
Merged dex #30 (92 defs/171,0KiB)
Merged dex #31 (57 defs/101,6KiB)
Merged dex #32 (21 defs/38,7KiB)
Merged dex #33 (93 defs/177,3KiB)
Merged dex #34 (15 defs/16,9KiB)
Merged dex #35 (47 defs/8,8KiB)
Result is 4742 defs/5441,7KiB. Took 1,1s
:myMergeDex
Result compacted from 6765,0KiB to 5449,7KiB to save 1315,2KiB
Merged dex #1 (1 defs/1,9KiB)
Merged dex #2 (1 defs/1,4KiB)
Merged dex #3 (1 defs/1,6KiB)
Merged dex #4 (1 defs/1,7KiB)
Merged dex #5 (1 defs/1,4KiB)
Merged dex #6 (1 defs/1,3KiB)
Merged dex #7 (1 defs/1,4KiB)
Merged dex #8 (1 defs/1,6KiB)
Merged dex #9 (1 defs/1,5KiB)
Merged dex #10 (1 defs/2,1KiB)
Merged dex #11 (1 defs/1,4KiB)
Merged dex #12 (1 defs/1,4KiB)
Merged dex #13 (1 defs/1,4KiB)
Merged dex #14 (1 defs/1,4KiB)
Merged dex #15 (1 defs/1,4KiB)
Merged dex #16 (1 defs/1,4KiB)
Merged dex #17 (1 defs/1,4KiB)
Merged dex #18 (1 defs/1,5KiB)
Merged dex #19 (1 defs/1,4KiB)
Merged dex #20 (1 defs/1,4KiB)
Merged dex #21 (1 defs/1,3KiB)
Merged dex #22 (1 defs/1,3KiB)
Merged dex #23 (4742 defs/5441,7KiB)
Result is 4764 defs/5449,7KiB. Took 0,5s
:buildMetadata UP-TO-DATE
:mergeF0F1F2F3F4F5F6F7F8F9DebugJniLibFolders UP-TO-DATE
:transformNative_libsWithMergeJniLibsForF0F1F2F3F4F5F6F7F8F9Debug UP-TO-DATE
:processF0F1F2F3F4F5F6F7F8F9DebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForF0F1F2F3F4F5F6F7F8F9Debug UP-TO-DATE
:validateDebugSigning
:packageF0F1F2F3F4F5F6F7F8F9Debug UP-TO-DATE
:zipalignF0F1F2F3F4F5F6F7F8F9Debug UP-TO-DATE
:assembleF0F1F2F3F4F5F6F7F8F9Debug UP-TO-DATE
:assembleDebug UP-TO-DATE
:buildapk UP-TO-DATE

BUILD SUCCESSFUL

Total time: 34.894 secs
Project successfully built
Successfully deployed on device with identifier '0017905909'.

@naderio
Copy link

naderio commented Jan 12, 2017

same here with similar setup using following plugins

  • nativescript-geolocation
  • nativescript-google-analytics
  • nativescript-google-maps-sdk
  • nativescript-push-notifications
  • nativescript-snackbar
  • nativescript-telerik-ui
  • ...
$ tns info
All NativeScript components versions information
┌──────────────────┬─────────────────┬────────────────┬───────────────┐
│ Component        │ Current version │ Latest version │ Information   │
│ nativescript     │ 2.4.2           │ 2.4.2          │ Up to date    │
│ tns-core-modules │ 2.4.4           │ 2.4.4          │ Up to date    │
│ tns-android      │ 2.4.1           │ 2.4.1          │ Up to date    │
│ tns-ios          │                 │ 2.4.0          │ Not installed │
└──────────────────┴─────────────────┴────────────────┴───────────────┘

Android SDK Tools: 25.2.5
Android SDK Platform-tools: 25.0.3
Android SDK Build-tools: 25.0.2

removing nativescript-snackbar "fixes" the issue but not sure why...

@petekanev
Copy link
Contributor

petekanev commented Jan 12, 2017

@naderio @victorhugom the bug has been fixed, and is available in android@next, the upcoming 2.5 release which is coming this month also contains the fix.

NativeScript/android#665

@hypery2k
Copy link

is there an release plan for 2.5?

@petekanev
Copy link
Contributor

2.5 comes out next week, meanwhile if this is a showstopper for your project you could temporarily resort to using android@next.

@naderio
Copy link

naderio commented Jan 26, 2017

or just rollback android sdk version (remove version 25). check following setup
android sdk manager _040
android sdk manager _039
terminal_041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants