Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Build fail with Gradle when i enable network inspection. #102

Closed
Folyd opened this issue Mar 26, 2015 · 1 comment
Closed

Build fail with Gradle when i enable network inspection. #102

Folyd opened this issue Mar 26, 2015 · 1 comment

Comments

@Folyd
Copy link

Folyd commented Mar 26, 2015

I use Android Studio 1.1.0 (stable),and my os is Mac OS X 10.10.

If i only enable default configuration i can build success,but i enable network inspection i always build fail.

I use Retrofit to request network data,and below is my code to enable network inspection.

        OkHttpClient client = new OkHttpClient();
        client.networkInterceptors().add(new StethoInterceptor());
        RestAdapter.Builder builder = new RestAdapter.Builder().setEndpoint(Api.BASE_URL)
                .setLogLevel(RestAdapter.LogLevel.FULL)
                .setRequestInterceptor(new RequestInterceptor() {
                    @Override
                    public void intercept(RequestFacade request) {
                        request.addQueryParam("hd", Api.hd);
                        request.addQueryParam("appver", Api.appver);
                        request.addQueryParam("platform", Api.platform);
                        request.addQueryParam("channel", Api.channel);

                        if (AccountManager.hasLogin()) {
                            request.addQueryParam("p", AccountManager.ticket);
                        }
                    }
                }).setConverter(new GsonConverter(gson)).setClient(new OkClient(client));

My build.gradle:
compile 'com.facebook.stetho:stetho:1.0.1'
compile 'com.facebook.stetho:stetho-okhttp:1.0.1'

Error:Execution failed for task ':my-project-name:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

@jasta
Copy link
Contributor

jasta commented Mar 28, 2015

I believe there is likely another error message being printed (the java finished with non-zero exit value 2 message is a red herring I think) further up that includes the real error.

@jasta jasta closed this as completed Apr 11, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants