• 1 رای - 5 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
یک ارور عجیب!!!!(اندروید)
#1
سلام دوستان.
یه راهنمایی می کنید؟
این کد منه:
بقیه توضیحات زیر کد
کد پی‌اچ‌پی:
package com.irprogram.tirbargh;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Base64;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.HashMap;

public class 
insert_ads extends AppCompatActivity
{
    private 
String url_insert_ads;

    private 
String[] id;
    private 
String[] name;

    private 
ListView lv_cat;

    private 
EditText title intro desc seller email phone;

    private 
TextView selected_cat selected_img_txt;

    private 
ImageView selected_img;

    private 
String[] selected_cat_info = new String[2];

    @
Override
    
protected void onCreate(Bundle savedInstanceState)
    {
        
super.onCreate(savedInstanceState);
        
setContentView(R.layout.activity_insert_ads);

        
getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);

        
/*----------------------------------------------------------*/

        
selected_cat = (TextViewfindViewByIdR.id.txt_insert_ads_selected_cat );
        
selected_img_txt = (TextViewfindViewByIdR.id.insert_ads_selected_img_txt );
        
selected_img = (ImageViewfindViewByIdR.id.insert_ads_selected_img );

        
title = (EditTextfindViewByIdR.id.insert_ads_title );
        
intro = (EditTextfindViewByIdR.id.insert_ads_intro );
        
desc = (EditTextfindViewByIdR.id.insert_ads_desc );
        
seller = (EditTextfindViewByIdR.id.insert_ads_seller );
        
email = (EditTextfindViewByIdR.id.insert_ads_email );
        
phone = (EditTextfindViewByIdR.id.insert_ads_phone );

        
/*----------------------------------------------------------*/

        
Bundle data getIntent().getExtras();

        
url_insert_ads data.getString"url" );

        
id data.getStringArray("cat_id");
        
name data.getStringArray("cat_name");

        
ArrayList<Stringcats = new ArrayList<>();

        for (
int i 0id.length i++)
        {
            
cats.addname[i] );
        }

        
