Форум программистов, компьютерный форум, киберфорум
Программирование Android
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.54/13: Рейтинг темы: голосов - 13, средняя оценка - 4.54
0 / 0 / 0
Регистрация: 20.01.2016
Сообщений: 5

Android Studio не хочет видеть некоторые файлы в SDK

08.06.2017, 17:21. Показов 2803. Ответов 6
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Всем привет!
Понадобилось мне работать с web services в AndroidStudio (далее AS).
Нашел исходники нужной библиотеки javax.xml.ws
Положил эти исходники в скачанный android-sdk (25 версия)

И вот что получается:
Java
1
2
import javax.xml.namespace.QName;
import javax.xml.ws.Service
файл javax.xml.namespace.QName - AS видит (т.е. GOTO->Declaration - находится нужный файл)

а
javax.xml.ws.Service AS упорно не хочет видеть...
Как заставить AS увидеть добавленные в SDK мной файлы?

И ещё вопрос.
Если я добавлю jar библиотеку в %JAVA_HOME%\lib - она будет доступна для AS?
Спасибо!
Юрий
0
IT_Exp
Эксперт
34794 / 4073 / 2104
Регистрация: 17.06.2006
Сообщений: 32,602
Блог
08.06.2017, 17:21
Ответы с готовыми решениями:

