android gps ON requests

205 views
Skip to first unread message

purushottam yadav

unread,
Jan 1, 2023, 10:57:22 AM1/1/23
to Kivy users support
i am using below class to get gps lat , lon .but this class only takes permission and  updates lat ,lon if  gps is ON already  ,   how to ask for user to on gps just like google maps  , it asks to ON gps with popup just after opening the app .

class GpsHelper():
    has_centered_map=False
    configured = False

    def run(self):

 
        #Request permission on Android
        if platform == "android":
            from android.permissions import Permission,request_permissions
            def callback(permission,results):
                if all([res for res in results]):
                    print("Got all permissions")
                    from plyer import gps

                    #k.help_str.get_screen('imagepick').manager.current = 'imagepick'
                    if not self.configured :

                        gps.configure(on_location=self.update_blinker_position,
                                      on_status=self.on_auth_status)
                        gps.start(minTime=1000,minDistance=0)
                        self.configured = True

                else:
                    print("Did not get all permissions")

            #we put these two parameter inside of buildozer.spec file
            request_permissions([Permission.ACCESS_COARSE_LOCATION,
                                  Permission.ACCESS_FINE_LOCATION],callback)


        else :
            k.lat = 17.0
            k.lon = 78.0  #configure GPS
            k.addingposts()
        if platform == "ios" :

            from plyer import gps
            gps.configure(on_location=self.update_blinker_position,
                          on_status=self.on_auth_status)
            gps.start(minTime=10000,minDistance=0)


    #on_location pass to function  update_blinker_position.it is took lat,lon and values and pass to kwargs.
    def update_blinker_position(self,*args,**kwargs):

        my_lat=kwargs['lat']
        my_lon=kwargs["lon"]

        k.lat = my_lat
        k.lon = my_lon

        try :

            if k.readytoshow  :
                print("  ")
        except :



            k.addingposts()


        print("GPS POSITION>>>>>>>>>>>>>>>>>>>>>>>>>>>",my_lat,my_lon)
        # gps_blinker = k.help_str.get_screen('hello').ids.mapview.ids.blinker
        # gps_blinker.lat=my_lat
        # gps_blinker.lon=my_lon

        #self.open_gps_access(my_lat,my_lon)
        #update GpsBlinker position
#        gps_blinker = App.get_running_app().root.ids.mapview.ids.blinker
#        gps_blinker.lat=my_lat
#        gps_blinker.lon=my_lon

        #Center Map on GPS.First we reference to the app
        if not self.has_centered_map:
            try :



                map = k.help_str.get_screen('hello').ids.mapppp # mapview
                for ch in map.children  :
                    print( ch  )
                    if "map" in str( ch ) :
                        ch.center_on(my_lat , my_lon)
                        self.has_centered_map=True

                #map.center_on(my_lat,my_lon)

                #map=App.get_running_app().root.ids.mapview
                #map.center_on(my_lat,my_lon)
                # self.has_centered_map=True
            except :
                pass


    def open_gps_access(self , my_lat,my_lon):
        h = str(my_lat) + "  " + str (my_lon )
        dialog=MDDialog(title="GPS ",text=h)
        dialog.size_hint=[.8,.8]
        dialog.pos_hint={'center_x':.5,'center_y':.5}
        #dialog.open()

    #when on_status function in line 18 recive a  new status  it passes 2 variables.
    def on_auth_status(self,general_status,status_message):

        if general_status=="provider-enabled": #that means we got gps position
            pass
        else:
            self.open_gps_access_popup()

    def open_gps_access_popup(self):


        dialog=MDDialog(title="GPS Error",text="You need to enable to GPS access for the app to function properly")
        dialog.size_hint=[.8,.8]
        dialog.pos_hint={'center_x':.5,'center_y':.5}
        #dialog.open()

Robert

unread,
Jan 1, 2023, 3:04:09 PM1/1/23
to Kivy users support
This might be normal Android behavior and an artifact of the testing.
See last paragraph <https://github.com/Android-for-Python/Android-for-Python-Users#user-permissions>

purushottam yadav

unread,
Jan 1, 2023, 11:31:20 PM1/1/23
to Kivy users support

i am not saying about taking permission , i can do that , after taking permission , user need to ON the GPS of the device to use it . if it  is not ON , app can not get lat ,  lon of the device even after having permission to access .
how to bring up a popup to ON the gps   like in this image  , this does not come after taking permissions .WhatsApp Image 2023-01-02 at 9.57.39 AM.jpeg  

Robert

unread,
Jan 2, 2023, 12:50:14 AM1/2/23
to Kivy users support

purushottam yadav

unread,
Jan 2, 2023, 1:12:18 PM1/2/23
to Kivy users support
https://trickyworld.tech/gps-popup-turn-on-gps-location-without-going-to-the-settings-in-android-kotlin/ 

i  want to use code in above link to ON GPS , but it is java , how to implement it in pyjnius , i  am confused ,  how to do it  ?

Robert

unread,
Jan 2, 2023, 4:12:40 PM1/2/23
to Kivy users support
With Pyjnius you can reference Kotlin classes in the same way as Java classes.

I don't have any Python examples that are similar. I don't even know if that approach would be the easiest to try. Sorry.

purushottam yadav

unread,
Jan 8, 2023, 4:45:57 AM1/8/23
to Kivy users support
how to deal with this  error ?

i am using java file to get   prompt to user to on gps on android device .
i need help in importing modules and  using them

=================================== 
            PythonActivity = autoclass("org.kivy.android.PythonActivity")
            Contact = autoclass("Contact")
            Contact.addContact(PythonActivity.mActivity, "Steve", "666", "stev...@gmail.com")

===================================  Contact.java  file ============

import android.app.Activity;
import android.content.Intent;
import android.location.LocationRequest ;
import com.google.android.gms;



public class Contact{

    public static void addContact(Activity pyActivity, String name, String phone, String email){
   
   
    LocationRequest locationRequest = LocationRequest.create();
    locationRequest.setInterval(10000);
    locationRequest.setFastestInterval(5000);
    locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
       
    LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
     .addLocationRequest(locationRequest);
     
    LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();
    SettingsClient client = LocationServices.getSettingsClient(pyActivity);
    Task<LocationSettingsResponse> task = client.checkLocationSettings(builder.build());
   
    task.addOnSuccessListener( pyActivity , new OnSuccessListener<LocationSettingsResponse>() {
   
    @Override
    public void onSuccess(LocationSettingsResponse locationSettingsResponse) {
        // All location settings are satisfied. The client can initialize
        // location requests here.
        // ...
      }   });

    task.addOnFailureListener( pyActivity , new OnFailureListener() {
   
    @Override
    public void onFailure(@NonNull Exception e) {
        if (e instanceof ResolvableApiException) {
            // Location settings are not satisfied, but this can be fixed
            // by showing the user a dialog.
            try {
                // Show the dialog by calling startResolutionForResult(),
                // and check the result in onActivityResult().
                ResolvableApiException resolvable = (ResolvableApiException) e;
                resolvable.startResolutionForResult( pyActivity  ,  REQUEST_CHECK_SETTINGS);
            } catch (IntentSender.SendIntentException sendEx) {
                // Ignore the error.
            }
        }
    }
});
     
    }

}




======================================== 









