NativeScript / NativeScript/nativescript-cli
Extended Android Activity crashes unit-test-runner
Personne n'a encore pris cette issue.
- Langage dominant
- JavaScript
- Étoiles
- 1.1k
- Forks
- 204
- Merge moyen
- 1 j 9 h
- PR mergées (30 j)
- 8
Description
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- CLI: 8.1.4
- Cross-platform modules: @nativescript/core 8.1.1
- Android Runtime: 8.1.1
Describe the bug
the nativescript-unit-test-runner is overriding webpack such that the extended activity file (activity.android.ts) is not resolved causing
a crash:
...
System.err: Unable to instantiate activity ComponentInfo{org.nativescript.nstest/org.myApp.MainActivity}: com.tns.NativeScriptException: Failed to create JavaScript extend wrapper for class 'org/myApp/MainActivity'
System.err:
System.err: StackTrace:
System.err: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.nativescript.nstest/org.myApp.MainActivity}: com.tns.NativeScriptException: Failed to create JavaScript extend wrapper for class 'org/myApp/MainActivity'
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3194)
...
To Reproduce
-
create new app
ns create ns-test --ts -
extend Android activity following the instructions here: https://docs.nativescript.org/advanced-concepts.html#extending-android-activity
-
verify that the app runs as expected
ns run android(the app runs without any problems) -
initialize tests
ns test initand selectjasmine -
run tests
ns test android -
crash and burn
Expected behavior
That unit tests run, even in the presence of an extended android activity
Sample project
Can't, updating AndroidManifest is required
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Reproduisez le crash avec ns create ns-test --ts, une activité Android étendue, ns test init et ns test android. Commencez par suivre la manière dont nativescript-unit-test-runner surcharge webpack et résout activity.android.ts ; le travail est terminé lorsque les tests unitaires s’exécutent correctement en présence d’une activité Android étendue.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- android, javascript, typescript
- Domaine
- cli, mobile, testing
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100