Attempt to invoke virtual method 'java.lang.String java.lang.Package.getName()' - from Retrofit generating implementations from interfaces

Abierto
#528 13 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
android, java
Área
mobile-dev

Línea de trabajo

Comienza con la llamada que falla en spotify-api/src/main/java/kaaes/spotify/webapi/android/SpotifyApi.java alrededor de la línea 69 y con las ubicaciones del stack trace en Runtime.java alrededor de las líneas 426 y 403. Revisa el pull request 501 enlazado de android-runtime para determinar si aborda las implementaciones generadas a partir de interfaces; se consideraría terminado si se confirma que restAdapter.create(SpotifyService.class) funciona o se documenta que sigue sin estar soportado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Curious if this is currently supported. I have tried many different things but none seem to work.
The issue seems to stem from the fact that the Retrofit (http://square.github.io/retrofit/) library generates implementations from interfaces and relies on the ability to take say an interface file (for example):

public interface SpotifyService {...

And generate an implementation by doing this restAdapter.create(SpotifyService.class) which crashes immediately with:

com.tns.NativeScriptException: 
Error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Package.getName()' on a null object reference
    com.tns.Runtime.getTypeMetadata(Runtime.java:426)
    com.tns.Runtime.getTypeMetadata(Runtime.java:403)
    com.tns.Runtime.callJSMethodNative(Native Method)
    com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:861)
    com.tns.Runtime.callJSMethodImpl(Runtime.java:726)
    com.tns.Runtime.callJSMethod(Runtime.java:712)
    com.tns.Runtime.callJSMethod(Runtime.java:693)
    com.tns.Runtime.callJSMethod(Runtime.java:683)

The library I'm trying to use does this here:
https://github.com/kaaes/spotify-web-api-android/blob/master/spotify-api/src/main/java/kaaes/spotify/webapi/android/SpotifyApi.java#L69

Is there a way to make this work currently or is support for this planned and if so, it would be much appreciated to know approximately when?

UPDATE:
I found this https://github.com/NativeScript/android-runtime/pull/501, curious if it's related and if that PR which is now merged will make something like the above possible with 2.2.0?

/cc @bradmartin

Lenguaje dominante
C++
Estrellas
563
Forks
144
Merge medio
10 h 46 min
PR fusionados (30 d)
14

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NativeScript/android

Todos los issues de NativeScript/android

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.