helium / maker-starter-app

Apache License 2.0
36 stars 39 forks source link

got an error when compile for android #19

Closed lifei1245 closed 2 years ago

lifei1245 commented 2 years ago

Context

JS logs:

* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve project :react-native-ble-plx.
     Required by:
         project :app
      > No matching configuration of project :react-native-ble-plx was found. The consumer was configured to find a runtime of a component, as well as attribute 'com.android
.build.api.attributes.BuildTypeAttr' with value 'debug' but:
          - None of the consumable configurations have attributes.

* 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 2m 54s

is there any solution for this?

tyler-whitman commented 2 years ago

@lifei1245 for some reason the build is not finding the react-native-ble-plx library, which OS are you building on? Can you trying running yarn clean-install in the root of the project and then run yarn android again.

lifei1245 commented 2 years ago

@tyler-whitman I built on Windows 10 , I open the android project in android studio directly ,it seems the settings isn't correct

No variants found for ':react-native-ble-plx'. Check build files to ensure at least one variant exists.

is there something else need to do? and it can't find com.polidea.reactnativeble.BlePackage in MainApplication when I use react-native run-android

tyler-whitman commented 2 years ago

Did you try yarn clean-install in the root of the project and then running yarn android. This project uses React Native and doesn't need to be opened in Android Studio. You need to make sure to run the javascript install commands to pull down all the libraries.

You can also follow the project readme for detailed setup and getting started instructions. If those are not working for you, please let me know where you are getting stuck.

lifei1245 commented 2 years ago

@tyler-whitman I removed temp folders manually(C:/Users/user/AppData/Local/temp and node_modules), because rm -rf is not available on windows and the folder system is not the same with macOS or linux and then run yarn cache clean && yarn install successfully

But I still got the same error,have you built successfully on windows before?

lifei1245 commented 2 years ago

I resolve this by add reposity to the gradle file of react-native-ble-plx

tyler-whitman commented 2 years ago

I resolve this by add reposity to the gradle file of react-native-ble-plx

Awesome, glad you were able to resolve it. If you don't mind posting a bug over on https://github.com/dotintent/react-native-ble-plx would be great so they can get it fixed.

boern commented 2 years ago

@lifei1245 I got the same error, can you share how to solve it ?

lifei1245 commented 2 years ago

@boern jcenter is no longer available and google repository is not available for some area ,so adding an available repository to buildscript > repositories like mavenCentral() will solve the problem(tip: update the gradle version if necessary).