NativeScript / NativeScript/nativescript-cli
Extended Android Activity crashes unit-test-runner
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- JavaScript
- Estrelas
- 1.1k
- Forks
- 204
- Merge médio
- 1d 9h
- PRs com merge (30d)
- 8
Descrição
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
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Reproduza o crash com ns create ns-test --ts, uma atividade Android estendida, ns test init e ns test android. Comece rastreando como nativescript-unit-test-runner substitui o webpack e resolve activity.android.ts; o trabalho estará concluído quando os testes unitários forem executados com sucesso na presença de uma atividade Android estendida.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- android, javascript, typescript
- Domínio
- cli, mobile, testing
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100