Script@1.1.4 (exit code: 1) Error

Hello.

I want to build an apk file, I added 2 steps (Script 1.1.4 and Deploy to Bitrise.io).
When a project is building i have error "script@1.1.4 (exit code: 1) ", what does it mean?
And in top i have alert :
“You may be on the wrong stack to build this kind of project. Your current stack is: Android & Docker, on Ubuntu 14.04 - LTS Stack (pre-installed tools)”

1 Like

Hi @bogdan_martynov

That’s just a warning/notice/reminder. Wrong stack is quite a frequent issue, especially in case of the Mac stacks where the Xcode version matters quite a lot. If you’re sure you’re on the right stack just ignore this :slight_smile:

That means that your script exited with an exit code 1. Only exit code 0 means success - this is a standard command line tool thing; anything other than exit code 0 means “the command failed”.

Now which command failed, that depends on your script, what you defined as the script.

If you have a Bash script I’d suggest you to keep the default top part of it:

#!/bin/bash
# fail if any commands fails
set -e
# debug log
set -x

# write your script here
...

Or if you already removed please add this back (or the short form of the two set commands: set -ex). You can read more about these Bash flags in Bash tutorials eg set -ex - The most useful bash trick of the year - Peterbe.com

In short, set -e enables “fail if any command fails” (exit with a non 0 exit code) and set -x means “print every command before executing the command”. If you have both then you’ll see which command failed in the log (right above the exit code: 1 line).

If you have any questions just let us know! :slight_smile:

1 Like

Thanks for the answer @viktorbenei

I followed your advice and how much I understood my error in this line
"Illegal option: /android.keystore
keytool -genkeypair [OPTION]…"
How can I solve this problem?

1 Like

Can you please include the whole log of this step, and maybe the script content too? Would make it way easier and faster to help you with the debugging :wink:

I’d also suggest you to check these guides, to help with local debugging on your Mac/Linux:

This seems like you provided an invalid parameter/option to the keytool command. Might be that you provided an invalid path - from this it seems the path specified was /android.keystore which should probably be ./android.keystore, as if the path starts with a / that means the file system root, not the repo root or the current directory.

1 Like

@viktorbenei

In general, I succeeded build project.
I use this script:

    #!/bin/bash_
    set -e_
    set -x_
    mkdir -p keystore 
    echo y | keytool -genkeypair -dname "cn=Test, ou= Test, o= Test, c= Test " \
   -alias TestTest -keypass TestTest -keystore /keystore  \
   -storepass TestTest -validity 25

But when i downloaded “src.zip” in it was empty folder “keystore”.
I tried to ignore this, I put this folder in my project root and set up my gradle like this

signingConfigs {
    production {
        storeFile file("/keystore")
        storePassword "TestTest"
        keyAlias "TestTest"
        keyPassword "TestTest"
    }
}

