[JAVA] [Android] Solution when the camera cannot be started on Android 9

Summary of 3 lines

  1. Added camera startup process to Fragment
  2. 「Didn't find class "android.support.v4.app.CoreComponentFactory"」
    I got the error
  3. Resolved the conflict between androidX and android.support.compat library

[Reference site 1: android.support.v4.app.CoreComponentFactory error](https://stackoverflow.max-everyday.com/2019/05/android-didnt-find-class-android-support-v4-app- corecomponentfactory /) Reference site 2: tools: replace = "android: appComponentFactory"

Solution

① Describe the following in gradle.properties.

android.useAndroidX=true
android.enableJetifier=true

(2) Open a file that inherits AppCompatActivity, such as MainActivity, and open it. Import the following.

import androidx.appcompat.app.AppCompatActivity

Recommended Posts

[Android] Solution when the camera cannot be started on Android 9
What to do when CentOS cannot be started with VirtualBox on Catalina
[Solution] Java cannot be installed on Windows 10 + ATOK 2017
Note when pip install mysqlclient cannot be installed on Mac
The org.junit.jupiter.api package cannot be found.
[Android] Get the date on Monday
"ClassNotFoundException" is displayed when tomcat is started in eclipse and cannot be started
When the certificate cannot be obtained by https-portal production (Response Code: 403)
Measures when model cannot be created
Java cannot be installed on Ubuntu 13.04
Android Studio JRE cannot be changed
[Ruby On Rails] In the create action and destroy action, emergency measures when redirect_to action:: show cannot be (cannot be used)
Pg_resetwal can be used to start the PostgreSQL Docker container when WAL is broken and cannot be started.
A memorandum when IME cannot be turned on with VS Code (Ubuntu 20.04)
How to solve the problem that notification cannot be requested on iOS14
[Xcode] Build succeeds, but the problem cannot be installed on the actual machine
767 JSON :: ParserError occurs and the problem that the local server cannot be started
Unexpected pitfalls when images cannot be displayed
Try using the service on Android Oreo
[Rails] Posts cannot be deleted when commented! ??
Rails server cannot be started in Cloud9
Check when the container cannot be accessed from Host in the Laravel on docker environment using VS Code's Remote container.
[Ubuntu] What to do when MongoDB cannot be started due to a SocketException error
ValidationMessages.properties should not be multiple on the classpath
RubyOnRails, Authentication plugin'caching_sha2_password' cannot be loaded error solution
[Android] Get the tapped position (coordinates) on the screen
[Android] List all setting items on the setting screen
When the Ruby on Rails terminal rolls back
[React.useRef] What to do when the latest state cannot be referenced in the event listener
[Ruby on Rails] How to stop when Rails server cannot be stopped by Ctrl + C