open_file
open_file copied to clipboard
android build error Could not get unknown property 'android' for project ':open_file' of type org.gradle.api.Project.
The plugin worked fine until today until, after update to 3.0.3 version i get this error
* What went wrong:
A problem occurred configuring project ':open_file'.
> Could not resolve all artifacts for configuration ':open_file:classpath'.
> Could not find builder-4.0.2.jar (com.android.tools.build:builder:4.0.2).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/4.0.2/builder-4.0.2.jar
> Could not find bundletool-0.13.2.jar (com.android.tools.build:bundletool:0.13.2).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.13.2/bundletool-0.13.2.jar
> Could not get unknown property 'android' for project ':open_file' of type org.gradle.api.Project.
now i get this error with any version of open file :| , and after delete open file in dependencies gradle build successfuly, i can download https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.13.2/bundletool-0.13.2.jar with chrome and my internet is not a problem and I even tested with several vpn,
[√] Flutter (Channel stable, 1.22.3, on Microsoft Windows [Version 10.0.19041.572], locale en-US)
• Flutter version 1.22.3 at C:\Src\flutter
• Framework revision 8874f21e79 (3 weeks ago), 2020-10-29 14:14:35 -0700
• Engine revision a1440ca392
• Dart version 2.10.3
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Android
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = C:\Android
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[!] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code (version 1.51.1)
• VS Code at C:\Users\Mrhaydari\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.16.0
[√] Connected device (1 available)
• sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
minSdkVersion 16
targetSdkVersion 29
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileProvider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths"
tools:replace="android:resource" />
</provider>
gradle cleancachebuild flutter pub repair flutter clean cache remove gradle update grade not working !
> Configure project :open_file
Evaluating project ':open_file' using build file 'C:\Src\flutter\.pub-cache\hosted\pub.dartlang.org\open_file-3.0.3\android\build.gradle'.
*********************************************************
WARNING: This version of flutter_webview_plugin will break your Android build if it or its dependencies aren't compatible with AndroidX.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
This warning prints for all Android build failures. The real root cause of the error may be unrelated.
*********************************************************
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':open_file'.
> Could not resolve all artifacts for configuration ':open_file:classpath'.
> Could not find builder-4.0.2.jar (com.android.tools.build:builder:4.0.2).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/4.0.2/builder-4.0.2.jar
> Could not find bundletool-0.13.2.jar (com.android.tools.build:bundletool:0.13.2).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.13.2/bundletool-0.13.2.jar
> Could not get unknown property 'android' for project ':open_file' of type org.gradle.api.Project
I have not received issues like this, and I have not reproduced the problem successfully. If you have used other plugins, please let me know, and I will try my best to reproduce the error and solve it
Can you please check and give me a update on this issue. FAILURE: Build failed with an exception.
- What went wrong: A problem occurred configuring project ':open_file'.
Could not resolve all artifacts for configuration ':open_file:classpath'. Could not resolve com.android.tools.build:gradle:4.0.2. Required by: project :open_file > Could not resolve com.android.tools.build:gradle:4.0.2. > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.2/gradle-4.0.2.pom'. > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.2/gradle-4.0.2.pom'. > dl.google.com Could not get unknown property 'android' for project ':open_file' of type org.gradle.api.Project.
-
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
BUILD FAILED in 1m 9s Exception: Gradle task assembleDebug failed with exit code 1
got this error The prefix "tools" for attribute "tools:replace" associated with an element type "provider" is not bound. and unable to build
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.example.myapp.fileProvider"
android:exported="false"
android:grantUriPermissions="true"
>
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths"
/>
</provider>
Using this instead fixes the error. Don't forget to replace applicationId. 😊