Solucionado (ver solução)
Solucionado
(ver solução)
6
respostas

Erro ao criar um app release no android studio : App Cordova

Ao criar o release do app no android studio usando meu .jks normalmente, pois o uso para publicar todas as versões anteriores do mesmo app, foi reportado o seguinte erro: Crashlytics found an invalid API key: null. Check the Crashlytics plugin to make sure that the application has been added successfully! Contact support@fabric.io for assistance.

6 respostas

Oi Nilton, tudo bem? Sinto muito pela demora, mas você conseguiu prosseguir?

Até onde vi, parece solucionar se você mover as chaves do Manifest.xml para o fabric.properties pelo menos é o que achei nesse tópico do StackOverflow: https://stackoverflow.com/questions/27472452/crashlytics-found-an-invalid-api-key-androidstudio-build

Criei a API key e agora esta dando estes erros:

Task :app:compileDebugJavaWithJavac FAILED /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java:6: error: cannot find symbol import com.google.firebase.iid.FirebaseInstanceIdService; ^ symbol: class FirebaseInstanceIdService location: package com.google.firebase.iid /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java:8: error: cannot find symbol public class FirebasePluginInstanceIDService extends FirebaseInstanceIdService { ^ symbol: class FirebaseInstanceIdService /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java:17: error: method does not override or implement a method from a supertype @Override ^ /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:610: error: method getByteArray in class FirebaseRemoteConfig cannot be applied to given types; : FirebaseRemoteConfig.getInstance().getByteArray(key, namespace); ^ required: String found: String,String reason: actual and formal argument lists differ in length /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:629: error: method getValue in class FirebaseRemoteConfig cannot be applied to given types; : FirebaseRemoteConfig.getInstance().getValue(key, namespace); ^ required: String found: String,String reason: actual and formal argument lists differ in length /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:686: error: no suitable method found for setDefaults(Map<String,Object>,String) FirebaseRemoteConfig.getInstance().setDefaults(defaultsToMap(defaults), namespace); ^ method FirebaseRemoteConfig.setDefaults(Map<String,Object>) is not applicable (actual and formal argument lists differ in length) method FirebaseRemoteConfig.setDefaults(int) is not applicable (actual and formal argument lists differ in length) /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:885: error: cannot find symbol myTrace.incrementCounter(counterNamed); ^ symbol: method incrementCounter(String) location: variable myTrace of type Trace Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 7 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 24s 30 actionable tasks: 16 executed, 14 up-to-date

Oi Nilton, tudo bem? Agora o problema é que o build aparentemente não está encontrando algumas classes do pacote do Firebase. Nesse caso, é preciso uma investigação mais profunda para ver se é algum problema de versão específico, etc.

Wanderson boa noite,

Então não consigo resolver pois ele aparece que varias classes estão descontinuadas, não tem nenhum path para rodar no cordova para resolver isso? Uso o plugin cordova firebase para enviar push e agora começou a dar esse tipo de problema.

Não tenho muita certeza Nilton, mas a documentação do plugin em si aponta que o build pode falhar por causa do Google Play Services: https://github.com/arnesson/cordova-plugin-firebase#google-play-services

O projeto que você está desenvolvendo, é o do curso? Posso ver e testar pra entender o que pode estar acontecendo e procurar uma solução?

solução!

O projeto não é do curso Wanderson, rodei os recursos do post que me enviou mas mesmo assim o problema persiste:

Task :app:compileDebugJavaWithJavac FAILED /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java:6: error: cannot find symbol import com.google.firebase.iid.FirebaseInstanceIdService; ^ symbol: class FirebaseInstanceIdService location: package com.google.firebase.iid /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java:8: error: cannot find symbol public class FirebasePluginInstanceIDService extends FirebaseInstanceIdService { ^ symbol: class FirebaseInstanceIdService /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java:17: error: method does not override or implement a method from a supertype @Override ^ /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:610: error: method getByteArray in class FirebaseRemoteConfig cannot be applied to given types; : FirebaseRemoteConfig.getInstance().getByteArray(key, namespace); ^ required: String found: String,String reason: actual and formal argument lists differ in length /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:629: error: method getValue in class FirebaseRemoteConfig cannot be applied to given types; : FirebaseRemoteConfig.getInstance().getValue(key, namespace); ^ required: String found: String,String reason: actual and formal argument lists differ in length /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:686: error: no suitable method found for setDefaults(Map<String,Object>,String) FirebaseRemoteConfig.getInstance().setDefaults(defaultsToMap(defaults), namespace); ^ method FirebaseRemoteConfig.setDefaults(Map<String,Object>) is not applicable (actual and formal argument lists differ in length) method FirebaseRemoteConfig.setDefaults(int) is not applicable (actual and formal argument lists differ in length) /Users/noliveira/projetos/cnsocial/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:885: error: cannot find symbol myTrace.incrementCounter(counterNamed); ^ symbol: method incrementCounter(String) location: variable myTrace of type Trace Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 7 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 11s 33 actionable tasks: 30 executed, 3 up-to-date