vkammerer / ussd_service

A Flutter plugin to make USSD requests
https://pub.dev/packages/ussd_service
BSD 2-Clause "Simplified" License
21 stars 14 forks source link

androidx.core.app.ActivityCompat missing in 0.1.0 for release #3

Closed LSambo02 closed 4 years ago

LSambo02 commented 4 years ago

Hi @vkammerer, I was using this pluggin on 0.0.4+1 and it gave me a little issues when bulding the release but by changing the local.properties and updating the targeSdkversion i managed to build it, but was prompting the Exception on which subscriptionId and/or code wasnt on required type in just one phone, which made me change to 0.1.0 that throws the above error even tho I update Gradle and files such as local.propertires and gradle files.

`*****.pub-cache/hosted/pub.dartlang.org/ussd_service-0.1.0/android/src/main/java/com/vincentkammerer/ussd_service/UssdServicePlugin.java:12: error: package androidx.core.app does not exist
import androidx.core.app.ActivityCompat;
                        ^
******.pub-cache/hosted/pub.dartlang.org/ussd_service-0.1.0/android/src/main/java/com/vincentkammerer/ussd_service/UssdServicePlugin.java:126: error: cannot find symbol
    if (ActivityCompat.checkSelfPermission(this.context, permission.CALL_PHONE)
        ^
  symbol:   variable ActivityCompat
  location: class UssdServicePlugin
2 errors
vkammerer commented 4 years ago

Hi @LSambo02 , I am very busy with work this week, but will get back to you regarding your issue next week.

LSambo02 commented 4 years ago

I appreciate your attention on that matter!

m-haisham commented 4 years ago

you have a solution for this?

vkammerer commented 4 years ago

I have just pushed a new version 0.1.0+1. Could you try it out and let me know if it works on your end?

m-haisham commented 4 years ago

I have no errors

LSambo02 commented 4 years ago

I updated to the latest version, in debug everything work but in release i got this. Unfortunately I haven't update AS to the latest, and I'm not planning in doing at moment - due to incompatibilities with Flutter - to run some tests on the plugin myself. I got this error:

/Users/igorsambo/Mac/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/ussd_service-0.1.0+2/android/src/main/java/com/vincentkammerer/ussd_service/UssdServicePlugin.java:8: error: cannot find symbol
import androidx.annotation.NonNull;
                          ^
  symbol:   class NonNull
  location: package androidx.annotation
/Users/igorsambo/Mac/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/ussd_service-0.1.0+2/android/src/main/java/com/vincentkammerer/ussd_service/UssdServicePlugin.java:9: error: package androidx.core.content does not exist
import androidx.core.content.ContextCompat;
                            ^
/Users/igorsambo/Mac/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/ussd_service-0.1.0+2/android/src/main/java/com/vincentkammerer/ussd_service/UssdServicePlugin.java:27: error: cannot find symbol
  public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
                                  ^
  symbol:   class NonNull
  location: class UssdServicePlugin
/Users/igorsambo/Mac/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/ussd_service-0.1.0+2/android/src/main/java/com/vincentkammerer/ussd_service/UssdServicePlugin.java:43: error: cannot find symbol
  public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
                                    ^
  symbol:   class NonNull
  location: class UssdServicePlugin
/Users/igorsambo/Mac/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/ussd_service-0.1.0+2/android/src/main/java/com/vincentkammerer/ussd_service/UssdServicePlugin.java:50: error: cannot find symbol
  public void onMethodCall(@NonNull MethodCall call, @NonNull final Result result) {
                            ^
  symbol:   class NonNull
  location: class UssdServicePlugin
/Users/igorsambo/Mac/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/ussd_service-0.1.0+2/android/src/main/java/com/vincentkammerer/ussd_service/UssdServicePlugin.java:50: error: cannot find symbol
  public void onMethodCall(@NonNull MethodCall call, @NonNull final Result result) {
                                                      ^
  symbol:   class NonNull
  location: class UssdServicePlugin
/Users/igorsambo/Mac/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/ussd_service-0.1.0+2/android/src/main/java/com/vincentkammerer/ussd_service/UssdServicePlugin.java:90: error: cannot find symbol
    UssdRequestParams(@NonNull MethodCall call) throws RequestParamsException {
                       ^
  symbol:   class NonNull
  location: class UssdRequestParams
/Users/igorsambo/Mac/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/ussd_service-0.1.0+2/android/src/main/java/com/vincentkammerer/ussd_service/UssdServicePlugin.java:125: error: cannot find symbol
    if (ContextCompat.checkSelfPermission(this.context, permission.CALL_PHONE)
        ^
  symbol:   variable ContextCompat
  location: class UssdServicePlugin
8 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
> 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

BUILD FAILED in 41s

Can you please see this! Some test in release mode could be helpful! Thank you...

LSambo02 commented 4 years ago

@vkammerer, should I open a new issue on this?

vkammerer commented 4 years ago

@LSambo02 it looks like your app doesn't include AndroidX, is that right? In that case, I suggest you add it. you can find more info on the official documentation