Closed Overtorment closed 3 years ago
Thanks for this, Good catch.
Will publish AAR to a public maven repo, and update the module deps to use the repo instead. That should fix this.
thanks!
@Overtorment I just tried building Sifir (which I use react-native-tor
as a dependency in ).
[gus@homebase android]$ ./gradlew bundleRelease
Configuration on demand is an incubating feature.
....
info Writing bundle output to:, /home/gus/Projects/sifir-app/android/app/build/generated/assets/react/release/index.android.bundle
info Writing sourcemap output to:, /home/gus/Projects/sifir-app/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 136 asset files
info Done copying assets
....
BUILD SUCCESSFUL in 1m 21s
454 actionable tasks: 8 executed, 446 up-to-date
$ cd android && ./gradlew assembleRelease
....
BUILD SUCCESSFUL in 3m 9s
695 actionable tasks: 695 executed
./node_modules/react-native/cli.js run-android --variant=release
BUILD SUCCESSFUL in 1m 25s
450 actionable tasks: 423 executed, 27 up-to-date
info Connecting to the development server...
info Starting the app on "emulator-5554"...
Starting: Intent { cmp=com.sifir/.MainActivity }
and I tried the build having both github and npm as the source of react-native-tor
.
What's the command you guys use to build your APKs/AAB ? Or are you trying to build react-native-tor
into another AAR ?
Let me know thanks!
Im not very good with andoid build scripts (IMO its a nightmare). the steps to reproduce are:
git clone git@github.com:BlueWallet/BlueWallet.git
cd BlueWallet/
git checkout --track origin/tor4lndhub
npm i
cd android/
./gradlew assembleRelease
result:
> Task :react-native-tor:bundleReleaseAar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-tor:bundleReleaseAar'.
> Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :react-native-tor project caused this error: /tmp/BlueWallet/node_modules/react-native-tor/android/libs/sifir_android.aar
afaik this is roughly the same appcenter.ms does (its our CI/build server) to make us a production apk
any progress?
Nope, haven't really looked into this as it seems more of a build/CI issue when trying to build Bluewallet as an AAR. Maybe someone or another project can explain why that is being done for an Application ? I'll keep this issue open so others can comment on it should they be facing the same issue.
I did some googling, and looks like its gradle4 to blame (gradle3 works fine), so any RN project that is built with gradle4 will experience this.
the solution might be to upload AAR to maven and link it from there. OR to manually include AAR in my build.gradle file (that's what Im gonna try to do next)
https://stackoverflow.com/questions/60878599/error-building-android-library-direct-local-aar-file-dependencies-are-not-supp/63665094#63665094 https://github.com/transistorsoft/react-native-background-geolocation/issues/1077 https://stackoverflow.com/questions/16682847/how-to-manually-include-external-aar-package-using-new-gradle-android-build-syst/23326397#23326397
If uploading the AAR solves it for you then I think that is doable from the point of view of this repo. I also think it's probably gonna be easier for you to track and stay up to date considering this repo is new and not mature yet. I'll do it this week and let you know, so you can give it a try.
lets try uploading to maven, yes. then react-native-tor
will have to reference it from maven.
Ill try to solve it manually, meanwhile
in a change that I did here https://github.com/Sifir-io/react-native-tor/pull/10 maven upload is not necessary
left a comment on your PR. I dont think compileOnly
is the way to go
Commented on #10 , let me know what you think.
Handled by #10
When trying to build release:
Related PR: BlueWallet/BlueWallet/pull/2295