Trouble Installing Firebase Analytics to my React Native Android version - android

Ok so I believe I followed these instructions perfectly: https://rnfirebase.io/docs/v5.x.x/installation/android
1) After completing the instructions I get this error: Minimum supported Gradle version is 4.6. Current version is 4.4.
2) I go into gradle-wrapper.properties and change distributionUrl from
https\://services.gradle.org/distributions/gradle-4.4-all.zip
to
https\://services.gradle.org/distributions/gradle-4.6-all.zip
and re-synce
3) When I try to build after this I get the error:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDevMinSdkDevKernelDebugResources'.
In the Java compiler I get the error:
/Users/DJarrin/Work/dev_envs/****/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java:
uses or overrides a deprecated API.
Recompile with -Xlint:deprecation for details.
I'm pretty lost and would really appreciate just some next steps to solve the issue.

Related

unknown property ‘manifestOutputDirectory’

I had to integrate a library into my app and the library had its gradle version as 4.0.0, while my app had 3.2.2 (or something). So it bumped into the queries tag in the library (in its Manifest) that it wouldn’t recognize. Therefore I have updated the gradle version in my app to be the same as the library, at 4.0.0 (now I put it as 4.1.0, the latest).
The problem is that I bump into the following error:
`Execution failed for task ‘:app:processCanaryDebugManifest’.
Could not get unknown property ‘manifestOutputDirectory’ for task ‘:app:processCanaryDebugManifest’ of type com.android.build.gradle.tasks.ProcessMultiApkApplicationManifest.
This is based on this warning:
API 'variantOutput.getProcessManifest()' is obsolete and has been replaced with 'variantOutput.getProcessManifestProvider()'.
I haven’t been able to make any progress on this. I have ran the gradlew command with --stacktrace but all I get are errors from gradle, nothing specific. Do you know of any way to make this work? The only things I've found so far are issues with a Huawei thing, but it's not the case for me. Thanks!
PS. I'm not sure what additional info would be useful in this circumstance.
EDIT: I've downgraded to gradle 3.3.3 and commented out my new library dependecies, and now it says:
`Execution failed for task ':app:processCanaryDebugManifest'.
java.io.FileNotFoundException: property(interface org.gradle.api.file.Directory, transform(property(interface org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultProjectLayout$FixedDirectory, C:\build\myapp\app))))\AndroidManifest.xml (The filename, directory name, or volume label syntax is incorrect)`

React native android not compiling with react-native-device-info

I'm getting the following error when I try to build the project using $ react-native run-android.
> Task :react-native-device-info:compileDebugJavaWithJavac FAILED
/Users/user/Desktop/mobile/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java:31: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
^
/Users/user/Desktop/mobile/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java:838: error: cannot find symbol
#Nullable Object data) {
^
symbol: class Nullable
location: class RNDeviceModule
Note: /Users/ammiel/Desktop/mobile/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILURE: Build failed with an exception.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-device-info:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
I have jetify running postinstall and have
android.useAndroidX=true
android.enableJetifier=true
in my gradle.properties.
Been lurking at many pages/github pages with no success :/ Any help is appreciated!
Other info:
react-native: 0.59.10
react-native-device-info: 5.6.1
I faced the same problem like you!
But I managed to solve it by just adding the dependencies.
yarn add react-native-device-info
Wolla! The app is now running.
for that problem, one way is that you can update the new `react-native-device-
info` to solve the problem.
it releases note give the version which support androidx
2.3.0
feat: AndroidX support (backwards/forwards compatible) (https://github.com/react-native-community/react-native-device-info/pull/733)
fix: isTablet() Android using Google-recommended / robust style (https://github.com/react-native-community/react-native-device-info/pull/730)
the second way is to change the code manually.
the reason is that the android studio does not translate it to androidX API, so it reports errors. so you have to replace them manually or use the newest
the version which had changed to android.
Besides them, you can see this question, it may help you

Error in compile Android project via terminal with gradle 4.6

My project today was updated to Gradle 4.6, before I used the following line to compile the project via Android Studio terminal:
./gradlew assembleDebug --configure-on-demand --daemon
Now an error occurs when I try to compile the project with that command. I have tried to read the documentation as shown in the output, but I can't find a topic about my particular problem.
Error log:
Task :app:compileTargetApi23DebugJavaWithJavac
error: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: android.databinding.annotationprocessor.ProcessDataBinding Unable to get public no-arg constructor
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
I appreciate any help in advance!
Error produced by Java 10, I uninstalled the JDK 10 and the compiler works again!

Ionic v2 Google Maps API Android Build Error: cannot access AbstractSafeParcelable options.compassEnabled(controls.getBoolean("compass"));

I'm trying to implement the Google Maps API using the Ionic docs as seen here.
I'm using the code samples exactly as supplied, but I'm getting the following error:
BUILD FAILED
Total time: 2.748 secs
Error: /path/to/platforms/android/gradlew: Command failed with exit code 1 Error output:
/path/to/platforms/android/src/plugin/google/maps/GoogleMaps.java:479: error: cannot access AbstractSafeParcelable
options.compassEnabled(controls.getBoolean("compass"));
^
class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details
Has anyone seen/resolved this issue?
I was able to resolve the issue. While a lot of the suggestions I found revolved around installing missing repositories (you need Android Support Repository, Library, Play Services and Google Repository), I had all that in place. What was missing was that incorrect versioning is specified in project.properties when I used this command to add the plugin:
ionic plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"
In project.properties, I changed this:
cordova.system.library.4=com.google.android.gms:play-services-maps:9.8.0
cordova.system.library.5=com.google.android.gms:play-services-location:9.8.0
To this:
cordova.system.library.4=com.google.android.gms:play-services-maps:+
cordova.system.library.5=com.google.android.gms:play-services-location:+
That resolved the build error.

Android Studio does not compile when using deprecated API

I am having issues compiling and running my application on Android Studio.
The problem: It doesn't like that I am using deprecated APIs. (from gradlew compileDebug --stacktrace. Full stacktrace here
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
The Background:
I am using a PreferenceActivity which uses onPreferenceTreeClick and addPreferencesFromResource(int), both deprecated methods.
I am using ABS and ViewPager libraries, which both seem to also be using deprecated methods in their code.
The Question:
Can the run configurations be edited to an extend where It can compile succesfully despite of the deprecated APIs?
What can be changed/edited/modified to allow the build to compile succesfully?
Given that I plan on supporting pre-ICS devices and the usage of deprecated APIS shoudln't suppose a problem.
EDIT
So, the compiler from command prompt indicates the build was succesful, problem is running from Android Studio directly, the build process fails:
FAILURE: Build failed with an exception.
The problem seems to be something I have no idea how to fix, the popular line is:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added:
which is happening at three different places:
Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoStubImpl;
Landroid/support/v4/app/ActivityCompatHoneycomb;
Landroid/support/v4/app/LoaderManager;
Here's some more info: Full Compiler output in Android Studio
* What went wrong:
Execution failed for task ':LaPrensa:dexDebug'.
> Running C:\Users\SkullKandy\AppData\Local\Android\android-studio\sdk\build-tools\android-4.2.2\dx.bat failed.
You have simply to add this code to build.gradle (in android section)
lintOptions {
abortOnError false
}

Categories

Resources