ArrayAdapter<Stringadb = new ArrayAdapter<String>(
            
this android.R.layout.simple_list_item_1 cats
        
);

        
lv_cat = (ListViewfindViewByIdR.id.insert_ads_cat_list );

        
lv_cat.setAdapter(adb);

        
lv_cat.setOnItemClickListener(
                new 
AdapterView.OnItemClickListener() {
                    @
Override
                    
public void onItemClick(AdapterView<?> parent, View view, int position, long _id) {
                        selected_cat_info[0] = id[position];
                        selected_cat_info[1] = name[position];

                        selected_cat.setText(name[position]);
                    }
                }
        );

    }

    private int my_requestCode_gallery = 2;

    public void onBtnGalleryClick( View v )
    {
        Intent i = new Intent( Intent.ACTION_PICK ,
            MediaStore.Images.Media.EXTERNAL_CONTENT_URI
        );

        startActivityForResult( i , my_requestCode_gallery );
    }

    private int my_requestCode = 1;
    private Bitmap my_bitmap;
    private String my_final_image;

    public void onBtnCameraClick( View v )
    {
        if( getPackageManager().hasSystemFeature( PackageManager.FEATURE_CAMERA_ANY ) )
        {
            Intent i = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

            startActivityForResult(i, my_requestCode);
        }
        else
        {
            Toast.makeText( getApplicationContext() ,
                    getString( R.string.no_camera_error ) ,
                    Toast.LENGTH_LONG ).show();
        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data)
    {
        if( requestCode == my_requestCode && resultCode == RESULT_OK )
        {
            Bundle e = data.getExtras();

            my_bitmap = (Bitmap) e.get( "data" );

            show_captured_image();
        }
        else if( requestCode == my_requestCode_gallery && resultCode == RESULT_OK )
        {
            Uri image = data.getData();

            show_internal_image( image );
        }
        else
        {
            Toast.makeText( getApplicationContext() ,
                    getString( R.string.get_image_error ) ,
                    Toast.LENGTH_LONG ).show();
        }
    }

    public void show_captured_image()
    {
        try
        {
            AlertDialog.Builder imageLoader = new AlertDialog.Builder(this);

            LayoutInflater inflater = (LayoutInflater)
                    this.getSystemService(LAYOUT_INFLATER_SERVICE);

            View layout = inflater.inflate(R.layout.full_screen_image,
                    (ViewGroup) findViewById(R.id.full_img_layout_root));

            ImageView bigImage = (ImageView) layout.findViewById(R.id.full_img_img);

            bigImage.setImageBitmap(my_bitmap);

            TextView imgTitle = (TextView) layout.findViewById(R.id.full_img_title);

            imgTitle.setText(R.string.captured_img_title);

            imageLoader.setView(layout);

            imageLoader.setCancelable(false);

            imageLoader.setPositiveButton(R.string.captured_img_btn_ok,
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which)
                    {
                        selected_img.setImageBitmap( my_bitmap );

                        selected_img_txt.setText( R.string.captured_img_is_true );

                        dialog.dismiss();
                    }
                }
            );

            imageLoader.setNegativeButton(R.string.captured_img_btn_again,
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.dismiss();

                            onBtnCameraClick(null);
                        }
                    }
            );

            imageLoader.setNeutralButton(R.string.btn_Back_to_home,
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                }
            );

            imageLoader.create();

            imageLoader.show();
        }
        catch ( Exception e )
        {
            /*
             * Log.i( "MatiMessage" , "error 1 -> " + e.toString() );
             */
        }
    }

    public void show_internal_image( final Uri imageUri )
    {
        try
        {
            AlertDialog.Builder imageLoader = new AlertDialog.Builder(this);

            LayoutInflater inflater = (LayoutInflater)
                    this.getSystemService(LAYOUT_INFLATER_SERVICE);

            View layout = inflater.inflate(R.layout.full_screen_image,
                    (ViewGroup) findViewById(R.id.full_img_layout_root));

            ImageView bigImage = (ImageView) layout.findViewById(R.id.full_img_img);

            bigImage.setImageURI(imageUri);

            TextView imgTitle = (TextView) layout.findViewById(R.id.full_img_title);

            imgTitle.setText(R.string.captured_img_title);

            imageLoader.setView(layout);

            imageLoader.setCancelable(false);

            imageLoader.setPositiveButton(R.string.captured_img_btn_ok,
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which)
                        {
                            selected_img.setImageURI(imageUri);

                            selected_img_txt.setText( R.string.captured_img_is_true );

                            dialog.dismiss();
                        }
                    }
            );

            imageLoader.setNegativeButton(R.string.captured_img_btn_again,
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.dismiss();

                            onBtnGalleryClick(null);
                        }
                    }
            );

            imageLoader.setNeutralButton(R.string.btn_Back_to_home,
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.dismiss();
                        }
                    }
            );

            imageLoader.create();

            imageLoader.show();
        }
        catch ( Exception e )
        {
            /*
             * Log.i( "MatiMessage" , "error 1 -> " + e.toString() );
             */
        }
    }

    public void onBtnInsertAdsClick( View v )
    {
        if( title.getText().length() > 1 )
        {
            if( intro.getText().length() > 1 )
            {
                if( desc.getText().length() > 1 )
                {
                    if( seller.getText().length() > 1 )
                    {
                        if( email.getText().length() > 1 )
                        {
                            if( phone.getText().length() > 1 )
                            {
                                if( selected_cat.getText() != getString( R.string.insert_ads_form_sel_cat_text ) )
                                {
                                    if( selected_img_txt.getText() != getString( R.string.insert_ads_form_sel_cat_text ) )
                                    {
                                        Bitmap image = ( (BitmapDrawable) selected_img.getDrawable() ).getBitmap();

                                        HashMap<String , String> my_data = new HashMap<>();
                                        my_data.put( "title" , title.getText().toString() );
                                        my_data.put( "intro" , intro.getText().toString() );
                                        my_data.put( "desc" , desc.getText().toString() );
                                        my_data.put("seller", seller.getText().toString());
                                        my_data.put("email", email.getText().toString());
                                        my_data.put("phone", phone.getText().toString());
                                        my_data.put("cat", selected_cat_info[0]);

                                        UploadImage upload = new UploadImage( my_data , image , this );

                                        upload.execute();
                                    }
                                    else
                                    {
                                        Toast.makeText( getApplicationContext() ,
                                                getString( R.string.insert_ads_form_error_sel_img ) ,
                                                Toast.LENGTH_LONG ).show();
                                    }
                                }
                                else
                                {
                                    Toast.makeText( getApplicationContext() ,
                                            getString( R.string.insert_ads_form_error_sel_cat ) ,
                                            Toast.LENGTH_LONG ).show();
                                }
                            }
                            else
                            {
                                phone.setHint(R.string.insert_ads_form_error_hint);
                            }
                        }
                        else
                        {
                            email.setHint( R.string.insert_ads_form_error_hint );
                        }
                    }
                    else
                    {
                        seller.setHint( R.string.insert_ads_form_error_hint );
                    }
                }
                else
                {
                    desc.setHint( R.string.insert_ads_form_error_hint );
                }
            }
            else
            {
                intro.setHint( R.string.insert_ads_form_error_hint );
            }
        }
        else
        {
            title.setHint( R.string.insert_ads_form_error_hint );
        }
    }

    private class UploadImage extends AsyncTask<Void , Void , Boolean>
    {
        private Context main_con;
        private HashMap<String , String> main_hm;
        private Bitmap main_image;

        public UploadImage( HashMap<String , String> hm , Bitmap image , Context con )
        {
            main_hm = hm;
            main_image = image;
            main_con = con;
        }

        @Override
        protected Boolean doInBackground(Void... params)
        {
            ByteArrayOutputStream outStream = new ByteArrayOutputStream();

            main_image.compress( Bitmap.CompressFormat.JPEG , 100 , outStream );

            String encodedImage = Base64.encodeToString(
                outStream.toByteArray() , Base64.DEFAULT
            );

            ArrayList<NameValuePair> dataToSend = new ArrayList<>();

            dataToSend.add( new BasicNameValuePair("title" , main_hm.get("title") ) );
            dataToSend.add( new BasicNameValuePair("intro" , main_hm.get("intro") ) );
            dataToSend.add( new BasicNameValuePair("desc" , main_hm.get("desc") ) );
            dataToSend.add( new BasicNameValuePair("seller" , main_hm.get("seller") ) );
            dataToSend.add( new BasicNameValuePair("email" , main_hm.get("email") ) );
            dataToSend.add( new BasicNameValuePair("phone" , main_hm.get("phone") ) );
            dataToSend.add( new BasicNameValuePair("cat" , main_hm.get("cat") ) );
            dataToSend.add(new BasicNameValuePair("image", encodedImage));

            HttpParams myHttpParams = new BasicHttpParams();

            HttpConnectionParams.setConnectionTimeout(myHttpParams, 1000 * 30);

            HttpConnectionParams.setSoTimeout(myHttpParams, 1000 * 30);

            HttpClient client = new DefaultHttpClient( myHttpParams );

            HttpPost post = new HttpPost( url_insert_ads );

            try {

                post.setEntity( new UrlEncodedFormEntity( dataToSend ));

                client.execute( post );

                return true;

            } catch ( Exception e ) {
                /*
                 * Log.i( "MatiMessage" , "error in posting data -> " + e.toString() );
                 */
                return false;
            }
        }

        @Override
        protected void onPostExecute(Boolean result)
        {
            String message = "";

            if( result == true )
            {
                message = getString( R.string.result_of_insert_message_success );
            }
            else
            {
                message = getString( R.string.result_of_insert_message_failure );
            }

            AlertDialog.Builder alert = new AlertDialog.Builder( main_con );
            alert.setCancelable(false);
            alert.setTitle(R.string.result_of_insert_title);
            alert.setMessage(message);
            alert.setPositiveButton(R.string.btn_Back_to_home,
                    new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            dialog.dismiss();
                        }
                    }
            );
            alert.create();
            alert.show();
        }
    }

    public void onBtnBackClick( View v )
    {
        finish();
    }

