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

Build on Android not working #1

Open
darrenkhouston opened this issue Dec 18, 2018 · 4 comments
Open

Build on Android not working #1

darrenkhouston opened this issue Dec 18, 2018 · 4 comments

Comments

@darrenkhouston
Copy link

darrenkhouston commented Dec 18, 2018

When building for Android, app throws a JavaScript error and is unable to build.

An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication:
com.tns.NativeScriptException:

Error calling module function

Error calling module function

Error: java.lang.ClassNotFoundException: com.tns.NativeScriptActivity
java.lang.Class.classForName(Native Method)
java.lang.Class.forName(Class.java:453)
java.lang.Class.forName(Class.java:378)
com.tns.Runtime.getClassForName(Runtime.java:1036)
com.tns.ClassResolver.resolveClass(ClassResolver.java:27)
com.tns.Runtime.resolveClass(Runtime.java:604)
com.tns.Runtime.runModule(Native Method)
com.tns.Runtime.runModule(Runtime.java:553)
com.tns.Runtime.run(Runtime.java:545)
com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871)
android.app.ActivityThread.access$1100(ActivityThread.java:199)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
android.os.Handler.dispatchMessage(Handler.java:106)
android.os.Looper.loop(Looper.java:193)
android.app.ActivityThread.main(ActivityThread.java:6669)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

When I comment out the MultiDrawer import from my main.js file, the error goes away and my app builds fine, so this is what I have narrowed it down to.

One thing to note: If I build the app with a different drawer like RadSideDrawer, then comment out the RadSideDrawer and uncomment out the MultiDrawer (without rebuilding) tns run android --bundle, it will work fine. If I run a clean and build, it throws the error above.

@darrenkhouston
Copy link
Author

Any update on this? It is not usable on Android.

@wpatter6
Copy link

wpatter6 commented Mar 12, 2019

This was working great for me last night and then for some reason, this morning I'm getting this same error as soon as it installs on android.

Really hoping this can get fixed, love this package but it's completely unusable right now!

Edit: Seems to be intermittent... when I remove the package from package.json and then re-add it, it seems to work... not sure what is corrupting it but I'll update if I find more info

@wpatter6
Copy link

wpatter6 commented Mar 13, 2019

Another update: This issue appears to start happening when the platforms are re-built while this package is implemented on the app. It doesn't have to do with the package being installed by npm at all.

The way I've found to make the error go away is to comment out all of the references to the MultiDrawer, including the import and Vue.use statement, as well as any vue component templates that reference <MultiDrawer>, and then delete the platforms folder.

Then build or debug the app. Once it finishes building, you can uncomment the references to this package and then it should build correctly after that (until the next time platforms are re-built). If you are making changes to app_resources or any other change that could cause platforms to re-build, to save time you can do this process prior to building the app and uncommenting after it's built.

Hopefully this info can help get this issue figured out, it's a pretty big pain but this is still the best drawer I've found for nativescript, considering the others I've found do not work at all in the current version...

@Jonarod
Copy link

Jonarod commented Jun 14, 2019

Well what versions are you using ?
I just performed a rm -rf platforms/ && rm -rf node_modules then npm i then finally tns build android --bundle... and the drawer is here working.

Versions:

    "tns-android": {
      "version": "5.4.0"
    }
    "nativescript-vue": "^2.2.2",
    "nativescript-vue-multi-drawer": "0.0.2",
    "tns-core-modules": "^5.4.2",

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

No branches or pull requests

3 participants