Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform Android support for AndroidX #688

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@
<js-module src="www/CameraPopoverHandle.js" name="CameraPopoverHandle">
<clobbers target="CameraPopoverHandle" />
</js-module>

<preference name="ANDROID_SUPPORT_V4_VERSION" default="27.+"/>
<framework src="com.android.support:support-v4:$ANDROID_SUPPORT_V4_VERSION"/>
<preference name="AndroidXEnabled" value="true" />
Copy link
Member

@NiklasMerz NiklasMerz Jul 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As cordova-android 10 now comes with AndroidX by default those changes aren't really needed. I even got an error while building with the nightly version of cordova-android.

Failed to install 'cordova-plugin-camera': Error: Variable(s) missing: ANDROIDXENABLED
    at Object.mergeVariables (/Users/niklasmerz/.nvm/versions/node/v12.14.1/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/variable-merge.js:58:15)
    at /Users/niklasmerz/.nvm/versions/node/v12.14.1/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:302:44
    at processTicksAndRejections (internal/process/task_queues.js:94:5)

<preference name="ANDROID_SUPPORT_V4_VERSION" default="1.+"/>
<framework src="androidx.legacy:legacy-support-v4:$ANDROID_SUPPORT_V4_VERSION"/>
<!--<framework src="androidx.legacy:legacy-support-v4:1.+" />-->

</platform>

Expand Down
2 changes: 1 addition & 1 deletion src/android/CameraLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Licensed to the Apache Software Foundation (ASF) under one
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.support.v4.content.FileProvider;
import androidx.core.content.FileProvider;
import android.util.Base64;

import org.apache.cordova.BuildHelper;
Expand Down
2 changes: 1 addition & 1 deletion src/android/FileProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Licensed to the Apache Software Foundation (ASF) under one
*/
package org.apache.cordova.camera;

public class FileProvider extends android.support.v4.content.FileProvider {}
public class FileProvider extends androidx.core.content.FileProvider {}