question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android doesn't build after update to version 5.5.3

See original GitHub issue

Question

Hi! I Updated react-native-device-info from 2.1.2 to 5.5.3 and I have the error with build android.


> Task :react-native-device-info:compileDebugJavaWithJavac FAILED

Note: Recompile with -Xlint:unchecked for details.
/Users/beatdev/Documents/ReactNative/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNInstallReferrerClient.java:8: error: package com.android.installreferrer.api does not exist
import com.android.installreferrer.api.InstallReferrerClient;
                                      ^
/Users/beatdev/Documents/ReactNative/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNInstallReferrerClient.java:9: error: package com.android.installreferrer.api does not exist
import com.android.installreferrer.api.InstallReferrerStateListener;
                                      ^
/Users/beatdev/Documents/ReactNative/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNInstallReferrerClient.java:10: error: package com.android.installreferrer.api does not exist
import com.android.installreferrer.api.ReferrerDetails;
                                      ^
/Users/beatdev/Documents/ReactNative/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNInstallReferrerClient.java:15: error: cannot find symbol
  private InstallReferrerClient mReferrerClient;
          ^
  symbol:   class InstallReferrerClient
  location: class RNInstallReferrerClient
/Users/beatdev/Documents/ReactNative/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNInstallReferrerClient.java:39: error: cannot find symbol
  private InstallReferrerStateListener installReferrerStateListener =
          ^
  symbol:   class InstallReferrerStateListener
  location: class RNInstallReferrerClient
/Users/beatdev/Documents/ReactNative/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNInstallReferrerClient.java:19: error: cannot find symbol
    mReferrerClient = InstallReferrerClient.newBuilder(context).build();
                      ^
  symbol:   variable InstallReferrerClient
  location: class RNInstallReferrerClient
/Users/beatdev/Documents/ReactNative/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNInstallReferrerClient.java:40: error: cannot find symbol
    new InstallReferrerStateListener() {
        ^
  symbol:   class InstallReferrerStateListener
  location: class RNInstallReferrerClient
Note: /Users/beatdev/Documents/ReactNative/node_modules/react-native-device-info/android/src/main/java/com/learnium/RNDeviceInfo/RNDeviceModule.java uses or overrides a deprecated API.

My react-native and jetifier versions

"react-native": "0.61.5",
"jetifier": "1.6.4",

I removed node_modules and install again and it didn’t help. I did cd android && ./gradlew clean and it didn’t help. I could not to find a similar issue. Any help?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
mikehardycommented, Mar 17, 2020

That should not be happening, this line brings in the dependency: https://github.com/react-native-community/react-native-device-info/blob/85a04982d01ee7fef811bb255a8880714bb262a6/android/build.gradle#L51

And I don’t reproduce the problem with local builds, nor has anyone else reported. Not saying there isn’t something subtle wrong, or that there might be a need for documentation, but I think this will end up being something about your project (my first guess would be an unclean build - same as you were thinking with the gradle cleans). 🤔

0reactions
mikehardycommented, Nov 12, 2020

that is relatively baffling, I don’t have any off-the-cuff thoughts on it. Your exclude shouldn’t factor / the dependency should work. 🤔 🤷 😩

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android doesn't build after update to version 5.5.3 #974
Question Hi! I Updated react-native-device-info from 2.1.2 to 5.5.3 and I have the error with build android.
Read more >
Could not find com.android.tools.build:gradle:5.5.1
I want to upgrade my gradle from version 2.14.1 to 5.5.1 and it won't let me. Here's the error I get: Gradle sync...
Read more >
Known issues with Android Studio and Android Gradle Plugin
If Studio doesn't start after an upgrade, the problem may be due to an invalid Android Studio configuration imported from a previous version...
Read more >
Fix an installed Android app that isn't working
Step 1: Restart & update · Open your phone's Settings app. · Near the bottom, tap System and then Advanced and then System...
Read more >
How to upgrade from Android Lollipop to Android 10
Update Workaround · Go to the “Settings” on your Android device and tap on your “App Manager.” · From here, locate “Google Services...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found