این ارور ها رو نشون میده!!!
ایمپورت نشده بعضیاش
نظرتون واسه رفعش چیه؟؟؟
[عکس: Untitled_1_copy.jpg]
  پاسخ
تشکر شده توسط :
#2
DefaultHttpClient در api 23 به بعد منسوخ شدن
باید از HttpUrlConnection استفاده کنی

یا

http://stackoverflow.com/questions/31433...-not-exist
http://stackoverflow.com/questions/32153...oid-studio
وبلاگ: Yousha.Blog.ir


 کد کمتر => خطای کمتر => قابل فهمتر => خوانایی بالاتر => نگهداری بهتر

  پاسخ
تشکر شده توسط :
#3
خب پس یه لطفی میکنی بهم بگی این کد ها معادلشون چی میشه؟
NameValuePair

BasicNameValuePair

BasicHttpParams

HttpClient

DefaultHttpClient

HttpPost

HttpPost

setEntity

UrlEncodedFormEntity

execute

اینا قرمز شدن و ارور دادن.ممنون
  پاسخ
تشکر شده توسط :
#4
همچین چیزی میشه کدت:
کد پی‌اچ‌پی:
final URLConnection myURLcon = new URL("http://google.com/").openConnection();
final 
String _parameters String.format("q=%s"URLEncoder.encode("what is android""UTF-8"));
myURLcon.setRequestProperty("Cache-Control:""no-cache");
myURLcon.setRequestProperty("Accept""text/html,application/xhtml+xml,application/xml;q=0.9,*/*");
myURLcon.setRequestProperty("Origin""http://google.com");
myURLcon.setRequestProperty("Upgrade-Insecure-Requests""1");
myURLcon.setRequestProperty("User-Agent""Mozilla/5.0 ( compatible ) "); // Fixes FileNotFoundException in some cases.
myURLcon.setRequestProperty("Content-Type""application/x-www-form-urlencoded;charset=UTF-8");
myURLcon.setRequestProperty("Referer""");
myURLcon.setRequestProperty("Accept-Encoding""gzip, deflate, lzma");
myURLcon.setRequestProperty("Accept-Language""en-US,en;");
myURLcon.setRequestProperty("Accept-Charset""UTF-8"); // Parameters encoding.
myURLcon.setConnectTimeout(60);
myURLcon.setReadTimeout(60);
myURLcon.setUseCaches(false);
myURLcon.setDoInput(true); // false = Ignores response body, and disallows use of getResponseCode().
myURLcon.setDoOutput(true); // true = POST/Put, and allows use of getOutputStream().
myURLcon.getOutputStream().write(_parameters.getBytes("UTF-8")); // Put/POST.
myURLcon.getInputStream().close(); 


