E/libprocessgroup: set_timerslack_ns write failed: Operation not permitted?

31,762

Solution 1

The Solution was found.

When i try to initialize Places, i used my API_KEY that i stored in the res/values/Strings. All i did was put the actually api key in the code.

From

Places.initialize(getApplicationContext(),"@string/API_KEY");

To

Places.initialize(getApplicationContext(),YOUR API KEY);

Solution 2

This happened to me as well! I found out that it was because my API was not enabled (Places on Google). It works with the following as well then! :)

Places.initialize(getApplicationContext(),"@string/API_KEY");
Share:
31,762

Related videos on Youtube

Xin Nian
Author by

Xin Nian

Updated on July 09, 2022

Comments

  • Xin Nian
    Xin Nian almost 2 years

    I am facing this issue in my Logcat while I run my android app. Does anyone know about this issue and how to fix it?

    The app dones't crash, but when every i try to type something in Google map's autocomplete search bar it closes that activity. and goes back to the pervious one,which display the current location on a google map.

    <uses-library android:name="org.apache.http.legacy" android:required="false"/>
    

    This doesnt't work and this issues actually has already been fixed by google.

    android

        android {
        compileSdkVersion 29
        buildToolsVersion "29.0.3"
    
        defaultConfig {
            applicationId "com.example.project_seraphim_disease_tracker"
            minSdkVersion 29
            targetSdkVersion 29
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            }
        }
    
    }
    

    dependencies

    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'androidx.appcompat:appcompat:1.1.0'
        implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
        implementation 'androidx.navigation:navigation-fragment:2.2.2'
        implementation 'androidx.navigation:navigation-ui:2.2.2'
        implementation 'androidx.legacy:legacy-support-v4:1.0.0'
        implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'androidx.test.ext:junit:1.1.1'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
        //new implementation
        implementation 'com.google.android.material:material:1.0.0'
        implementation 'com.squareup.okhttp3:okhttp:4.1.0'
        implementation 'com.google.android.gms:play-services-maps:17.0.0'
        implementation 'com.google.android.gms:play-services-location:17.0.0'
        implementation 'com.google.android.libraries.places:places:2.2.0'
    }
    
        //google map required variables
        private static final String TAG = "MapActivity";
        private static final String FINE_LOCATION = Manifest.permission.ACCESS_FINE_LOCATION;
        private static final String COURSE_LOCATION = Manifest.permission.ACCESS_COARSE_LOCATION;
        private static final float ZOOMING_DEFAULT = 18.0f;
        private static final int LOCATION_PERMISSION_REQUEST_CODE = 9999;
        private SupportMapFragment MysupportMapFragment;
        private FusedLocationProviderClient MyfusedLocationProviderClient;
        private GoogleMap MyMap;
        private static final int AUTOCOMPLETE_REQUEST_CODE = 200;
        //local variables
        private Boolean  MyLocationPermissionsGranted = false;
        private Location Mylocation;
        private LatLng MylatLng;
        private LatLng SearchedLocationlatLng;
        private List<Place.Field> fieldList;
        private String Searchedlocation = "";
        private Place AutocompletedPlaces;
        //widgets
        private EditText editTextsearchlocation;
    

    This is the Edit Text Button

    editTextsearchlocation = findViewById(R.id.edittext_SearchBar);
    editTextsearchlocation.setFocusable(false);
    editTextsearchlocation.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Log.d(TAG, "onClick: initialize place field list");
                    fieldList = Arrays.asList(Place.Field.ADDRESS,Place.Field.LAT_LNG,Place.Field.NAME);
                    Log.d(TAG, "onClick: initialize place autoComplete");
                    Intent searchPlaceIntent = new Autocomplete.IntentBuilder(
                            AutocompleteActivityMode.OVERLAY, fieldList).build(Map.this);
                    startActivityForResult(searchPlaceIntent,100);
                }
            });
    

    This is the onActivityResult

        @Override
            protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
            super.onActivityResult(requestCode, resultCode, data);
            Log.d(TAG, "onActivityResult: currently at onActivityResult");
            if (requestCode == AUTOCOMPLETE_REQUEST_CODE) {
                Log.d(TAG, "onActivityResult: Correct Request Code");
                if (resultCode == AutocompleteActivity.RESULT_OK) {
                    Log.d(TAG, "onActivityResult: successfully Obtaining Places");
                    AutocompletedPlaces = Autocomplete.getPlaceFromIntent(data);
                    Log.i(TAG, "Place: "
                            + AutocompletedPlaces.getName() + ", "
                            + AutocompletedPlaces.getId());
                    SearchedLocationlatLng = AutocompletedPlaces.getLatLng();
                    Searchedlocation = AutocompletedPlaces.getAddress();
                    editTextsearchlocation.setText(Searchedlocation);
                } else if (resultCode == AutocompleteActivity.RESULT_ERROR) {
                    Log.d(TAG, "onActivityResult: Failed To Obtaining Places");
                    Status status = Autocomplete.getStatusFromIntent(data);
                    Log.i(TAG, status.getStatusMessage());
                } else if (resultCode == RESULT_CANCELED) {
                    // The user canceled the operation.
                } else if (resultCode == RESULT_FIRST_USER){
    
                }
    
            }
        }
    

    i can see this in the log

    "onActivityResult: currently at onActivityResult"
    

    and right after this line in the log is

    E/libprocessgroup: set_timerslack_ns write failed: Operation not permitted