A problem occurred evaluating project ':#mauron85_react-native-background-geolocation-common' - android

I try to clone my teammate project, i did yarn install and run android but when the process is done, i found an error said:
A problem occurred evaluating project ':#mauron85_react-native-background-geolocation-common'
Other explanation are:
Failed to apply plugin [id 'com.android.internal.library']
The option 'android.enableUnitTestBinaryResources' is deprecated.
The current default is 'false'.
It has been removed from the current version of the Android Gradle plugin.
The raw resource for unit test functionality is removed.
We still want to use this dependecy because it requires on our project, my React Native version is 0.61.5
is there any solution regarding this problem?

Add the following line in gradle.properties in android folder.
android.enableUnitTestBinaryResources=false

Related

I got errors when using(running) camera android block from android package in simulink:The option 'android.databinding.enableV2' is deprecated

I always get following errors while using camera in simulink model:
Execution failed for task ':libraries:opencv:compileDebugAidl'.
and
A problem occurred evaluating root project 'camera'.
Failed to apply plugin [id 'com.android.internal.application']
The option 'android.databinding.enableV2' is deprecated.
The current default is 'true'.
It has been removed from the current version of the Android Gradle plugin.
Databinding v1 is removed.
Please help me if you've faced this issue.
I installed Android Studio JDK, SDK and gradle and added to androidhwsetup in matlab; but camera block faced this issue.

Flutter Android build not generating in Mac

In Mac, I've setup Flutter in Android studio. When I'm running project it gives me error
* What went wrong:
Execution failed for task ':location:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
I'm using all latest versions of Flutter, Kotlin, Gradle etc.
You need to equalize kotlin version in first row which is ext.kotlin_version = '1.6.10' to according to classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" of underlined $kotlin_version
After this, the problem will solve...
Actually I found a solution for my problem. There are 2 dependency defined in .yaml file 1. geo_location and 2. location.
After removing the location dependency from .yaml file and run command flutter pub get I can successfully build android build from Mac. This solution might not be global but solution of my problem I found this.
Thank you!
Happy coding.

Why gradle could not open cp_proj remapped class cache for a flutter plugin

I wrote a plugin with kotlin, which works as example.
I published this plugin without the example folder.
Now I want to create a flutter app with the public plugin
to test whether others can use the plugin.
I get a gradle error:
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring project ':allocate_user_apps'.
Could not open cp_proj remapped class cache for 8qbsgj5slxel203zipat9627v
(C:\Users\gle.gradle\caches\4.4\scripts-remapped\build_1nm6t3qaagcrhueaws5c4rnfu\8qbsgj5slxel203zipat9627v\cp_proj638c4bcc3be846fd35262b91d5a74869).
Could not open cp_proj generic class cache for build file 'H:\Users\Public\Documents\prog\flutter\flutter_windows_inst.pub-cache\hosted\pub.dartlang.org\allocate_user_apps-0.0.1\android\build.gradle'
(C:\Users\gle.gradle\caches\4.4\scripts\8qbsgj5slxel203zipat9627v\cp_proj\cp_proj638c4bcc3be846fd35262b91d5a74869).
Build file 'H:\Users\Public\Documents\prog\flutter\flutter_windows_inst.pub-cache\hosted\pub.dartlang.org\allocate_user_apps-0.0.1\android\build.gradle'
should not contain a package statement.
Where I can search for failures?
Already tried flutter clean without improvement
Thanks for advice
Erhy
strange:
in
flutter_windows_inst\ .pub-cache\hosted\pub.dartlang.org \allocate_user_apps-0.0.3\ android\build.gradle
I deleted the first line
package android
and the problem was fixed.
From where was this line is created?
With modifications in the plugin project I could solve the problem:
In file settings.gradle of the plugin project already I deleted the first line
package android
also in the file build.gradle of the plugin project already I deleted the first line
package android
I encreased the version number in pubspec.yaml of the plugin project
and executed
cd to the plugin project base directory
flutter packages pub publish
After imported the plugin with the new version number
there was nothing to change in the app project.