[DEBUG]:   -> running gradlew assembleDebug
[DEBUG]:      
[DEBUG]:       > Configure project :
[DEBUG]:       WARNING: The option setting 'android.bundle.enableUncompressedNativeLibs=false' is experimental and unsupported.
[DEBUG]:       The current default is 'true'.
[DEBUG]:      
[DEBUG]:      
[DEBUG]:       > Task :processDebugManifest
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/.buildozer/android/platform/build-arm64-v8a/dists/gnetwork/src/main/AndroidManifest.xml:35:5-81 Warning:
[DEBUG]:               Element uses-permission#android.permission.WRITE_EXTERNAL_STORAGE at AndroidManifest.xml:35:5-81 duplicated with element declared at AndroidManifest.xml:28:5-81
[DEBUG]:       aapt2 W 01-08 15:01:08 27176 27176 LoadedArsc.cpp:657] Unknown chunk type '200'.
[DEBUG]:      
[DEBUG]:      
[DEBUG]:       > Task :compileDebugJavaWithJavac FAILED
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:5: error: cannot find symbol
[DEBUG]:       import com.google.android.gms;
[DEBUG]:                                ^
[DEBUG]:         symbol:   class gms
[DEBUG]:         location: package com.google.android
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:14: error: cannot find symbol
[DEBUG]:           LocationRequest locationRequest = LocationRequest.create();
[DEBUG]:                                                            ^
[DEBUG]:         symbol:   method create()
[DEBUG]:         location: class LocationRequest
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:15: error: cannot find symbol
[DEBUG]:           locationRequest.setInterval(10000);
[DEBUG]:                          ^
[DEBUG]:         symbol:   method setInterval(int)
[DEBUG]:         location: variable locationRequest of type LocationRequest
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:16: error: cannot find symbol
[DEBUG]:           locationRequest.setFastestInterval(5000);
[DEBUG]:                          ^
[DEBUG]:         symbol:   method setFastestInterval(int)
[DEBUG]:         location: variable locationRequest of type LocationRequest
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:17: error: cannot find symbol
[DEBUG]:           locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
[DEBUG]:                                                      ^
[DEBUG]:         symbol:   variable PRIORITY_HIGH_ACCURACY
[DEBUG]:         location: class LocationRequest
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:19: error: package LocationSettingsRequest does not exist
[DEBUG]:           LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
[DEBUG]:                                  ^
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:19: error: package LocationSettingsRequest does not exist
[DEBUG]:           LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
[DEBUG]:                                                                                ^
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:22: error: package LocationSettingsRequest does not exist
[DEBUG]:           LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();
[DEBUG]:                                  ^
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:22: error: package LocationSettingsRequest does not exist
[DEBUG]:           LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();
[DEBUG]:                                                                                ^
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:23: error: cannot find symbol
[DEBUG]:           SettingsClient client = LocationServices.getSettingsClient(pyActivity);
[DEBUG]:           ^
[DEBUG]:         symbol:   class SettingsClient
[DEBUG]:         location: class Contact
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:23: error: cannot find symbol
[DEBUG]:           SettingsClient client = LocationServices.getSettingsClient(pyActivity);
[DEBUG]:                                   ^
[DEBUG]:         symbol:   variable LocationServices
[DEBUG]:         location: class Contact
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:24: error: cannot find symbol
[DEBUG]:           Task<LocationSettingsResponse> task = client.checkLocationSettings(builder.build());
[DEBUG]:           ^
[DEBUG]:         symbol:   class Task
[DEBUG]:         location: class Contact
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:24: error: cannot find symbol
[DEBUG]:           Task<LocationSettingsResponse> task = client.checkLocationSettings(builder.build());
[DEBUG]:                ^
[DEBUG]:         symbol:   class LocationSettingsResponse
[DEBUG]:         location: class Contact
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:26: error: cannot find symbol
[DEBUG]:           task.addOnSuccessListener( pyActivity , new OnSuccessListener<LocationSettingsResponse>() {
[DEBUG]:                                                       ^
[DEBUG]:         symbol:   class OnSuccessListener
[DEBUG]:         location: class Contact
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:26: error: cannot find symbol
[DEBUG]:           task.addOnSuccessListener( pyActivity , new OnSuccessListener<LocationSettingsResponse>() {
[DEBUG]:                                                                         ^
[DEBUG]:         symbol:   class LocationSettingsResponse
[DEBUG]:         location: class Contact
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:29: error: cannot find symbol
[DEBUG]:           public void onSuccess(LocationSettingsResponse locationSettingsResponse) {
[DEBUG]:                                 ^
[DEBUG]:         symbol: class LocationSettingsResponse
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:28: error: method does not override or implement a method from a supertype
[DEBUG]:           @Override
[DEBUG]:           ^
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:35: error: cannot find symbol
[DEBUG]:           task.addOnFailureListener( pyActivity , new OnFailureListener() {
[DEBUG]:                                                       ^
[DEBUG]:         symbol:   class OnFailureListener
[DEBUG]:         location: class Contact
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:38: error: cannot find symbol
[DEBUG]:           public void onFailure(@NonNull Exception e) {
[DEBUG]:                                  ^
[DEBUG]:         symbol: class NonNull
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:37: error: method does not override or implement a method from a supertype
[DEBUG]:           @Override
[DEBUG]:           ^
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:39: error: cannot find symbol
[DEBUG]:               if (e instanceof ResolvableApiException) {
[DEBUG]:                                ^
[DEBUG]:         symbol: class ResolvableApiException
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:45: error: cannot find symbol
[DEBUG]:                       ResolvableApiException resolvable = (ResolvableApiException) e;
[DEBUG]:                       ^
[DEBUG]:         symbol: class ResolvableApiException
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:45: error: cannot find symbol
[DEBUG]:                       ResolvableApiException resolvable = (ResolvableApiException) e;
[DEBUG]:                                                            ^
[DEBUG]:         symbol: class ResolvableApiException
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:46: error: cannot find symbol
[DEBUG]:                       resolvable.startResolutionForResult( pyActivity  ,  REQUEST_CHECK_SETTINGS);
[DEBUG]:                                                                           ^
[DEBUG]:         symbol: variable REQUEST_CHECK_SETTINGS
[DEBUG]:       /home/purushottamdev/directory_env/f/ff/libs/Contact.java:47: error: package IntentSender does not exist
[DEBUG]:                   } catch (IntentSender.SendIntentException sendEx) {
[DEBUG]:                                        ^
[DEBUG]:       Note: Some input files use or override a deprecated API.
[DEBUG]:       Note: Recompile with -Xlint:deprecation for details.
[DEBUG]:       Note: Some input files use unchecked or unsafe operations.
[DEBUG]:       Note: Recompile with -Xlint:unchecked for details.
[DEBUG]:       25 errors
[DEBUG]:      
[DEBUG]:       FAILURE: Build failed with an exception.
[DEBUG]:      
[DEBUG]:       * What went wrong:
[DEBUG]:       Execution failed for task ':compileDebugJavaWithJavac'.
[DEBUG]:       > Compilation failed; see the compiler error output for details.
[DEBUG]:      
[DEBUG]:       * Try:
[DEBUG]:       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.
[DEBUG]:      
[DEBUG]:       * Get more help at https://help.gradle.org
[DEBUG]:      
[DEBUG]:       Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[DEBUG]:       Use '--warning-mode all' to show the individual deprecation warnings.
[DEBUG]:       See https://docs.gradle.org/6.9.1/userguide/command_line_interface.html#sec:command_line_warnings
[DEBUG]:      
[DEBUG]:       BUILD FAILED in 13s
[DEBUG]:       18 actionable tasks: 18 executed

Exception in thread background thread for pid 27015:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()    
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/purushottamdev/directory_env/f/lib/python3.8/site-packages/sh.py", line 1683, in wrap
    fn(*rgs, **kwargs)
  File "/home/purushottamdev/directory_env/f/lib/python3.8/site-packages/sh.py", line 2662, in background_thread
    handle_exit_code(exit_code)
  File "/home/purushottamdev/directory_env/f/lib/python3.8/site-packages/sh.py", line 2349, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/home/purushottamdev/directory_env/f/lib/python3.8/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_1:

  RAN: /home/purushottamdev/directory_env/f/ff/.buildozer/android/platform/build-arm64-v8a/dists/gnetwork/gradlew assembleDebug

  STDOUT:

> Configure project :
WARNING: The option setting 'android.bundle.enableUncompressedNativeLibs=false' is experimental and unsupported.
The current default is 'true'.


> Task :processDebugManifest
/home/purushottamdev/directory_env/f/ff/.buildozer/android/platform/build-arm64-v8a/dists/gnetwork/src/main/AndroidManifest.xml:35:5-81 Warning:
        Element uses-permission#android.permission.WRITE_EXTERNAL_STORAGE at AndroidManifest.xml:35:5-81 duplicated with element declared at AndroidManifest.xml:28:5-81
aapt2 W 01-08 15:01:08 27176 27176 LoadedArsc.cpp:657] Unknown chunk type '200'.


> Task :compileDebugJavaWithJavac FAILED
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:5: error: cannot find symbol
import com.google.android.gms;
                         ^
  symbol:   class gms
  location: package com.google.android
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:14: error: cannot find symbol
    LocationRequest locationRequest = LocationRequest.create();
                                                     ^
  symbol:   method create()
  location: class LocationRequest
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:15: error: cannot find symbol
    locationRequest.setInterval(10000);
                   ^
  symbol:   method setInterval(int)
  location: variable locationRequest of type LocationRequest
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:16: error: cannot find symbol
    locationRequest.setFastestInterval(5000);
                   ^
  symbol:   method setFastestInterval(int)
  location: variable locationRequest of type LocationRequest
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:17: error: cannot find symbol
    locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
                                               ^
  symbol:   variable PRIORITY_HIGH_ACCURACY
  location: class LocationRequest
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:19: error: package LocationSettingsRequest does not exist
    LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
                           ^
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:19: error: package LocationSettingsRequest does not exist
    LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()
                                                                         ^
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:22: error: package LocationSettingsRequest does not exist
    LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();
                           ^
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:22: error: package LocationSettingsRequest does not exist
    LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();
                                                                         ^
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:23: error: cannot find symbol
    SettingsClient client = LocationServices.getSettingsClient(pyActivity);
    ^
  symbol:   class SettingsClient
  location: class Contact
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:23: error: cannot find symbol
    SettingsClient client = LocationServices.getSettingsClient(pyActivity);
                            ^
  symbol:   variable LocationServices
  location: class Contact
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:24: error: cannot find symbol
    Task<LocationSettingsResponse> task = client.checkLocationSettings(builder.build());
    ^
  symbol:   class Task
  location: class Contact
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:24: error: cannot find symbol
    Task<LocationSettingsResponse> task = client.checkLocationSettings(builder.build());
         ^
  symbol:   class LocationSettingsResponse
  location: class Contact
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:26: error: cannot find symbol
    task.addOnSuccessListener( pyActivity , new OnSuccessListener<LocationSettingsResponse>() {
                                                ^
  symbol:   class OnSuccessListener
  location: class Contact
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:26: error: cannot find symbol
    task.addOnSuccessListener( pyActivity , new OnSuccessListener<LocationSettingsResponse>() {
                                                                  ^
  symbol:   class LocationSettingsResponse
  location: class Contact
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:29: error: cannot find symbol
    public void onSuccess(LocationSettingsResponse locationSettingsResponse) {
                          ^
  symbol: class LocationSettingsResponse
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:28: error: method does not override or implement a method from a supertype
    @Override
    ^
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:35: error: cannot find symbol
    task.addOnFailureListener( pyActivity , new OnFailureListener() {
                                                ^
  symbol:   class OnFailureListener
  location: class Contact
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:38: error: cannot find symbol
    public void onFailure(@NonNull Exception e) {
                           ^
  symbol: class NonNull
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:37: error: method does not override or implement a method from a supertype
    @Override
    ^
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:39: error: cannot find symbol
        if (e instanceof ResolvableApiException) {
                         ^
  symbol: class ResolvableApiException
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:45: error: cannot find symbol
                ResolvableApiException resolvable = (ResolvableApiException) e;
                ^
  symbol: class ResolvableApiException
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:45: error: cannot find symbol
                ResolvableApiException resolvable = (ResolvableApiException) e;
                                                     ^
  symbol: class ResolvableApiException
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:46: error: cannot find symbol
                resolvable.startResolutionForResult( pyActivity  ,  REQUEST_CHECK_SETTINGS);
                                                                    ^
  symbol: variable REQUEST_CHECK_SETTINGS
/home/purushottamdev/directory_env/f/ff/libs/Contact.java:47: error: package IntentSender does not exist
            } catch (IntentSender.SendIntentException sendEx) {
                                 ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
25 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':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 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 13s
18 actionable tasks: 18 executed


  STDERR:

[INFO]:    STDOUT (last 20 lines of 162):
    * What went wrong:    
Execution failed for task ':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 7.0.    
Use '--warning-mode all' to show the individual deprecation warnings.    
See https://docs.gradle.org/6.9.1/userguide/command_line_interface.html#sec:command_line_warnings    
   
BUILD FAILED in 13s    
18 actionable tasks: 18 executed    

[INFO]:    STDERR:

[INFO]:    ENV:
export LESSOPEN='| /usr/bin/lesspipe %s'
export LANGUAGE='en_IN:en'
export USER='purushottamdev'
export SSH_AGENT_PID='1908'
export XDG_SESSION_TYPE='x11'
export SHLVL='1'
export HOME='/home/purushottamdev'
export OLDPWD='/home/purushottamdev/directory_env/f/ff/libs'
export DESKTOP_SESSION='ubuntu'
export GNOME_SHELL_SESSION_MODE='ubuntu'
export GTK_MODULES='gail:atk-bridge'
export PS1='(f) \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
export MANAGERPID='1736'
export ANDROIDMINAPI='26'
export DBUS_STARTER_BUS_TYPE='session'
export DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/1001/bus,guid=755b1c31e73be2732aeef18d63ba4fb4'
export COLORTERM='truecolor'
export MANDATORY_PATH='/usr/share/gconf/ubuntu.mandatory.path'
export IM_CONFIG_PHASE='1'
export LOGNAME='purushottamdev'
export JOURNAL_STREAM='8:47189'
export _='/home/purushottamdev/directory_env/f/bin/buildozer'
export ANDROIDAPI='33'
export XDG_SESSION_CLASS='user'
export DEFAULTS_PATH='/usr/share/gconf/ubuntu.default.path'
export USERNAME='purushottamdev'
export TERM='xterm-256color'
export GNOME_DESKTOP_SESSION_ID='this-is-deprecated'
export ANDROIDNDK='/home/purushottamdev/.buildozer/android/platform/android-ndk-r19c'
export WINDOWPATH='2'
export PATH='/home/purushottamdev/.buildozer/android/platform/android-ndk-r19c/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86/bin/:/home/purushottamdev/.buildozer/android/platform/android-ndk-r19c/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/:/home/purushottamdev/.buildozer/android/platform/android-ndk-r19c:/home/purushottamdev/.buildozer/android/platform/android-sdk/tools:/home/purushottamdev/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/purushottamdev/directory_env/f/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/purushottamdev/.local/bin/'
export SESSION_MANAGER='local/purushottam2-HP-Laptop-15-bs1xx:@/tmp/.ICE-unix/1979,unix/purushottam2-HP-Laptop-15-bs1xx:/tmp/.ICE-unix/1979'
export INVOCATION_ID='d87e819cbeb34ab1a41727f95d6ca889'
export XDG_MENU_PREFIX='gnome-'
export GNOME_TERMINAL_SCREEN='/org/gnome/Terminal/screen/c3d28ee4_c2fd_4d2c_8b43_35cc2d7b17b3'
export XDG_RUNTIME_DIR='/run/user/1001'
export DISPLAY=':1'
export LANG='en_IN'
export XDG_CURRENT_DESKTOP='ubuntu:GNOME'
export ANDROIDSDK='/home/purushottamdev/.buildozer/android/platform/android-sdk'
export XMODIFIERS='@im=ibus'
export XDG_SESSION_DESKTOP='ubuntu'
export XAUTHORITY='/run/user/1001/gdm/Xauthority'
export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'
export GNOME_TERMINAL_SERVICE=':1.136'
export SSH_AUTH_SOCK='/run/user/1001/keyring/ssh'
export SHELL='/bin/bash'
export QT_ACCESSIBILITY='1'
export GDMSESSION='ubuntu'
export PACKAGES_PATH='/home/purushottamdev/.buildozer/android/packages'
export LESSCLOSE='/usr/bin/lesspipe %s %s'
export GPG_AGENT_INFO='/run/user/1001/gnupg/S.gpg-agent:0:1'
export VIRTUAL_ENV='/home/purushottamdev/directory_env/f'
export QT_IM_MODULE='ibus'
export PWD='/home/purushottamdev/python-for-android'
export XDG_CONFIG_DIRS='/etc/xdg/xdg-ubuntu:/etc/xdg'
export DBUS_STARTER_ADDRESS='unix:path=/run/user/1001/bus,guid=755b1c31e73be2732aeef18d63ba4fb4'
export XDG_DATA_DIRS='/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop'
export VTE_VERSION='6003'
export ANDROID_NDK_HOME='/home/purushottamdev/.buildozer/android/platform/android-ndk-r19c'
export ANDROID_HOME='/home/purushottamdev/.buildozer/android/platform/android-sdk'

[INFO]:    COMMAND:
cd /home/purushottamdev/directory_env/f/ff/.buildozer/android/platform/build-arm64-v8a/dists/gnetwork && /home/purushottamdev/directory_env/f/ff/.buildozer/android/platform/build-arm64-v8a/dists/gnetwork/gradlew assembleDebug

[WARNING]: ERROR: /home/purushottamdev/directory_env/f/ff/.buildozer/android/platform/build-arm64-v8a/dists/gnetwork/gradlew failed!
WARNING: Received a --sdk argument, but this argument is deprecated and does nothing.
No setup.py/pyproject.toml used, copying full private data into .apk.
Applying Java source code patches...
Applying patch: src/patches/SDLActivity.java.patch
# Command failed: /home/purushottamdev/directory_env/f/bin/python3 -m pythonforandroid.toolchain apk --bootstrap sdl2 --dist_name gnetwork --name GNetwork --version 0.1 --package com.adyatanadravyani.gnetwork --minsdk 26 --ndk-api 26 --private /home/purushottamdev/directory_env/f/ff/.buildozer/android/app --permission INTERNET --permission WRITE_EXTERNAL_STORAGE --permission READ_EXTERNAL_STORAGE --permission ACCESS_NETWORK_STATE --permission ACCESS_COARSE_LOCATION --permission ACCESS_FINE_LOCATION --permission CAMERA --permission RECORD_AUDIO --android-entrypoint org.kivy.android.PythonActivity --android-apptheme @android:style/Theme.NoTitleBar --add-compile-option "sourceCompatibility = 1.8" --add-compile-option "targetCompatibility = 1.8" --presplash-lottie /home/purushottamdev/directory_env/f/ff/p.json --icon /home/purushottamdev/directory_env/f/ff/p.png --orientation portrait --window --enable-androidx --service PythonNotificationHandler:python_notification_handler.py --copy-libs --add-source /home/purushottamdev/directory_env/f/ff/libs --depend com.google.firebase:firebase-messaging --depend com.google.firebase:firebase-analytics --depend com.google.code.gson:gson:2.10 --arch arm64-v8a --color=always --storage-dir="/home/purushottamdev/directory_env/f/ff/.buildozer/android/platform/build-arm64-v8a" --ndk-api=26 --ignore-setup-py --debug
# ENVIRONMENT:
#     SHELL = '/bin/bash'
#     SESSION_MANAGER = 'local/purushottam2-HP-Laptop-15-bs1xx:@/tmp/.ICE-unix/1979,unix/purushottam2-HP-Laptop-15-bs1xx:/tmp/.ICE-unix/1979'
#     QT_ACCESSIBILITY = '1'
#     COLORTERM = 'truecolor'
#     XDG_CONFIG_DIRS = '/etc/xdg/xdg-ubuntu:/etc/xdg'
#     XDG_MENU_PREFIX = 'gnome-'
#     GNOME_DESKTOP_SESSION_ID = 'this-is-deprecated'
#     LANGUAGE = 'en_IN:en'
#     MANDATORY_PATH = '/usr/share/gconf/ubuntu.mandatory.path'
#     GNOME_SHELL_SESSION_MODE = 'ubuntu'
#     SSH_AUTH_SOCK = '/run/user/1001/keyring/ssh'
#     XMODIFIERS = '@im=ibus'
#     DESKTOP_SESSION = 'ubuntu'
#     SSH_AGENT_PID = '1908'
#     GTK_MODULES = 'gail:atk-bridge'
#     DBUS_STARTER_BUS_TYPE = 'session'
#     PWD = '/home/purushottamdev/directory_env/f/ff'
#     XDG_SESSION_DESKTOP = 'ubuntu'
#     LOGNAME = 'purushottamdev'
#     XDG_SESSION_TYPE = 'x11'
#     GPG_AGENT_INFO = '/run/user/1001/gnupg/S.gpg-agent:0:1'
#     XAUTHORITY = '/run/user/1001/gdm/Xauthority'
#     WINDOWPATH = '2'
#     HOME = '/home/purushottamdev'
#     USERNAME = 'purushottamdev'
#     IM_CONFIG_PHASE = '1'
#     LANG = 'en_IN'
#     LS_COLORS = 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'
#     XDG_CURRENT_DESKTOP = 'ubuntu:GNOME'
#     VIRTUAL_ENV = '/home/purushottamdev/directory_env/f'
#     VTE_VERSION = '6003'
#     GNOME_TERMINAL_SCREEN = '/org/gnome/Terminal/screen/c3d28ee4_c2fd_4d2c_8b43_35cc2d7b17b3'
#     INVOCATION_ID = 'd87e819cbeb34ab1a41727f95d6ca889'
#     MANAGERPID = '1736'
#     LESSCLOSE = '/usr/bin/lesspipe %s %s'
#     XDG_SESSION_CLASS = 'user'
#     TERM = 'xterm-256color'
#     DEFAULTS_PATH = '/usr/share/gconf/ubuntu.default.path'
#     LESSOPEN = '| /usr/bin/lesspipe %s'
#     USER = 'purushottamdev'
#     GNOME_TERMINAL_SERVICE = ':1.136'
#     DISPLAY = ':1'
#     SHLVL = '1'
#     QT_IM_MODULE = 'ibus'
#     DBUS_STARTER_ADDRESS = 'unix:path=/run/user/1001/bus,guid=755b1c31e73be2732aeef18d63ba4fb4'
#     XDG_RUNTIME_DIR = '/run/user/1001'
#     PS1 = ('(f) \\[\\e]0;\\u@\\h: '
 '\\w\\a\\]${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ')
#     JOURNAL_STREAM = '8:47189'
#     XDG_DATA_DIRS = '/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop'
#     PATH = '/home/purushottamdev/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/purushottamdev/directory_env/f/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/purushottamdev/.local/bin/'
#     GDMSESSION = 'ubuntu'
#     DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/1001/bus,guid=755b1c31e73be2732aeef18d63ba4fb4'
#     _ = '/home/purushottamdev/directory_env/f/bin/buildozer'
#     OLDPWD = '/home/purushottamdev/directory_env/f/ff/libs'
#     PACKAGES_PATH = '/home/purushottamdev/.buildozer/android/packages'
#     ANDROIDSDK = '/home/purushottamdev/.buildozer/android/platform/android-sdk'
#     ANDROIDNDK = '/home/purushottamdev/.buildozer/android/platform/android-ndk-r19c'
#     ANDROIDAPI = '33'
#     ANDROIDMINAPI = '26'
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
(f) purushottamdev@purushottam2-HP-Laptop-15-bs1xx:~/directory_env/f/ff$


Robert

unread,
Jan 8, 2023, 12:25:51 PM1/8/23
to Kivy users support
I don't know anything about these Java packages, and have not tried to do what you want to do.
And I don't have the spare resources to develop or debug it.  I can't help you.

That said, a couple of Google searches show that the Android docs perhaps help understand the first two issues.

The first issue:
https://developers.google.com/android/reference/packages
It doesn't look like there is a com.google.android.gms  package.
Perhaps one of the sub packages should be added with gradle_dependencies?

The second issue:
It is depreciated, the link tells you what to do instead.

Java programming advice is not part of my skill set.
Reply all
Reply to author
Forward
0 new messages