beeware / briefcase

Tools to support converting a Python project into a standalone native application.
https://briefcase.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
2.47k stars 350 forks source link

Couldn't build android app #1880

Closed bambier closed 2 weeks ago

bambier commented 2 weeks ago

Describe the bug

I'm trying to create and build android app as described in documents but I got to error when I do

briefcase build android 

Steps to reproduce

  1. briefcase new
  2. cd helloworld
  3. briefcase create android
  4. briefcase build android

Expected behavior

Giving me APK/AAB file or just run it on virtual device? IDK! It's my first time πŸ˜•

Screenshots

image

Environment

Logs

(.env) ➜  helloworld briefcase build android 

[helloworld] Updating app metadata...
Setting main module... done

[helloworld] Building Android APK...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'Hello World'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:8.2.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.2.1/gradle-8.2.1.pom
       - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/8.2.1/gradle-8.2.1.pom
     Required by:
         project :

* 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 3s
Building... errored

Error while building project.

Log saved to /home/nima/Desktop/python-projects/android/helloworld/logs/briefcase.2024_06_18-11_57_18.build.log

(.env) ➜  helloworld 

briefcase.2024_06_18-11_57_18.build.log

Additional context

No response

mhsmith commented 2 weeks ago

Your GitHub activity indicates you may be in Iran, in which case you're probably being blocked either by US sanctions or by your own government. Unfortunately we don't know anything about how to circumvent this, so I suggest you search in general Android development forums. If they suggest editing your Gradle files, you can find them in your project under build/your_app_name/android.

bambier commented 2 weeks ago

Well I found the problem. the problem was because of Khamenei, Who was blocked internet in Iran so briefcase couldn't download gradle-8.2.1.pom . After using VPN to bypass filtering and censorship of the internet, the problem was gone.

I'm going to close this issue, but it may be better to add options to download files manually.

bambier commented 2 weeks ago

Your GitHub activity indicates you may be in Iran, in which case you're probably being blocked either by US sanctions or by your own government. Unfortunately we don't know anything about how to circumvent this, so I suggest you search in general Android development forums. If they suggest editing your Gradle files, you can find them in your project under build/your_app_name/android.

Absolutely! I noticed just few minutes ago. This is really annoying that every thing is blocked in internet by our government πŸ˜