Mismatch between react-native gradle config and react-native-firebase last version

I have a react-native project in which I want to use firebase notification. I found react-native-firebase as a most popular library to do that. The problem is after installing the last version of react-native-firebase, the project cannot be build because of the mismatch between my project gradle version (It's a guess) and react-native-firebase. Also I cannot add other configurations to build.gradle file.
Error:
* Where:
Build file '/home/hassan/Documents/project/ems/reactApp/node_modules/react-native-firebase/android/build.gradle' line: 3
* What went wrong:
A problem occurred evaluating project ':react-native-firebase'.
> Could not find method google() for arguments [] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.
As I'm not so expert with android studio and gradle, I cannot come up with an idea to figure it out. To put in the nutshell my questions are:
I installed the last version of the android studio and react native. why the build.gradle file looks old (e.g I can see compile instead of implementation).
How can I upgrade my react-native project to use last configurations of gradle?
Should I use an environment variable to specify the last version of gradle?
Update distributionUrl in gradle-wrapper.properties (android/gradle/wrapper/gradle-wrapper.properties)
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Also, make sure to follow the installation steps in the following link https://rnfirebase.io/docs/v4.3.x/installation/android

Unable to build an android gradle project - for a cordova project

I am unable to build a gradle project, even if I edit the gradle property, I get the following error:
Error:(22, 1) A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'android']
> Gradle version 2.10 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\salangar\angular-cordova-tickrv0.1\platforms\android\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip
How do I resolve this?
I was also getting the same error and modifying the
$(your app path)/platform/android/gradle/wrapper/gradle-wrapper.properties to
distributionUrl=http\://services.gradle.org/distributions/gradle-2.10-all.zip
didn't help as it was getting overridden every time i ran cordova build android to 2.2.1
I finally changed the gradleBuilder.js file under $(your app path)/platforms/android/cordova/lib/builders folder.
Search for distributionUrl and change it 2.10.
This triggered download of gradle-2.10 and compilation went through. At least it worked for me.
Instead of manipulating build.js file, the easiet approach would be as follows:
1) Download required gradle version and save it local folder.
2) In command prompt execute the following command:
export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=file:///local/path/to/folder/where/gradle/zip/is/saved/gradle-2.2.1-all.zip
3) Execute the following command: cordova run android
I discovered the issue here. Android Studio asks to upgrade gradle. Don't do that ! I've made a bug report. The version has to keep being updated in Android Studio after each rebuild on the command line.
File -> Project Structure -> Project. Need to keep changing it to 2.10. There is not one fix for this yet that I've seen.
it will always generate same file every times you run build, so the way to handle it find the generator .. in my case App Location> platform > android> cordova >lib> builders> Gradlebuilder.js and find this ..
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\: '
after edit it, every time code generate will create new distribution url you make.
Edit $(your app path)/platform/android/gradle/wrapper/gradle-wrapper.properties:
find:
distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip
Change to:
distributionUrl=http\://services.gradle.org/distributions/gradle-2.10-all.zip
I use sencha touch 2.4.2 and cordova 5.4.1.
I had the same error because the Sencha-Cmd:
sencha app build native always rewrite the file: $(your app path)/cordova/platform/android/gradle/wrapper/gradle-wrapper.properties
And reset the variable distributionUrl to the old bad value: distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip
To solve that, i have changed the variable distributionUrl, directly in the file: $(your app path)/cordova/platforms/android/cordova/lib/build.js
at line 346 change build.js:
// New good value
var distributionUrl = 'distributionUrl=http\\://services.gradle.org/distributions/gradle-2.10-all.zip';
// Old bad value
// var distributionUrl = 'distributionUrl=http\\://services.gradle.org/distributions/gradle-2.2.1-all.zip';
And that permanently solve the problem and i can now have a successful native build for Android ;)

Categories

Resources