Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle: path may not be null or empty string. path='null' #595

Closed
unicornlox opened this issue Dec 4, 2017 · 5 comments
Closed

Gradle: path may not be null or empty string. path='null' #595

unicornlox opened this issue Dec 4, 2017 · 5 comments

Comments

@unicornlox
Copy link

unicornlox commented Dec 4, 2017

When I run this command, I get this error;
buildozer android release
then i have got error:

[INFO]:    STDOUT:
	Picked up _JAVA_OPTIONS:   -Dawt.useSystemAAFontSettings=gasp	
Starting a Gradle Daemon (subsequent builds will be faster)	
	
FAILURE: Build failed with an exception.	
	
* Where:	
Build file '/home/yemrems/Documents/derleiki/.buildozer/android/platform/build/dists/simplem/build.gradle' line: 34	
	
* What went wrong:	
A problem occurred evaluating root project 'simplem'.	
> path may not be null or empty string. path='null'	
	
* Try:	
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.	
	
BUİLD FAILED	
	
Total time: 29.138 secs	

[INFO]:    STDERR:
	
[INFO]:    COMMAND:
cd /home/yemrems/Documents/derleiki/.buildozer/android/platform/build/dists/simplem && ./gradlew assembleRelease

[WARNING]: ERROR: ./gradlew failed!

my build.gradle is ;

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
       jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.1'
    }
}

allprojects {
    repositories {
        jcenter()
	    flatDir {
	    	dirs 'libs'
	    }
    }
}

apply plugin: 'com.android.application'

android {
	compileSdkVersion 19
	buildToolsVersion '27.0.1'
	defaultConfig {
		minSdkVersion 9
		targetSdkVersion 19
		versionCode 1
		versionName '0.1'
	}

	signingConfigs {
		release {
			storeFile file(System.getenv("P4A_RELEASE_KEYSTORE"))
			keyAlias System.getenv("P4A_RELEASE_KEYALIAS")
			storePassword System.getenv("P4A_RELEASE_KEYSTORE_PASSWD")
			keyPassword System.getenv("P4A_RELEASE_KEYALIAS_PASSWD")
		}
	}

	buildTypes {
		debug {
		}
		release {
			signingConfig signingConfigs.release
		}
	}

    sourceSets {
        main {
            jniLibs.srcDir 'libs' 
            }
        }

}

dependencies {
}

my java version:

Picked up _JAVA_OPTIONS:   -Dawt.useSystemAAFontSettings=gasp
openjdk version "1.8.0_141"
OpenJDK Runtime Environment (build 1.8.0_141-8u141-b15-3-b15)
OpenJDK 64-Bit Server VM (build 25.141-b15, mixed mode)

./gradlew -version is:

Picked up _JAVA_OPTIONS:   -Dawt.useSystemAAFontSettings=gasp
Downloading https://services.gradle.org/distributions/gradle-3.2.1-bın.zip

Exception in thread "main" java.io.FileNotFoundException: https://downloads.gradle.org/distributions/gradle-3.2.1-bın.zip
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1872)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
	at org.gradle.wrapper.Download.downloadInternal(Download.java:60)
	at org.gradle.wrapper.Download.download(Download.java:45)
	at org.gradle.wrapper.Install$1.call(Install.java:62)
	at org.gradle.wrapper.Install$1.call(Install.java:48)
	at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
	at org.gradle.wrapper.Install.createDist(Install.java:48)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

gradle -v is ;

Picked up _JAVA_OPTIONS:   -Dawt.useSystemAAFontSettings=gasp

------------------------------------------------------------
Gradle 3.2.1
------------------------------------------------------------

Build time:   2012-12-21 00:00:00 UTC
Revision:     none

Groovy:       2.4.8
Ant:          Apache Ant(TM) version 1.9.9 compiled on June 29 2017
JVM:          1.8.0_141 (Oracle Corporation 25.141-b15)
OS:           Linux 4.9.0-deepin13-amd64 amd64

thank you very much already for your help.

@inclement
Copy link
Member

Thanks for the detailed report. Are you trying to build a release apk, and do you have the environment variables in the signing config section of build.gradle set? If not, I think that will cause the error. This is a bug in buildozer.

@unicornlox
Copy link
Author

I tried the command like this ; buildozer android release apk but I am getting the same error again.
How should I organize the file named build.gradle?
I have no idea.

@inclement
Copy link
Member

There should be a templates folder in the folder where you found the build.gradle, containing a file that looks like /~https://github.com/kivy/python-for-android/blob/master/pythonforandroid/bootstraps/sdl2/build/templates/build.tmpl.gradle#L32 . If you can find that, open it and delete lines 32 to 41 (the {% if args.sign %} block).

@unicornlox
Copy link
Author

unicornlox commented Dec 5, 2017

32 to 41 and 47 to 49 so ;

{% if args.sign -%}
	signingConfigs {
		release {
			storeFile file(System.getenv("P4A_RELEASE_KEYSTORE"))
			keyAlias System.getenv("P4A_RELEASE_KEYALIAS")
			storePassword System.getenv("P4A_RELEASE_KEYSTORE_PASSWD")
			keyPassword System.getenv("P4A_RELEASE_KEYALIAS_PASSWD")
		}
	}
    {%- endif %}

and

{% if args.sign -%}
			signingConfig signingConfigs.release
			{%- endif %}

I have successfully completed the process when I deleted these codes.
thank you so much

@tito
Copy link
Member

tito commented Dec 15, 2017

i tried to implement a fix for that in master: if the env variables are not passed, --sign will not be used.

@tito tito closed this as completed Dec 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants