React-native-code-push: Package does not exist

Created on 2 May 2018  路  5Comments  路  Source: microsoft/react-native-code-push

Steps to Reproduce

  1. install react-native-code-push
  2. try running the app on the emulator or on a phone with react-native run-android

Expected Behavior

What you expected to happen?

Actual Behavior

What actually happens?

I cannot install the app on my Samsung S8 or on the android emulator. I get an error saying the package does not exist.

  STACK TRACE AND/OR SCREENSHOTS

:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
C:\Stock Api\stock_app\android\app\src\main\java\com\stock_app\MainApplication.java:6: error: package com.microsoft.codepush.react does not exist
import com.microsoft.codepush.react.CodePush;
                                   ^
C:\Stock Api\stock_app\android\app\src\main\java\com\stock_app\MainApplication.java:23: error: cannot find symbol
        return CodePush.getJSBundleFile();
               ^
  symbol: variable CodePush
C:\Stock Api\stock_app\android\app\src\main\java\com\stock_app\MainApplication.java:35: error: cannot find symbol
            new CodePush(null, getApplicationContext(), BuildConfig.DEBUG),
                ^
  symbol: class CodePush
3 errors
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

Environment

  • react-native-code-push version: 5.3.0
  • react-native version: 0.54.0
  • iOS/Android/Windows version: 8
  • Does this reproduce on a debug build or release build? both
  • Does this reproduce on a simulator, or only on a physical device? both

Other info

I tried editing the MainApplication.java to use MainApplication.this but with no luck

waiting-for-clarification

Most helpful comment

I tried again using :

"react": "16.3.1",
"react-native": "0.55.2",
"react-native-code-push": "5.3.2"

I found that the react-native link react-native-code-push command does not add the following line to the build.gradle file :

dependencies {
+    compile project(':react-native-code-push')
     compile fileTree(dir: "libs", include: ["*.jar"])

Maybe somehow could check why this line is not added with the react-native command

All 5 comments

I tried again using :

"react": "16.3.1",
"react-native": "0.55.2",
"react-native-code-push": "5.3.2"

I found that the react-native link react-native-code-push command does not add the following line to the build.gradle file :

dependencies {
+    compile project(':react-native-code-push')
     compile fileTree(dir: "libs", include: ["*.jar"])

Maybe somehow could check why this line is not added with the react-native command

Hi @Adwich,

Thanks for reporting!
I've tested usual scenario and haven't found any issue. Your issue line(compile project(':react-native-code-push')) was added.
Could you please share your command and actions which you used for setup?

Also, this is setup documentation which can help you setup successfully: https://github.com/Microsoft/react-native-code-push#getting-started

Thanks,
Alexander

Hi @alexandergoncharov ,

My project was started with react-native init. All I did was :
npm i --save react-native-code-push
react-native link react-native-code-push

I followed the doc all along. But it is working for me. It might not be a bug. Thank you for help

@Adwich , Could you please try to make one more project just for test with CodePush setup?
And if this issue is reproduced then could you please share this project with reproducing issue?
Because I can't repro this and I'm not sure what is the reason of issue. Your test project will help me to investigate it.

Thanks,
Alexander

Hi @Adwich,

I'll close this issue for now as I didn't hear answer form you in a while. Please feel free to reopen it if you will have any questions.

Thanks,
Alexander

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kevando picture kevando  路  4Comments

Adr1ann picture Adr1ann  路  3Comments

panarasi picture panarasi  路  4Comments

chrisjrex picture chrisjrex  路  4Comments

DeDuckProject picture DeDuckProject  路  3Comments