ببین با اضافه کردن خط زیر در فایل build.gradle مشکل apache http ت حل میشه:
کد:
android {
    useLibrary 'org.apache.http.legacy'
}
وبلاگ: Yousha.Blog.ir


 کد کمتر => خطای کمتر => قابل فهمتر => خوانایی بالاتر => نگهداری بهتر

  پاسخ
تشکر شده توسط :
#5
داداش اون کدی که دادی من بهت داده بودم؟؟؟
چون هیچیش شبیه اون نبود!!!!
این عکس رو ببین؟
[عکس: Untitled_1_copy.jpg]
[عکس: Untitled_2_copy.jpg]
[عکس: Untitled_3_copy.jpg]
  پاسخ
تشکر شده توسط :
#6
اوستاهای جاوا و اندروید کمک
  پاسخ
تشکر شده توسط :
#7
این مشکل مربوط به جاوا یا اندروید نیست، مال IDE اندروید استودیوهه...
اینجا بپرس
http://answers.uncox.com/android/questions
وبلاگ: Yousha.Blog.ir


 کد کمتر => خطای کمتر => قابل فهمتر => خوانایی بالاتر => نگهداری بهتر

  پاسخ
تشکر شده توسط :
#8
اونجا کسی جواب آدمو نمیده!!
  پاسخ
تشکر شده توسط :
#9
من مشکلای قبلی رو حذف کردم-وقتی برا تست میفرستم امولاتور ارورای زیر رو میده.مشکل از کجاست؟
کد:
Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug]
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2411Library
:app:prepareComAndroidSupportAppcompatV72411Library
:app:prepareComAndroidSupportSupportV42411Library
:app:prepareComAndroidSupportSupportVectorDrawable2411Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:mockableAndroidJar UP-TO-DATE
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:mergeDebugAndroidTestShaders
:app:compileDebugAndroidTestShaders
:app:generateDebugAndroidTestAssets
:app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:buildInfoDebugLoader
:app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithJavaResourcesVerifierForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug
:app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug UP-TO-DATE
:app:transformClassesWithInstantRunForDebug
:app:transformClasses_enhancedWithInstant+reloadDexForDebug UP-TO-DATE
:app:incrementalDebugTasks
:app:prePackageMarkerForDebug
:app:fastDeployDebugExtractor
:app:generateDebugInstantRunAppInfo
:app:coldswapKickerDebug
:app:transformClassesWithInstantRunSlicerForDebug
:app:transformClassesWithDexForDebug
To run dex in process, the Gradle daemon needs a larger heap.
It currently has approximately 910 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB.
To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html
Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
Error:    at java.lang.ClassLoader.defineClass1(Native Method)
Error:    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
Error:    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
Error:    at java.lang.ClassLoader.defineClass1(Native Method)
Error:    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
Error:    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
Error:    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
Error:    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
Error:    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
Error:    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
Error:    at java.lang.ClassLoader.defineClass1(Native Method)
Error:    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
Error:    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
Error:    at java.security.AccessController.doPrivileged(Native Method)
Error:    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
Error:    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
Error:    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0
Error:    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
Error:    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
Error:    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
Error:    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Error:    at java.lang.ClassLoader.defineClass1(Native Method)
Error:    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
Error:    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
Error:    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Error:    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
Error:Exception in thread "main"
Error:    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
Error:    at java.security.AccessController.doPrivileged(Native Method)
Error:    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
Error:    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
Error:    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
Error:    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
Error:    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
Error:    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
Error:    at java.security.AccessController.doPrivileged(Native Method)
Error:    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
Error:    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
Error:    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
Error:    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Error:    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
Error:    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
:app:transformClassesWithDexForDebug FAILED
Error:    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
Error:Exception in thread "main"
Error:    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
Error:    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
Error:    at java.security.AccessController.doPrivileged(Native Method)
Error:    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Error:    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
Error:    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
Error:    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
Error:    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Error:    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Error:Exception in thread "main"
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_51\bin\java.exe'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 17.689 secs
Error:    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Error:Exception in thread "main"
Information:61 errors
Information:0 warnings
Information:See complete output in console
  پاسخ
تشکر شده توسط :
#10
http://stackoverflow.com/questions/35937...oid-studio
وبلاگ: Yousha.Blog.ir


 کد کمتر => خطای کمتر => قابل فهمتر => خوانایی بالاتر => نگهداری بهتر

  پاسخ
تشکر شده توسط :


پرش به انجمن:


کاربران در حال بازدید این موضوع: 1 مهمان