buildTypes {
    release {
        signingConfig signingConfigs.production
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

I changedI in bitrise my triger to “deploy” and did push to bitbucket, and bitrise started building project, but I got 2 errors with (cache-pull@1.0.0, gradle-runner@1.7.0) exit code: 1 .

This is my log.

I do not know what the problem is, probably because src.zip was empty. But why it was empty I also do not know.

Help please.
Thanks.

Sorry, what’s src.zip? I might be missing something but I don’t see what src.zip would be or where it should come, your log doesn’t include it.

Did you check the two local debug guides I linked?

1 Like

@viktorbenei

This “src.zip”.
screenshot
Thanks for the links, I watched them, but in them talk about local methods, but I have windows os and I do not know how it can help me.

Hello.

I’m trying to create apk file of my android app. I add new workflow and add to my workflow 2 steps (Script and Deploy to Bitrise.io)

I use this script:

#!/bin/bash
  set -e
  set -x
  mkdir -p ./keystore
  echo y | keytool -genkeypair -dname "cn=Test, ou= Test, o= Test, c= Test " \
 -alias TestTest -keypass TestTest -keystore ./keystore/android.keystore \
 -storepass TestTest -validity 25

I build project, downloaded src.zip (screenshot) from bitrise when project build success and got android.keystore, I put android.keystore to root of my project and add this code to my gradle.

signingConfigs {
production {
    storeFile file("../keystore/android.keystore")
    storePassword "TestTest"
    keyAlias "TestTest"
    keyPassword "TestTest"
  }
}

buildTypes {
release {
    signingConfig signingConfigs.production
    minifyEnabled true
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  }
}

I changedI in bitrise my triger to “deploy” and did push to bitbucket, and bitrise started building project, but I got 2 errors with (cache-pull@1.0.0, gradle-runner@1.7.0) exit code: 1 .

My log

How can I solve this problem?

Thanks

Based on the Log this seems to be an error in your project, or maybe a Java version difference

E.g.:

Note: the configuration refers to the unknown class 'Object'
      Maybe you meant the fully qualified name 'java.lang.Object'?

You can still follow this guide How to debug your build locally / "It works on my Mac/PC but not on bitrise.io" and e.g. do a clean git clone and see if you can build the project from there; as well as if you install docker (Docker for Windows) you can also run the build through Docker as described in the Download and use the Android/Linux environment section.

1 Like

Here is the reason:

Warning: there were 66 unresolved references to classes or interfaces.
You may need to add missing library jars or update their versions.
If your code works fine without the missing classes, you can suppress
the warnings with ‘-dontwarn’ options.
(ProGuard Manual: Troubleshooting | Guardsquare)
Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.

You need to add appropriate keep options, correct dependencies or ignore those warnings.
Here are those 66 warnings:

Warning: com.vungle.publisher.sj: can’t find superclass or interface com.google.android.gms.common.GooglePlayServicesClient$ConnectionCallbacks
Warning: com.vungle.publisher.sj: can’t find superclass or interface com.google.android.gms.common.GooglePlayServicesClient$OnConnectionFailedListener
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Cache
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Cache
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.CacheControl
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.CacheControl$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.CacheControl$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.CacheControl$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.CacheControl$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.CacheControl$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Request$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Request$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Request$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Request$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Request$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Call
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Response
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Response
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.ResponseBody
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Response
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Response
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.ResponseBody
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.ResponseBody
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Cache
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.CacheControl
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.CacheControl$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Request$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Response
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Cache
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.CacheControl
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Request
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Call
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Response
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.ResponseBody
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.OkHttpClient
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.CacheControl$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.CacheControl
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Request$Builder
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Response
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.ResponseBody
Warning: com.squareup.picasso.OkHttpDownloader: can’t find referenced class com.squareup.okhttp.Cache
Warning: com.vungle.publisher.sj: can’t find referenced class com.google.android.gms.common.GooglePlayServicesClient
Warning: com.vungle.publisher.sj: can’t find referenced class com.google.android.gms.common.GooglePlayServicesClient$ConnectionCallbacks
Warning: com.vungle.publisher.sj: can’t find referenced class com.google.android.gms.common.GooglePlayServicesClient$OnConnectionFailedListener
Warning: com.vungle.publisher.sj: can’t find referenced class com.google.android.gms.location.LocationClient
Warning: com.vungle.publisher.sj: can’t find referenced class com.google.android.gms.location.LocationClient
Warning: com.vungle.publisher.sj: can’t find referenced class com.google.android.gms.location.LocationClient
Warning: com.vungle.publisher.sj: can’t find referenced class com.google.android.gms.location.LocationClient
Warning: com.vungle.publisher.sj: can’t find referenced class com.google.android.gms.location.LocationClient
Warning: com.vungle.publisher.sj: can’t find referenced class com.google.android.gms.location.LocationClient
Warning: com.vungle.publisher.sj: can’t find referenced class com.google.android.gms.location.LocationClient
Warning: com.vungle.publisher.sj: can’t find referenced class com.google.android.gms.common.GooglePlayServicesClient$ConnectionCallbacks
Warning: com.vungle.publisher.sj: can’t find referenced class com.google.android.gms.common.GooglePlayServicesClient$OnConnectionFailedListener

2 Likes