Объясните ошибку - код не хочет видеть некоторые функции
Для решения задачи нужно было создать код. Я его создала, но вот проблема он не хочет видеть некоторые функции (En, Enm, Enmx, Enx,...

Sdk в настойках Android Studio и sdk в Project Structure
То есть получается что путь к sdk которое использует Android Studio прописывается в Settings Android Studio а что тогда за путь...

Не предлагается установка Android SDK при установке Android Studio
на сайте https://developer.android.com/studio/... скачал exeшник для установки Android Studio. Скачал, запустил и в Android Studio...

6
2884 / 2296 / 769
Регистрация: 12.05.2014
Сообщений: 7,978
08.06.2017, 17:26
в build.gradle надо добавить
Java
1
compile 'javax.xml.ws:jaxws-api:2.2.11'
и все видит, но я работу не проверял
0
0 / 0 / 0
Регистрация: 20.01.2016
Сообщений: 5
08.06.2017, 17:37  [ТС]
2 Pablito

я складывал нужные библиотеки в папку libs проекта.
build проходил успешно.

Но при сборке apk - вываливалось куча ошибок на добавленные библиотеки.
Поэтому я решил попробовать вариант с исходниками, которые добавил в SDK, в надежде что AS их обнаружит и подцепит...
0
2884 / 2296 / 769
Регистрация: 12.05.2014
Сообщений: 7,978
08.06.2017, 17:43
к чему этот весь текст?
я написал как подключить библиотеку, так проще, а главное - это работает
0
0 / 0 / 0
Регистрация: 20.01.2016
Сообщений: 5
09.06.2017, 09:23  [ТС]
Build получается
Кликните здесь для просмотра всего текста

Executing tasks: [clean, :app:generateDebugSources, :app:mockableAndroidJar, :apprepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugUnitTestSources, :app:compileDebugAndroidTestSources]

Configuration on demand is an incubating feature.
******
:appreDebugAndroidTestBuild UP-TO-DATE
:apprepareComAndroidSupportTestEspress oEspressoCore222Library
:apprepareComAndroidSupportTestEspress oEspressoIdlingResource222Library
:apprepareComAndroidSupportTestExposed InstrumentationApiPublish05Library
:apprepareComAndroidSupportTestRules05 Library
:apprepareComAndroidSupportTestRunner0 5Library
:apprepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:approcessDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:generateDebugAndroidTestResValues
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:approcessDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:incrementalDebugJavaCompilationSafe guard
:app:javaPreCompileDebug
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:incrementalDebugUnitTestJavaCompila tionSafeguard UP-TO-DATE
:app:javaPreCompileDebugUnitTest
:app:compileDebugUnitTestJavaWithJavac
:approcessDebugJavaRes UP-TO-DATE
:approcessDebugUnitTestJavaRes UP-TO-DATE
:app:compileDebugUnitTestSources
:app:incrementalDebugAndroidTestJavaComp ilationSafeguard
:app:javaPreCompileDebugAndroidTest
:app:compileDebugAndroidTestJavaWithJava c
:app:compileDebugAndroidTestNdk UP-TO-DATE
:app:compileDebugAndroidTestSources

BUILD SUCCESSFUL

Total time: 5.109 secs


А вот build apk - не проходит...

Кликните здесь для просмотра всего текста

Executing tasks: [:app:assembleDebug]

Configuration on demand is an incubating feature.
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to ********
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

*****
:app:transformClassesWithDexForDebug
AGPBI: {"kind":"error","text":"trouble processing "javax/xml/bind/Binder.class":","sources":[{}]}
AGPBI: {"kind":"error","text":"Ill-advised or mistaken usage of a core class (java.* or javax.*)","sources":[{}]}
AGPBI: {"kind":"error","text":"when not building a core library.","sources":[{}]}
AGPBI: {"kind":"error","text":"This is often due to inadvertently including a core library file","sources":[{}]}
AGPBI: {"kind":"error","text":"in your application\u0027s project, when using an IDE (such as","sources":[{}]}
AGPBI: {"kind":"error","text":"Eclipse). If you are sure you\u0027re not intentionally defining a","sources":[{}]}
AGPBI: {"kind":"error","text":"core class, then this is the most likely explanation of what\u0027s","sources":[{}]}
AGPBI: {"kind":"error","text":"going on.","sources":[{}]}
AGPBI: {"kind":"error","text":"However, you might actually be trying to define a class in a core","sources":[{}]}
AGPBI: {"kind":"error","text":"namespace, the source of which you may have taken, for example,","sources":[{}]}
AGPBI: {"kind":"error","text":"from a non-Android virtual machine project. This will most","sources":[{}]}
AGPBI: {"kind":"error","text":"assuredly not work. At a minimum, it jeopardizes the","sources":[{}]}
AGPBI: {"kind":"error","text":"compatibility of your app with future versions of the platform.","sources":[{}]}
AGPBI: {"kind":"error","text":"It is also often of questionable legality.","sources":[{}]}
AGPBI: {"kind":"error","text":"If you really intend to build a core library -- which is only","sources":[{}]}
AGPBI: {"kind":"error","text":"appropriate as part of creating a full virtual machine","sources":[{}]}
AGPBI: {"kind":"error","text":"distribution, as opposed to compiling an application -- then use","sources":[{}]}
AGPBI: {"kind":"error","text":"the "--core-library" option to suppress this error message.","sources":[{}]}
AGPBI: {"kind":"error","text":"If you go ahead and use "--core-library" but are in fact","sources":[{}]}
AGPBI: {"kind":"error","text":"building an application, then be forewarned that your application","sources":[{}]}
AGPBI: {"kind":"error","text":"will still fail to build or run, at some point. Please be","sources":[{}]}
AGPBI: {"kind":"error","text":"prepared for angry customers who find, for example, that your","sources":[{}]}
AGPBI: {"kind":"error","text":"application ceases to function once they upgrade their operating","sources":[{}]}
AGPBI: {"kind":"error","text":"system. You will be to blame for this problem.","sources":[{}]}
AGPBI: {"kind":"error","text":"If you are legitimately using some code that happens to be in a","sources":[{}]}
AGPBI: {"kind":"error","text":"core package, then the easiest safe alternative you have is to","sources":[{}]}
AGPBI: {"kind":"error","text":"repackage that code. That is, move the classes in question into","sources":[{}]}
AGPBI: {"kind":"error","text":"your own package namespace. This means that they will never be in","sources":[{}]}
AGPBI: {"kind":"error","text":"conflict with core system classes. JarJar is a tool that may help","sources":[{}]}
AGPBI: {"kind":"error","text":"you in this endeavor. If you find that you cannot do this, then","sources":[{}]}
AGPBI: {"kind":"error","text":"that is an indication that the path you are on will ultimately","sources":[{}]}
AGPBI: {"kind":"error","text":"lead to pain, suffering, grief, and lamentation.","sources":[{}]}
AGPBI: {"kind":"error","text":"1 error; aborting","sources":[{}]}

FAILED

AGPBI: {"kind":"error","text":"trouble processing "javax/xml/ws/Action.class":","sources":[{}]}
AGPBI: {"kind":"error","text":"Ill-advised or mistaken usage of a core class (java.* or javax.*)","sources":[{}]}
AGPBI: {"kind":"error","text":"when not building a core library.","sources":[{}]}
AGPBI: {"kind":"error","text":"This is often due to inadvertently including a core library file","sources":[{}]}
AGPBI: {"kind":"error","text":"in your application\u0027s project, when using an IDE (such as","sources":[{}]}
AGPBI: {"kind":"error","text":"Eclipse). If you are sure you\u0027re not intentionally defining a","sources":[{}]}
AGPBI: {"kind":"error","text":"core class, then this is the most likely explanation of what\u0027s","sources":[{}]}
AGPBI: {"kind":"error","text":"going on.","sources":[{}]}
AGPBI: {"kind":"error","text":"However, you might actually be trying to define a class in a core","sources":[{}]}
AGPBI: {"kind":"error","text":"namespace, the source of which you may have taken, for example,","sources":[{}]}
AGPBI: {"kind":"error","text":"from a non-Android virtual machine project. This will most","sources":[{}]}
AGPBI: {"kind":"error","text":"assuredly not work. At a minimum, it jeopardizes the","sources":[{}]}
AGPBI: {"kind":"error","text":"compatibility of your app with future versions of the platform.","sources":[{}]}
AGPBI: {"kind":"error","text":"It is also often of questionable legality.","sources":[{}]}
AGPBI: {"kind":"error","text":"If you really intend to build a core library -- which is only","sources":[{}]}
AGPBI: {"kind":"error","text":"appropriate as part of creating a full virtual machine","sources":[{}]}
AGPBI: {"kind":"error","text":"distribution, as opposed to compiling an application -- then use","sources":[{}]}
AGPBI: {"kind":"error","text":"the "--core-library" option to suppress this error message.","sources":[{}]}
AGPBI: {"kind":"error","text":"If you go ahead and use "--core-library" but are in fact","sources":[{}]}
AGPBI: {"kind":"error","text":"building an application, then be forewarned that your application","sources":[{}]}
AGPBI: {"kind":"error","text":"will still fail to build or run, at some point. Please be","sources":[{}]}
AGPBI: {"kind":"error","text":"prepared for angry customers who find, for example, that your","sources":[{}]}
AGPBI: {"kind":"error","text":"application ceases to function once they upgrade their operating","sources":[{}]}
AGPBI: {"kind":"error","text":"system. You will be to blame for this problem.","sources":[{}]}
AGPBI: {"kind":"error","text":"If you are legitimately using some code that happens to be in a","sources":[{}]}
AGPBI: {"kind":"error","text":"core package, then the easiest safe alternative you have is to","sources":[{}]}
AGPBI: {"kind":"error","text":"repackage that code. That is, move the classes in question into","sources":[{}]}
AGPBI: {"kind":"error","text":"your own package namespace. This means that they will never be in","sources":[{}]}
AGPBI: {"kind":"error","text":"conflict with core system classes. JarJar is a tool that may help","sources":[{}]}
AGPBI: {"kind":"error","text":"you in this endeavor. If you find that you cannot do this, then","sources":[{}]}
AGPBI: {"kind":"error","text":"that is an indication that the path you are on will ultimately","sources":[{}]}
AGPBI: {"kind":"error","text":"lead to pain, suffering, grief, and lamentation.","sources":[{}]}
AGPBI: {"kind":"error","text":"1 error; aborting","sources":[{}]}

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.Transfor mException: java.lang.RuntimeException: com.android.ide.common.process.ProcessEx ception: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessEx ception: Return code 1 for dex process

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.316 secs


Кликните здесь для просмотра всего текста

Information:Gradle tasks [:app:assembleDebug]
Error:trouble processing "javax/xml/bind/Binder.class":
Error:Ill-advised or mistaken usage of a core class (java.* or javax.*)
Error:when not building a core library.
Error:This is often due to inadvertently including a core library file
Error:in your application's project, when using an IDE (such as
Error:Eclipse). If you are sure you're not intentionally defining a
Error:core class, then this is the most likely explanation of what's
Error:going on.
Error:However, you might actually be trying to define a class in a core
Error:namespace, the source of which you may have taken, for example,
Error:from a non-Android virtual machine project. This will most
Error:assuredly not work. At a minimum, it jeopardizes the
Error:compatibility of your app with future versions of the platform.
Error:It is also often of questionable legality.
Error:If you really intend to build a core library -- which is only
Error:appropriate as part of creating a full virtual machine
Error:distribution, as opposed to compiling an application -- then use
Error:the "--core-library" option to suppress this error message.
Error:If you go ahead and use "--core-library" but are in fact
Error:building an application, then be forewarned that your application
Error:will still fail to build or run, at some point. Please be
Errorrepared for angry customers who find, for example, that your
Error:application ceases to function once they upgrade their operating
Error:system. You will be to blame for this problem.
Error:If you are legitimately using some code that happens to be in a
Error:core package, then the easiest safe alternative you have is to
Error:repackage that code. That is, move the classes in question into
Error:your own package namespace. This means that they will never be in
Error:conflict with core system classes. JarJar is a tool that may help
Error:you in this endeavor. If you find that you cannot do this, then
Error:that is an indication that the path you are on will ultimately
Error:lead to pain, suffering, grief, and lamentation.
Error:1 error; aborting
Error:trouble processing "javax/xml/ws/Action.class":
Error:Ill-advised or mistaken usage of a core class (java.* or javax.*)
Error:when not building a core library.
Error:This is often due to inadvertently including a core library file
Error:in your application's project, when using an IDE (such as
Error:Eclipse). If you are sure you're not intentionally defining a
Error:core class, then this is the most likely explanation of what's
Error:going on.
Error:However, you might actually be trying to define a class in a core
Error:namespace, the source of which you may have taken, for example,
Error:from a non-Android virtual machine project. This will most
Error:assuredly not work. At a minimum, it jeopardizes the
Error:compatibility of your app with future versions of the platform.
Error:It is also often of questionable legality.
Error:If you really intend to build a core library -- which is only
Error:appropriate as part of creating a full virtual machine
Error:distribution, as opposed to compiling an application -- then use
Error:the "--core-library" option to suppress this error message.
Error:If you go ahead and use "--core-library" but are in fact
Error:building an application, then be forewarned that your application
Error:will still fail to build or run, at some point. Please be
Errorrepared for angry customers who find, for example, that your
Error:application ceases to function once they upgrade their operating
Error:system. You will be to blame for this problem.
Error:If you are legitimately using some code that happens to be in a
Error:core package, then the easiest safe alternative you have is to
Error:repackage that code. That is, move the classes in question into
Error:your own package namespace. This means that they will never be in
Error:conflict with core system classes. JarJar is a tool that may help
Error:you in this endeavor. If you find that you cannot do this, then
Error:that is an indication that the path you are on will ultimately
Error:lead to pain, suffering, grief, and lamentation.
Error:1 error; aborting
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.Transfor mException: java.lang.RuntimeException: com.android.ide.common.process.ProcessEx ception: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessEx ception: Return code 1 for dex process
Information:BUILD FAILED
Information:Total time: 1.316 secs
Information:67 errors
Information:0 warnings
Information:See complete output in console
0
2884 / 2296 / 769
Регистрация: 12.05.2014
Сообщений: 7,978
09.06.2017, 19:10
какой минимальный код надо написать что бы перестало билдиться?
и что там в build.gradle понаписано? вдруг там остались попытки импорта библиотеки
0
0 / 0 / 0
Регистрация: 20.01.2016
Сообщений: 5
09.06.2017, 23:32  [ТС]
вот build.gradle
Кликните здесь для просмотра всего текста

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.yzolotykh.myapplication "
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUni tRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(include: '*.jar', dir: 'libs')
androidTestCompile('com.android.support. test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support.constraint:constrai nt-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile files('libs/jaxws-api-2.2.1.jar')
}


вот код, по которому делается APK. При этом строчку compile files('libs/jaxws-api-2.2.1.jar') и саму библиотеку пришлось удалить из проекта...
Кликните здесь для просмотра всего текста

Java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.example.yzolotykh.myapplication;
 
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
//import java.net.*;
//import java.util.*;
//import java.io.*;
import java.net.Authenticator;
//import javax.xml.namespace.QName;
//import schemas.dynamics.microsoft.nav.system.*;
 
public class MainActivity extends Activity {
    public static String myLogs="comWS";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Authenticator.setDefault(new MyAuthenticator());
        /*
        try {
            String baseURL = "http://192.168.123.176:7147/CU6WMS/WS/";
 
            URL systemServiceURL = new URL(baseURL + "SystemService");
            QName systemServiceQName = new QName("urn:microsoft-dynamics-schemas/nav/system/", "SystemService");
            SystemService systemService = new SystemService(systemServiceURL, systemServiceQName);
            SystemServicePort systemPort = systemService.getSystemServicePort();
            List<String> companies = systemPort.companies();
            Log.d(myLogs, "Companies:");
            for (String company : companies) {
                Log.d(myLogs, " "+ company);
            }
        } catch(MalformedURLException e) {
        }
        */
        Log.d(myLogs, "end");
    }
}
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
BasicMan
Эксперт
29316 / 5623 / 2384
Регистрация: 17.02.2009
Сообщений: 30,364
Блог
09.06.2017, 23:32
Помогаю со студенческими работами здесь

