androidx

What is Jetifier?

我是研究僧i 提交于 2019-12-17 02:29:34
问题 What is Jetifier? For example, to create a new project using the androidx-packaged dependencies, this new project needs to add the following line to the gradle.properties file: android.enableJetifier=true So what does it mean - "enable jetifier"? 回答1: This year's Google I/O (18), Google has announced Jetpack which is set/collection of libraries to make developer's life easier. Jetpack includes previously introduced Android architecture components (ViewModel, Room, Paging, LiveData etc.) as

Can't depend on Firebase ML Kit

别来无恙 提交于 2019-12-13 20:09:35
问题 I'm trying to add firebase's ML Kit as a dependency in my android application: dependencies { implementation("com.microblink:blinkinput:${rootProject.ext.blinkInputVersion}@aar") { transitive = true } implementation 'com.google.firebase:firebase-analytics:17.2.1' implementation 'com.google.android.gms:play-services-ads:18.3.0' implementation 'com.google.android:flexbox:1.1.0' implementation 'com.android.billingclient:billing:2.0.3' implementation "com.heapanalytics.android:heap-android-client

Android Work Manager: “Could not instantiate Worker”

风格不统一 提交于 2019-12-13 12:25:58
问题 I've followed the Android Developer's tutorial on using the Worker Manager structure to run my code in background but anytime I try to enqueue my worker it doesn't run and I get the following error: 2018-10-04 22:25:47.004 28669-28885/app.package.com.debug E/DefaultWorkerFactory: Could not instantiate app.package.com.MyWorker java.lang.NoSuchMethodException: <init> [] at java.lang.Class.getConstructor0(Class.java:2320) at java.lang.Class.getDeclaredConstructor(Class.java:2166) at androidx

Migrating to AndroidX - android.support.FILE_PROVIDER_PATHS location

谁都会走 提交于 2019-12-13 11:54:00
问题 I am in the middle of migrating a project to AndroidX and I am blocked with an issue. <provider android:name="androidx.core.content.FileProvider" <--- Changed to X lib android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true"> <meta-data android:name="android.support.FILE_PROVIDER_PATHS" <---- ISSUE android:resource="@xml/file_paths" /> </provider> I searched all the Internet and couldn't find a solution for this: what should I add instead

Alpha-08: Apps may not schedule more than 100 distinct jobs

旧城冷巷雨未停 提交于 2019-12-13 05:49:40
问题 I've looked around and the consensus is it's fixed on Alpha-07, but I'm seeing it in 08 on a 7.0 AND 8.0 device. I have network constraints so there is a possibility that given a long period of no network I could schedule more than 100 work items. I'm a little confused about how batching plays into this. Are we saying WorkManager can only schedule 100 items before it crashes or is there still a batching bug? Thanks Code that adds to WM: Constraints constraints = new Constraints.Builder()

AndroidX Work Library is canceling operations, seemingly without reason

旧城冷巷雨未停 提交于 2019-12-13 03:47:52
问题 I am working with the AndroidX Work Dependency to try and run some background service operations. I am currently running the most recent stable version, 2.2.0 as of posting this question. The actual operation I am running in the background is a fairly heavy-CPU operation as it is using some compression code in one of my libraries (here) and can take anywhere from 3-30 minutes depending on the size and length of the video in question. Here is the code I have that builds and runs the work

Can't run the app after migration to androidX: android.view.InflateException

◇◆丶佛笑我妖孽 提交于 2019-12-13 03:46:29
问题 It took a lot of effort to migrate to androidX, but after all that I am still unable to resolve one issue. When I try to run my app I get this error: java.lang.RuntimeException: Unable to start activity ComponentInfo{studio.dookola.zgkim/studio.dookola.zgkim.MainActivity}: android.view.InflateException: Binary XML file line #12: Binary XML file line #2: Error inflating class android.support.design.widget.CoordinatorLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java

AndroidX. Could not determine artifacts for androidx.multidex:multidex:2.0.0

吃可爱长大的小学妹 提交于 2019-12-13 03:43:37
问题 I try to migrate a project to AndroidX. After 3 minutes of migrating it finished with error: Gradle import errorsC:\Users\user\AndroidStudioProjects\project\app\build.gradle project ':app': Unable to build Kotlin project configuration Details: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':app:implementationDependenciesMetadata'.Caused by: org.gradle.internal.resolve.ArtifactResolveException: Could not determine artifacts for androidx.room

Why are there 2 different ComponentActivity classes?

耗尽温柔 提交于 2019-12-13 00:29:06
问题 I'm trying to handle back button presses in my fragments by registering an OnBackPressedCallback via addOnBackPressedCallback to receive onBackPressed() callbacks without needing to override the method in your activity (described Nov 5, 2018 release notes for androidx.activity) If you look at the AppCompatActivity Docs, it claims AppCompatActivity extends from androidx.activity.ComponentActivity . The problem I'm running into is, in my codebase, AppCompatActivity extends from androidx.core

Scroll behaviour of AndroidX RecyclerView view with NestedScrollView

为君一笑 提交于 2019-12-12 18:22:29
问题 I'm migrating my application from appcompat to AndroidX. Everything works except that I am not able to set one scroll for both androidx.core.widget.NestedScrollView and androidx.recyclerview.widget.RecyclerView . I have tried adding setHasFixedSize(true) setNestedScrollingEnabled(false) but it's not working. My XML now looks this way: <?xml version="1.0" encoding="utf-8"?> <androidx.core.widget.NestedScrollView android:clipToPadding="false" android:id="@+id/scroll" android:layout_height="wrap