我在Android 8.0 Oreo java.lang.IllegalStateException中从联系簿中检索联系人时遇到问题:只有全屏不透明活动可以请求方向
我试图通过电话联系簿获取我的活动中的联系人,它对Lollipop,Marshmallow,Nougat等非常有用,但它会给我这样的奥利奥错误,请帮助我.我的代码如下.
演示代码: -
private void loadContacts() {
contactAsync = new ContactLoaderAsync();
contactAsync.execute();
}
private class ContactLoaderAsync extends AsyncTask<Void, Void, Void> {
private Cursor numCursor;
@Override
protected void onPreExecute() {
super.onPreExecute();
Uri numContacts = ContactsContract.CommonDataKinds.Phone.CONTENT_URI;
String[] numProjection = new String[]{ContactsContract.CommonDataKinds.Phone.CONTACT_ID, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone.TYPE};
if (android.os.Build.VERSION.SDK_INT < 11) {
numCursor = InviteByContactActivity.this.managedQuery(numContacts, numProjection, null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " COLLATE NOCASE ASC");
} else {
CursorLoader cursorLoader = new CursorLoader(InviteByContactActivity.this, numContacts, numProjection, null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME + " COLLATE NOCASE …Run Code Online (Sandbox Code Playgroud) 我在我的一个应用程序中实现了谷歌地图,当我选择任何位置而不是伦敦时,一切都工作正常,但当我试图选择伦敦的任何位置并试图放大和缩小比应用程序将崩溃.
请帮我.我只是想用谷歌地图做这件事,我不想使用任何第三方地图.
DisplayMetrics displayMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels;
int width = displayMetrics.widthPixels;
LatLngBounds bounds = new LatLngBounds(new LatLng(lat, lng), new LatLng(lat, lng));
googleMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, width, height, 20));
Run Code Online (Sandbox Code Playgroud)
Logcat:
07-02 05:20:35.409 32739-665/com.example E/AndroidRuntime:FATAL EXCEPTION:GLThread 19450进程:com.example,PID:32739 java.lang.StackOverflowError:com.google.maps.api上的堆栈大小1037KB .android.lib6.common.i.(:com.google.android.gms.dynamite_dynamitemodulesb @ 12685025 @ 12.6.85(040408-197041431):9)
生成签名的apk时我收到此错误.即使我尝试了很多解决方案,但没有人适合我.
请帮我:
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/design/widget/CoordinatorLayout$1.class
Run Code Online (Sandbox Code Playgroud)
我的gradle文件代码是
Build.gradle在这里请告诉我生成签名apk的错误是什么: -
apply plugin: 'com.android.application'
repositories {
maven { url 'https://maven.google.com' }
}
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id: "MyKey", onesignal_google_project_number: "REMOTE"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
implementation …Run Code Online (Sandbox Code Playgroud) 我得到的FASTLANE的误差为全面建设签署的apk作为assembleRelease APK,我想部署在Play商店中的更新,但是当我在当时的射击命令FASTLANE我得到了错误的increment_version_code。
Shubhams-MacBook-Air:ProjectPath shubhamsejpal$ fastlane beta
[?]
[23:33:51]: fastlane detected a Gemfile in the current directory
[23:33:51]: however it seems like you don't use `bundle exec`
[23:33:51]: to launch fastlane faster, please use
[23:33:51]:
[23:33:51]: $ bundle exec fastlane beta
[23:33:51]:
[23:33:51]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
[23:33:51]: WARNING: fastlane requires your locale to be set to UTF-8. To learn more go to https://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables
[23:33:52]: ----------------------------------------
[23:33:52]: --- Step: Verifying fastlane version ---
[23:33:52]: ---------------------------------------- …Run Code Online (Sandbox Code Playgroud) android android-studio fastlane fastlane-deliver fastlane-match