Android studio перестал видеть телефон
Тестировал приложение на телефоне, вроде ничего не менял и в один ужасный день, студия перестала видеть телефон. Подключил другой телефон...

Версия SDK в Android Studio
Всем привет, возник такой вопрос, как изменить минимальную версию SDK проекта в Android Studio? Кто знает помогите с решением или...

Комп не хочет копировать некоторые файлы
Здравствуйте уважаемые профессионалы. Нужна ваша помощ. Установил я винду 8. Всё летает, всё хорошо, но почему то некоторые файлы не хочет...

Android Studio не может найти SDK
не могу понять почему он не может его найти

Android Studio 32 bit - загрузка SDK
Уже всякие форумы обшарил, не могу понять, как исправить это. Скачал архив программы с сайта http://developer.android.com/. Так как сам...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
7
Ответ Создать тему
Новые блоги и статьи
Подключение Box2D v3 к SDL3 для Android: физика и отрисовка коллайдеров
8Observer8 29.01.2026
Содержание блога Box2D - это библиотека для 2D физики для анимаций и игр. С её помощью можно определять были ли коллизии между конкретными объектами. Версия v3 была полностью переписана на Си, в. . .
Инструменты COM: Сохранение данный из VARIANT в файл и загрузка из файла в VARIANT
bedvit 28.01.2026
Сохранение базовых типов COM и массивов (одномерных или двухмерных) любой вложенности (деревья) в файл, с возможностью выбора алгоритмов сжатия и шифрования. Часть библиотеки BedvitCOM Использованы. . .
Загрузка PNG с альфа-каналом на SDL3 для Android: с помощью SDL_LoadPNG (без SDL3_image)
8Observer8 28.01.2026
Содержание блога SDL3 имеет собственные средства для загрузки и отображения PNG-файлов с альфа-каналом и базовой работы с ними. В этой инструкции используется функция SDL_LoadPNG(), которая. . .
Загрузка PNG с альфа-каналом на SDL3 для Android: с помощью SDL3_image
8Observer8 27.01.2026
Содержание блога SDL3_image - это библиотека для загрузки и работы с изображениями. Эта пошаговая инструкция покажет, как загрузить и вывести на экран смартфона картинку с альфа-каналом, то есть с. . .
Влияние грибов на сукцессию
anaschu 26.01.2026
Бифуркационные изменения массы гриба происходят тогда, когда мы уменьшаем массу компоста в 10 раз, а скорость прироста биомассы уменьшаем в три раза. Скорость прироста биомассы может уменьшаться за. . .
Воспроизведение звукового файла с помощью SDL3_mixer при касании экрана Android
8Observer8 26.01.2026
Содержание блога SDL3_mixer - это библиотека я для воспроизведения аудио. В отличие от инструкции по добавлению текста код по проигрыванию звука уже содержится в шаблоне примера. Нужно только. . .
Установка Android SDK, NDK, JDK, CMake и т.д.
8Observer8 25.01.2026
Содержание блога Перейдите по ссылке: https:/ / developer. android. com/ studio и в самом низу страницы кликните по архиву "commandlinetools-win-xxxxxx_latest. zip" Извлеките архив и вы увидите. . .
Вывод текста со шрифтом TTF на Android с помощью библиотеки SDL3_ttf
8Observer8 25.01.2026
Содержание блога Если у вас не установлены Android SDK, NDK, JDK, и т. д. то сделайте это по следующей инструкции: Установка Android SDK, NDK, JDK, CMake и т. д. Сборка примера Скачайте. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru