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

Android build issue (androidx.core.v4.content does not exist) #14

Open
cemeai opened this issue Jun 1, 2020 · 6 comments
Open

Android build issue (androidx.core.v4.content does not exist) #14

cemeai opened this issue Jun 1, 2020 · 6 comments

Comments

@cemeai
Copy link

cemeai commented Jun 1, 2020

When I try compiling for android getting an error for a library does not exists. Could it be a version error? maybe something i need to make sure i have enabled? I honestly not sure if you need more infotmation to know what is going on so let me know

Here is the error i get

./gradlew build

Configure project :
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

Task :compileDebugJavaWithJavac FAILED
/Users/cesar.amaro/Documents/godot-3.1/modules/share/android/GodotShare.java:9: error: package androidx.core.v4.content does not exist
import androidx.core.v4.content.FileProvider;
^
/Users/cesar.amaro/Documents/godot-3.1/modules/share/android/GodotShare.java:52: error: cannot find symbol
uri = FileProvider.getUriForFile(activity, activity.getPackageName(), f);
^
symbol: variable FileProvider
location: class GodotShare
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s

@Shin-NiL
Copy link
Owner

Shin-NiL commented Jun 2, 2020

Did you do this (from readme file)?

open (Project)/android/build/gradle.properties file and add the following line

android.useAndroidX=true
android.enableJetifier=true

@cemeai
Copy link
Author

cemeai commented Jun 2, 2020

I missed that but then did and got a different error

Task :compileDebugJavaWithJavac FAILED
/Users/cesar.amaro/Documents/godot-3.1/platform/android/java/src/org/godotengine/godot/Godot.java:65: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;

so first it was androidx and now android.support

maybe i need to enable something else?

@Shin-NiL
Copy link
Owner

Shin-NiL commented Jun 2, 2020

What Godot version are you compiling?

@cemeai
Copy link
Author

cemeai commented Jun 3, 2020

3.1

@Shin-NiL
Copy link
Owner

Shin-NiL commented Jun 4, 2020

I don't use this module anymore, I've migrate to the plugin system in 3.2. I can't say if 3.1 is compatible with Android X.
One thing you can try is to use a version of this module before the Android X support was added. You can checkout this commit 266e070

@cemeai
Copy link
Author

cemeai commented Jun 5, 2020

thx ill try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants