chaquo / chaquopy

Chaquopy: the Python SDK for Android
https://chaquo.com/chaquopy/
MIT License
807 stars 132 forks source link

Caused by: com.chaquo.python.BuildPythonFailedException: Process 'command 'python'' finished with non-zero exit value 1 #1095

Closed mintheinwin closed 7 months ago

mintheinwin commented 7 months ago

When I compile app I got this error. "Caused by: com.chaquo.python.BuildPythonFailedException: Process 'command 'python'' finished with non-zero exit value 1" app level build gradle file

plugins {
     id 'com.android.application'
       //for python
     id 'com.chaquo.python'
      //for google map
     id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
    }

//for realm database
apply plugin: "realm-android"
android {
compileSdk 34
namespace 'com.dso.chemproxc2'

defaultConfig {
        applicationId "com.dso.chemproxc2"
        minSdk 24
        targetSdk 33
        versionCode 1
        versionName "2.0.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        // giving source folder of the python script that we will use in this app.
        sourceSets{
            main{
                python {
                    srcDirs =["src/main/python"]
                }
            }
        }
        // end

        // adding the abiFilters setting to specify which ABIs you want the app to support
        ndk {
            abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
        }
        // end

        //  setting our app’s Python version and point to the python.exe to be used.
        python {
            //buildPython "/usr/local/bin/python"
           // buildPython "/Users/teamone/opt/anaconda3/bin/python3"
           // buildPython "C:\\Users\\Min Thein Win\\AppData\\Local\\Programs\\Python\\Python312"
            //buildPython "C:\\Users\\Min Thein Win\\AppData\\Local\\Programs\\Python\\Python311\\python.exe"
          //  buildPython "Python311\\python.exe"
            buildPython "C:\\Users\\Min Thein Win\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe"
           // buildPython "C:\\Users\\Min Thein Win\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe"
        }

        python {
            pip {
                // A requirement specifier, with or without a version number:
                install "numpy"
                install "pathlib"
                install "bs4"
//                install "aiohttp"
                install "requests"
//                install "asyncio"
                install "grequests"
//                install "warnings"
                install "simplejson"

                install "xlrd"

                install "pandas"
                install "openpyxl"
            }
        }
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

buildFeatures {
    buildConfig true
    viewBinding true
}

realm {
    syncEnabled = true
}

//fixed for butterknife UI binding
tasks.withType(JavaCompile).configureEach{
    options.fork = true
    options.forkOptions.jvmArgs +=[
            '--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
            '--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
            '--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED']
}

dexOptions {
    incremental true
    javaMaxHeapSize "6g"
    preDexLibraries true
    dexInProcess = true
      }
    }

dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.10.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment:2.7.4'
implementation 'androidx.navigation:navigation-ui:2.7.4'
implementation 'androidx.window:window:1.2.0-beta04'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

//for fixed compile sdk 34
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
implementation 'org.json:json:20211205'

//for Chart Library Module
      // implementation project(':MPChartLib')
      implementation project(":anychart")
      implementation project(":colorseekbar")
      //implementation project(":serviceLibrary")

implementation 'com.jjoe64:graphview:4.2.2'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
//implementation 'com.github.rtugeek:colorseekbar:2.1.0'

//UI Binding
implementation 'com.jakewharton:butterknife:10.2.3'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
//Realm Mogo Database
implementation 'io.realm:realm-gradle-plugin:10.15.1'

// for read excel file support for xls file format only
//implementation 'org.apache.poi:poi:4.0.0'
//implementation 'org.apache.poi:poi-ooxml:4.0.0'

// for background thread
implementation 'org.greenrobot:eventbus:3.1.1'
//gif image
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.22'

//google map
/*implementation 'com.google.android.gms:play-services-maps:18.1.0'
implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'com.google.maps.android:android-maps-utils:0.4.+'
implementation 'com.google.android.gms:play-services-base:18.2.0'*/

implementation 'com.google.android.gms:play-services-maps:18.2.0'
//18.1.0
//18.0.2
//18.0.1
//18.0.0
  // implementation 'com.google.android.gms:play-services-maps:18.0.0'
  // implementation 'com.google.android.libraries.places:places:3.2.0'
  implementation 'com.google.android.gms:play-services-location:21.0.1'

// for Mqtt
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.github.hannesa2:paho.mqtt.android:4.2'
//implementation 'com.github.hannesa2:paho.mqtt.android:3.6.0-beta7'
implementation 'com.google.code.gson:gson:2.10.1'

//implementation 'androidx.fragment:fragment:1.3.6'

}

mhsmith commented 7 months ago

Please post the complete buildl log. You can display it by clicking the “Build: failed” caption to the left of the error.

mhsmith commented 7 months ago

If you still need help, please post the requested information, and I'll reopen the issue.