我正在制作一个在主页片段中包含 Google 地图的应用。当我尝试输入位置时它只是给我这个错误 E/libprocessgroup: set_timerslack_ns write failed: Operation not permitted
,我尝试了解决方案 Places.initialize(getApplicationContext(),YOUR API KEY);
但没有奏效,我尝试了 <uses-library android:name="org.apache.http.legacy" android:required="false"/>
但仍然没有任何反应,它没有不会崩溃或任何它只是关闭文本视图而我无能为力。我在地图上看到了位置,但无法输入位置以前往或标记。
依赖项
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta8'
implementation 'com.google.firebase:firebase-database:19.3.1'
implementation 'com.google.firebase:firebase-auth:19.3.2'
implementation 'com.google.firebase:firebase-storage:19.1.1'
implementation 'com.firebase:geofire-android:2.3.1'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-places:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.android.gms:play-services-auth:18.0.0'
implementation 'com.facebook.android:facebook-login:5.13.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.stripe:stripe-android:13.1.3'
implementation 'com.github.bumptech.glide:glide:4.10.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.akexorcist:googledirectionlibrary:1.1.1'
implementation 'com.onesignal:OneSignal:3.9.1'
implementation 'com.google.android.libraries.places:places:2.3.0'
implementation "com.github.addisonelliott:SegmentedButton:3.1.5"
implementation 'com.paypal.sdk:paypal-android-sdk:2.16.0'
implementation 'com.google.android.libraries.places:places:2.3.0'
implementation 'com.github.rtchagas:pingplacepicker:1.1.2'
implementation 'com.github.ybq:Android-SpinKit:1.4.0'
implementation 'androidx.multidex:multidex:2.0.1'
安卓
android {
compileSdkVersion 29
buildToolsVersion '29.0.3'
defaultConfig {
applicationId "com.example.*********"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "2.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
useLibrary 'org.apache.http.legacy'
manifestPlaceholders = [onesignal_app_id : '********-****-*****-****-**********',
onesignal_google_project_number: 'REMOTE']
}
buildTypes {
release {
multiDexKeepFile file('multidex-config.txt')
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility '1.8'
targetCompatibility '1.8'
}}
图片供参考。 Example of the error