I go to build > clean project, then build > build project, "react-native run-android" from root of react native project, metro terminal spins up, I click the green arrow 'run app' button on android studio, the app pops up loading on the emulator, then exits to emulator home screen, and this error is in the run tab log. Relatively new to react native, can't find anything that gives me a solution. Not sure what's happening or where to go from here. Any help is much appreciated
01/21 20:30:53: Launching 'app' on Nexus 5X API 29 x86.
$ adb shell am start -n "com.mysampleapp/com.mysampleapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Waiting for process to come online...
Connected to process 15533 on device 'emulator-5554'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
D/SoLoader: init start
adding system library source: /vendor/lib
D/SoLoader: adding system library source: /system/lib
D/SoLoader: adding application source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.mysampleapp-91pUgz3FulEOy0UDuAiTAw==/lib/x86 flags = 0]
D/SoLoader: adding backup source from : com.facebook.soloader.ApkSoSource[root = /data/data/com.mysampleapp/lib-main flags = 1]
Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/lib flags = 2]
D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /vendor/lib flags = 2]
Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/com.mysampleapp-91pUgz3FulEOy0UDuAiTAw==/lib/x86 flags = 0]
Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/com.mysampleapp/lib-main flags = 1]
V/fb-UnpackingSoSource: locked dso store /data/user/0/com.mysampleapp/lib-main
V/fb-UnpackingSoSource: deps mismatch on deps store: regenerating
so store dirty: regenerating
D/ApkSoSource: not allowing consideration of lib/x86/libc++_shared.so: deferring to libdir
D/ApkSoSource: not allowing consideration of lib/x86/libfb.so: deferring to libdir
not allowing consideration of lib/x86/libfolly_futures.so: deferring to libdir
not allowing consideration of lib/x86/libfolly_json.so: deferring to libdir
not allowing consideration of lib/x86/libglog.so: deferring to libdir
not allowing consideration of lib/x86/libglog_init.so: deferring to libdir
not allowing consideration of lib/x86/libhermes-executor-debug.so: deferring to libdir
not allowing consideration of lib/x86/libhermes-executor-release.so: deferring to libdir
not allowing consideration of lib/x86/libhermes-inspector.so: deferring to libdir
not allowing consideration of lib/x86/libimagepipeline.so: deferring to libdir
D/ApkSoSource: not allowing consideration of lib/x86/libjscexecutor.so: deferring to libdir
not allowing consideration of lib/x86/libjsijniprofiler.so: deferring to libdir
not allowing consideration of lib/x86/libjsinspector.so: deferring to libdir
not allowing consideration of lib/x86/libnative-filters.so: deferring to libdir
not allowing consideration of lib/x86/libnative-imagetranscoder.so: deferring to libdir
not allowing consideration of lib/x86/libreactnativeblob.so: deferring to libdir
not allowing consideration of lib/x86/libreactnativejni.so: deferring to libdir
not allowing consideration of lib/x86/libyoga.so: deferring to libdir
V/fb-UnpackingSoSource: regenerating DSO store com.facebook.soloader.ApkSoSource
Finished regenerating DSO store com.facebook.soloader.ApkSoSource
V/fb-UnpackingSoSource: starting syncer worker
V/fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.mysampleapp/lib-main (from syncer thread)
not releasing dso store lock for /data/user/0/com.mysampleapp/lib-main (syncer thread started)
D/SoLoader: init finish: 4 SO sources prepared
init exiting
W/RenderThread: type=1400 audit(0.0:62): avc: denied { write } for name="property_service" dev="tmpfs" ino=36 scontext=u:r:untrusted_app_27:s0:c133,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 app=com.mysampleapp
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
D/SoLoader: About to load: libjscexecutor.so
D/SoLoader: libjscexecutor.so not found on /data/data/com.mysampleapp/lib-main
libjscexecutor.so found on /data/app/com.mysampleapp-91pUgz3FulEOy0UDuAiTAw==/lib/x86
Not resolving dependencies for libjscexecutor.so
E/SoLoader: couldn't find DSO to load: libjscexecutor.so caused by: dlopen failed: library "libjsc.so" not found
D/ReactNative: ReactInstanceManager.ctor()
D/SoLoader: init exiting
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
W/com.mysampleap: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, reflection, allowed)
Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)
Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed)
D/ReactNative: ReactInstanceManager.createReactContextInBackground()
ReactInstanceManager.recreateReactContextInBackgroundInner()
W/com.mysampleap: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/com.mysampleap: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
W/unknown:ReactNative: Packager connection already open, nooping.
D/HostConnection: HostConnection::get() New Host Connection established 0xd1f22080, tid 15586
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xdd4e35c0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xdd4e35c0: ver 3 0 (tinfo 0xd1f68300)
W/Gralloc3: mapper 3.x is not supported
D/HostConnection: createUnique: call
HostConnection::get() New Host Connection established 0xd1f23660, tid 15586
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0
D/eglCodecCommon: allocate: Ask for block of size 0x1000
D/eglCodecCommon: allocate: ioctl allocate returned offset 0x3ffff4000 size 0x2000
D/EGL_emulation: eglMakeCurrent: 0xdd4e35c0: ver 3 0 (tinfo 0xd1f68300)
D/EGL_emulation: eglMakeCurrent: 0xdd4e35c0: ver 3 0 (tinfo 0xd1f68300)
D/EGL_emulation: eglMakeCurrent: 0xdd4e35c0: ver 3 0 (tinfo 0xd1f68300)
D/ReactNative: ReactInstanceManager.onJSBundleLoadedFromServer()
D/ReactNative: ReactInstanceManager.recreateReactContextInBackground()
ReactInstanceManager.runCreateReactContextOnNewThread()
D/SoLoader: About to load: libhermes.so
D/SoLoader: libhermes.so not found on /data/data/com.mysampleapp/lib-main
libhermes.so not found on /data/app/com.mysampleapp-91pUgz3FulEOy0UDuAiTAw==/lib/x86
libhermes.so not found on /vendor/lib
libhermes.so not found on /system/lib
E/SoLoader: couldn't find DSO to load: libhermes.so
E/AndroidRuntime: FATAL EXCEPTION: create_react_context
Process: com.mysampleapp, PID: 15533
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:27)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:952)
at java.lang.Thread.run(Thread.java:919)
I/Process: Sending signal. PID: 15533 SIG: 9
Process 15533 terminated.
And here is my build.gradle:
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js",
enableHermes: false
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.mysampleapp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation project(':react-native-gesture-handler')
implementation project(':react-native-vector-icons')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'androidx.annotation:annotation:1.1.0'
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
Related
I am trying to call asp.net web api from Android Client using Volley library. The .net API is working fine and listening ports are:
http://localhost:5000 and https://localhost:5001 in my local machine.
But,When, I try to run android client keeping the base url as http://10.0.2.2:5000/api/login
I found below error in console->
04/23 23:13:41: Launching 'app' on Nexus 6 API 24.
Install successfully finished in 9 s 435 ms.
$ adb shell am start -n "com.example.tourexpwip/com.example.tourexpwip.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 3662 on device 'Nexus_6_API_24 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/art: Late-enabling -Xcheck:jni
W/art: Unexpected CPU variant for X86 using defaults: x86
W/System: ClassLoader referenced unknown path: /data/app/com.example.tourexpwip-1/lib/x86
W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
I/System.out: URL: http://10.0.2.2:5000/api/login/
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/: HostConnection::get() New Host Connection established 0xa67ec7c0, tid 3662
E/Volley: [210] NetworkUtility.shouldRetryException: Unexpected response code 307 for http://10.0.2.2:5000/api/login/
D/: HostConnection::get() New Host Connection established 0xa67ecac0, tid 3683
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer: Swap behavior 0
D/EGL_emulation: eglCreateContext: 0xb5c05660: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xb5c05660: ver 2 0 (tinfo 0xb5c032b0)
W/System.err: com.android.volley.ServerError
at com.android.volley.toolbox.NetworkUtility.shouldRetryException(NetworkUtility.java:201)
W/System.err: at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:145)
at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:132)
W/System.err: at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:111)
at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90)
I/Choreographer: Skipped 68 frames! The application may be doing too much work on its main thread.
D/EGL_emulation: eglMakeCurrent: 0xb5c05660: ver 2 0 (tinfo 0xb5c032b0)
I/Choreographer: Skipped 35 frames! The application may be doing too much work on its main thread.
The controller class for login in ASP.NET web api->
namespace TourExpWIP1.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class LoginController : ControllerBase
{
NetCoreAuthenticationContext dbContext = new NetCoreAuthenticationContext();
public string Post([FromBody] TblUser value)
{
if (dbContext.TblUser.Any(user => user.UserName.Equals(value.UserName)))
{
TblUser user = dbContext.TblUser.Where(u => u.UserName.Equals(value.UserName)).First();
var client_post_hash_password = Convert.ToBase64String(
Common.SaltHashPassword(
Encoding.ASCII.GetBytes(value.Password),
Convert.FromBase64String(user.Salt)));
if (client_post_hash_password.Equals(user.Password))
return JsonConvert.SerializeObject(user);
else return JsonConvert.SerializeObject("Wrong Password");
}
else
{
return JsonConvert.SerializeObject("user does not exists in db");
}
}
}
}
Try this
1.In Android Manifiest, in tag application add:
inside tag application add this tag:
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
<application
android:usesCleartextTraffic="true"
android:networkSecurityConfig="#xml/network_security_config"
...
/>
2.With a corresponding network_security_config.xml in app/src/main/res/xml/:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
More details please find from here- Link
I'm using this sample code for Android from this page.
Just replaced the content of connstring from line 29 with "Hostname=<myHostname>.azureiotcentral.com;DeviceId=<myDevice>;SharedAccessKey=<myPrimaryKey>";
I'm using SAS Authentication.
The first error is when it tries to call client.open() (line 138).
It's giving me the following error each time when it's trying sending messages (line 122).
Connected to process 20170 on device '7.3_Foldable_API_30 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
No Network Security Config specified, using platform default
I/MultiDex: VM with version 2.1.0 has multidex support
Installing application
VM has multidex support, MultiDex support library is disabled.
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
I/TetheringManager: registerTetheringEventCallback:com.example.kttracking
W/System.err: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
D/HostConnection: HostConnection::get() New Host Connection established 0xf03da8e0, tid 20194
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
W/System.err: Exception while opening IoTHub connection: java.io.IOException: Could not open the connection
I/System.out: Shutting down...
I/System.out: Message Sent: "temperature":22.84, "humidity":48.31
W/System.err: Exception while sending event: java.lang.IllegalStateException: Cannot send event from an IoT Hub client that is closed.
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xf03f3ee0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xf03f3ee0: ver 3 0 (tinfo 0xf0738cf0) (first time)
I/Gralloc4: mapper 4.x is not supported
D/HostConnection: createUnique: call
HostConnection::get() New Host Connection established 0xf03f3af0, tid 20194
D/goldfish-address-space: allocate: Ask for block of size 0x100
allocate: ioctl allocate returned offset 0x3fc01c000 size 0x2000
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
I/System.out: Message Sent: "temperature":20.74, "humidity":31.12
W/System.err: Exception while sending event: java.lang.IllegalStateException: Cannot send event from an IoT Hub client that is closed.
I/System.out: Message Sent: "temperature":26.08, "humidity":43.27
W/System.err: Exception while sending event: java.lang.IllegalStateException: Cannot send event from an IoT Hub client that is closed.
What protocol are you using? Is that a MQTT? Also please check the version of the device client are you using.
Second thing that you can do is to try on a different device and see if the issue persists. at time certain devices do exhibit issues like this.
At the end I tried this library. It works.
I am switch from iOS to Android and try to download the image by URL, for this problem I find that a lot of developers prefer to use the Glide library, I am trying to download images but can't understand why I see the error image. Look please on my code and say what I am doing wrong?
This error happens with JPEG and PNG formats.
Glide version 4.12.0
Code:
val urlJpg = "http://developer.alexanderklimov.ru/android/images/android_cat.jpg"
lateinit var img: ImageView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
img = findViewById(R.id.imageView)
Glide.with(this) //1
.load(urlJpg)
.placeholder(R.drawable.ic_launcher_background)
.error(R.drawable.ic_launcher_foreground)
.into(img)
}
Log:
2021-04-01 11:49:04.750 18374-18374/? I/glideandpicass: Not late-enabling -Xcheck:jni (already on)
2021-04-01 11:49:04.828 18374-18374/? I/glideandpicass: Unquickening 12 vdex files!
2021-04-01 11:49:04.832 18374-18374/? W/glideandpicass: Unexpected CPU variant for X86 using defaults: x86
2021-04-01 11:49:05.517 18374-18374/com.example.testglideandpicasso D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-04-01 11:49:05.519 18374-18374/com.example.testglideandpicasso D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-04-01 11:49:05.593 18374-18404/com.example.testglideandpicasso D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
2021-04-01 11:49:05.607 18374-18404/com.example.testglideandpicasso D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
2021-04-01 11:49:05.626 18374-18404/com.example.testglideandpicasso D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
2021-04-01 11:49:05.984 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2021-04-01 11:49:05.986 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2021-04-01 11:49:06.119 18374-18374/com.example.testglideandpicasso W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a #GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
2021-04-01 11:49:06.390 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, reflection, allowed)
2021-04-01 11:49:06.390 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)
2021-04-01 11:49:06.390 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed)
2021-04-01 11:49:06.468 18374-18374/com.example.testglideandpicasso W/Glide: Load failed for http://developer.alexanderklimov.ru/android/images/android_cat.jpg with size [1173x746]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
2021-04-01 11:49:06.471 18374-18374/com.example.testglideandpicasso I/Glide: Root cause (1 of 1)
com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:98)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
Caused by: java.io.IOException: Cleartext HTTP traffic to developer.alexanderklimov.ru not permitted
at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:127)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:93)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
2021-04-01 11:49:06.514 18374-18402/com.example.testglideandpicasso D/HostConnection: HostConnection::get() New Host Connection established 0xe8eece00, tid 18402
2021-04-01 11:49:06.532 18374-18402/com.example.testglideandpicasso D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
2021-04-01 11:49:06.582 18374-18402/com.example.testglideandpicasso W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2021-04-01 11:49:06.585 18374-18402/com.example.testglideandpicasso D/EGL_emulation: eglCreateContext: 0xe8eedc70: maj 3 min 0 rcv 3
2021-04-01 11:49:06.594 18374-18402/com.example.testglideandpicasso D/EGL_emulation: eglMakeCurrent: 0xe8eedc70: ver 3 0 (tinfo 0xe923a070) (first time)
2021-04-01 11:49:06.618 18374-18402/com.example.testglideandpicasso I/Gralloc4: mapper 4.x is not supported
2021-04-01 11:49:06.619 18374-18402/com.example.testglideandpicasso D/HostConnection: createUnique: call
2021-04-01 11:49:06.620 18374-18402/com.example.testglideandpicasso D/HostConnection: HostConnection::get() New Host Connection established 0xe8eed570, tid 18402
2021-04-01 11:49:06.621 18374-18402/com.example.testglideandpicasso D/goldfish-address-space: allocate: Ask for block of size 0x100
2021-04-01 11:49:06.621 18374-18402/com.example.testglideandpicasso D/goldfish-address-space: allocate: ioctl allocate returned offset 0x3f7ef4000 size 0x2000
2021-04-01 11:49:06.639 18374-18402/com.example.testglideandpicasso D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
Glide logs:
2021-04-01 11:49:06.119 18374-18374/com.example.testglideandpicasso W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a #GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
2021-04-01 11:49:06.468 18374-18374/com.example.testglideandpicasso W/Glide: Load failed for http://developer.alexanderklimov.ru/android/images/android_cat.jpg with size [1173x746]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
2021-04-01 11:49:06.471 18374-18374/com.example.testglideandpicasso I/Glide: Root cause (1 of 1)
com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:98)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
Caused by: java.io.IOException: Cleartext HTTP traffic to developer.alexanderklimov.ru not permitted
at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:127)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:93)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
Adding Network Security Config xml file in manifest
res/xml/network_security_config.xml:
Create the Network security config.xml in resource xml folder.
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">developer.alexanderklimov.ru/</domain>
</domain-config>
</network-security-config>
Add the Network security config.xml in manifest like following.
<application
android:name=".MyApplication"
android:networkSecurityConfig="#xml/network_security_config" ... />
I examined the log and try solved my problem using this post Glide showing error: Failed to find GeneratedAppGlideModule
The example above will be good for some situation, but for my problem solution simple need to add allow clear HTTP traffic inside Manifest file.
android:usesCleartextTraffic="true"
All my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testglideandpicasso">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:usesCleartextTraffic="true"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.TestGlideAndPicasso">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I think you're missing INTERNET permission in your AndroidManifest.xml.
Please define permission before application element in AndroidManifest.xml file.
<uses-permission android:name="android.permission.INTERNET" />
Any internet request on Android platform must have this permission, for more permissions, please check android developer documentation: https://developer.android.com/reference/android/Manifest.permission?hl=en
Have a nice trip on your Android development!
I am in the process of setting up FirebaseUI using Google's guide but I suddenly got an error I can't seem to find a solution for. I'm pretty sure it has to do with my gradle, because I've tried commenting changes in my Java files, using my phone instead of an AVD, and other emulators to no avail. I've included what I got in the Run console, Manifest, and gradles. If you need more information, please let me know. Thanks!
EDIT: For those with the same issue, I think I fixed it by updating Google Play services on the API Q emulator (you have to sign in to Google Play first), then I added the following to the app-level gradle:
android {
...
compileOptions {
...
sourceCompatibility = 1.8
targetCompatibility = 1.8
...
}
...
}
I don't know how it worked, but I hope it does for you too.
Run (conflicts only)
...
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
...
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
E/vndksupport: Could not load /vendor/lib/egl/libGLES_emulation.so from sphal namespace: dlopen failed: library "/vendor/lib/egl/libGLES_emulation.so" not found.
E/libEGL: load_driver(/vendor/lib/egl/libGLES_emulation.so): unknown
W/RenderThread: type=1400 audit(0.0:4480): avc: denied { write } for name="property_service" dev="tmpfs" ino=8377 scontext=u:r:untrusted_app_27:s0:c119,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
...
W/xample.litloca: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection)
Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection)
...
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
...
W/Gralloc3: mapper 3.x is not supported
Run (full)
09/07 19:52:53: Launching 'app' on Pixel 2 API Q.
$ adb shell am start -n "com.example.litlocal/com.example.litlocal.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Waiting for process to come online...
Connected to process 14608 on device 'Pixel_2_API_Q [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/xample.litloca: The ClassLoaderContext is a special shared library.
I/xample.litloca: The ClassLoaderContext is a special shared library.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
I/FirebaseAuth: [FirebaseAuth:] Preparing to create service connection to gms implementation
V/FA: Registered activity lifecycle callback
I/FirebaseInitProvider: FirebaseApp initialization successful
D/OpenGLRenderer: Skia GL Pipeline
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
E/vndksupport: Could not load /vendor/lib/egl/libGLES_emulation.so from sphal namespace: dlopen failed: library "/vendor/lib/egl/libGLES_emulation.so" not found.
E/libEGL: load_driver(/vendor/lib/egl/libGLES_emulation.so): unknown
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
W/RenderThread: type=1400 audit(0.0:4449): avc: denied { write } for name="property_service" dev="tmpfs" ino=8377 scontext=u:r:untrusted_app_27:s0:c119,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
V/FA: onActivityCreated
W/xample.litloca: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection)
W/xample.litloca: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection)
D/: HostConnection::get() New Host Connection established 0xdc721500, tid 14666
D/: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_host_composition_v1 GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0
D/OpenGLRenderer: Swap behavior 1
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer: Swap behavior 0
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation: eglCreateContext: 0xdc7124e0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xdc7124e0: ver 3 0 (tinfo 0xdc708f60)
V/FA: Collection enabled
V/FA: App package, google app id: com.example.litlocal, 1:175514927228:android:47ec351c4609ff5c6609f9
W/Gralloc3: mapper 3.x is not supported
I/FA: App measurement is starting up, version: 18202
To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.litlocal
D/FA: Debug-level message logging enabled
D/: createUnique: call
D/: HostConnection::get() New Host Connection established 0xdc721640, tid 14666
D/: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_host_composition_v1 GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_0
D/EGL_emulation: eglMakeCurrent: 0xdc7124e0: ver 3 0 (tinfo 0xdc708f60)
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 0
I/xample.litloca: Background young concurrent copying GC freed 16987(4410KB) AllocSpace objects, 8(224KB) LOS objects, 78% free, 1696KB/7840KB, paused 6.401ms total 59.038ms
V/FA: Connecting to remote service
V/FA: Detected application was in foreground
V/FA: Session started, time: 27900964
D/FA: Setting user property (FE): _sid, 1567911177
V/FA: Connection attempt already in progress
I/FA: Tag Manager is not found and thus will not be used
D/FA: Logging event (FE): session_start(_s), Bundle[{ga_event_origin(_o)=auto, ga_session_id(_sid)=1567911177}]
V/FA: Connection attempt already in progress
V/FA: Connection attempt already in progress
V/FA: Activity resumed, time: 27900309
D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_screen_class(_sc)=MainActivity, ga_screen_id(_si)=8377598752693967695}]
V/FA: Connection attempt already in progress
Connection attempt already in progress
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 6
V/FA: Inactivity, disconnecting from the service
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.litlocal">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="LitLocal">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".CreateEventActivity"
android:label="#string/create_event_activity_name"/>
<activity
android:name=".SetEventLocationActivity"
android:label="#string/set_event_location_activity_name"/>
<activity
android:name=".LoginActivity"
android:label="#string/login_activity_name"/>
</application>
</manifest>
Gradle (Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Grade (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.litlocal"
minSdkVersion 22
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs "en"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
/*sourceCompatibility = 1.8
targetCompatibility = 1.8*/
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.2.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-places-v8:0.9.0'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.google.firebase:firebase-auth:19.0.0'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-firestore:21.0.0'
//implementation 'com.firebaseui:firebase-ui-database:5.1.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
// Tentative for login
//implementation 'com.squareup.picasso:picasso:2.71828'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
apply plugin: 'com.google.gms.google-services'
This worked for me:
android {
...
compileOptions {
...
sourceCompatibility = 1.8
targetCompatibility = 1.8
...
}
...
}
I have created a google map activity in android studio. I have also generated an api key from the link given and placed it in the appropriate place. But when I run the app it crashes without displaying anything. Here is the logcat
2018-12-19 16:13:00.080 17295-17295/? I/ik7.locationap: Not late-enabling -Xcheck:jni (already on)
2018-12-19 16:13:00.312 17295-17295/? W/ik7.locationap: Unexpected CPU variant for X86 using defaults: x86
2018-12-19 16:13:00.667 17295-17295/com.example.nik7.locationapp W/ik7.locationap: JIT profile information will not be recorded: profile file does not exits.
2018-12-19 16:13:00.669 17295-17295/com.example.nik7.locationapp I/chatty: uid=10087(com.example.nik7.locationapp) identical 10 lines
2018-12-19 16:13:00.670 17295-17295/com.example.nik7.locationapp W/ik7.locationap: JIT profile information will not be recorded: profile file does not exits.
2018-12-19 16:13:00.733 17295-17295/com.example.nik7.locationapp I/InstantRun: starting instant run server: is main process
2018-12-19 16:13:01.001 17295-17295/com.example.nik7.locationapp I/zzbz: Making Creator dynamically
2018-12-19 16:13:01.022 17295-17295/com.example.nik7.locationapp W/ik7.locationap: Unsupported class loader
2018-12-19 16:13:01.023 17295-17295/com.example.nik7.locationapp W/ik7.locationap: Skipping duplicate class check due to unsupported classloader
2018-12-19 16:13:01.033 17295-17295/com.example.nik7.locationapp I/DynamiteModule: Considering local module com.google.android.gms.maps_dynamite:0 and remote module com.google.android.gms.maps_dynamite:221
2018-12-19 16:13:01.033 17295-17295/com.example.nik7.locationapp I/DynamiteModule: Selected remote version of com.google.android.gms.maps_dynamite, version >= 221
2018-12-19 16:13:01.033 17295-17295/com.example.nik7.locationapp V/DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils
2018-12-19 16:13:01.113 17295-17295/com.example.nik7.locationapp W/ik7.locationap: Unsupported class loader
2018-12-19 16:13:01.131 17295-17295/com.example.nik7.locationapp W/ik7.locationap: Skipping duplicate class check due to unsupported classloader
2018-12-19 16:13:01.180 17295-17295/com.example.nik7.locationapp I/Google Maps Android API: Google Play services client version: 12451000
2018-12-19 16:13:01.192 17295-17295/com.example.nik7.locationapp I/Google Maps Android API: Google Play services package version: 14799040
2018-12-19 16:13:01.319 17295-17295/com.example.nik7.locationapp W/ik7.locationap: Accessing hidden field Ljava/nio/Buffer;->address:J (light greylist, reflection)
2018-12-19 16:13:01.712 17295-17295/com.example.nik7.locationapp D/OpenGLRenderer: HWUI GL Pipeline
2018-12-19 16:13:01.877 17295-17341/com.example.nik7.locationapp I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2018-12-19 16:13:01.878 17295-17341/com.example.nik7.locationapp I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
2018-12-19 16:13:01.878 17295-17341/com.example.nik7.locationapp I/OpenGLRenderer: Initialized EGL, version 1.4
2018-12-19 16:13:01.878 17295-17341/com.example.nik7.locationapp D/OpenGLRenderer: Swap behavior 1
2018-12-19 16:13:01.883 17295-17341/com.example.nik7.locationapp W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2018-12-19 16:13:01.883 17295-17341/com.example.nik7.locationapp D/OpenGLRenderer: Swap behavior 0
2018-12-19 16:13:01.907 17295-17341/com.example.nik7.locationapp D/EGL_emulation: eglCreateContext: 0xe8310280: maj 2 min 0 rcv 2
2018-12-19 16:13:01.913 17295-17341/com.example.nik7.locationapp D/EGL_emulation: eglMakeCurrent: 0xe8310280: ver 2 0 (tinfo 0xe7093fa0)
2018-12-19 16:13:02.025 17295-17341/com.example.nik7.locationapp D/EGL_emulation: eglMakeCurrent: 0xe8310280: ver 2 0 (tinfo 0xe7093fa0)
2018-12-19 16:13:02.034 17295-17338/com.example.nik7.locationapp D/EGL_emulation: eglCreateContext: 0xe9d05f00: maj 1 min 0 rcv 1
2018-12-19 16:13:02.229 17295-17338/com.example.nik7.locationapp D/EGL_emulation: eglMakeCurrent: 0xe9d05f00: ver 1 0 (tinfo 0xe9d03470)
2018-12-19 16:13:02.564 17295-17319/com.example.nik7.locationapp D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2018-12-19 16:13:03.305 17295-17319/com.example.nik7.locationapp E/AndroidRuntime: FATAL EXCEPTION: Thread-6
Process: com.example.nik7.locationapp, PID: 17295
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/ProtocolVersion;
at ez.b(:com.google.android.gms.dynamite_mapsdynamite#14799084#14.7.99 (100700-223214910):3)
at ey.a(:com.google.android.gms.dynamite_mapsdynamite#14799084#14.7.99 (100700-223214910):3)
at fa.a(:com.google.android.gms.dynamite_mapsdynamite#14799084#14.7.99 (100700-223214910):15)
at com.google.maps.api.android.lib6.drd.al.a(:com.google.android.gms.dynamite_mapsdynamite#14799084#14.7.99 (100700-223214910):6)
at ed.a(:com.google.android.gms.dynamite_mapsdynamite#14799084#14.7.99 (100700-223214910):21)
at ed.run(:com.google.android.gms.dynamite_mapsdynamite#14799084#14.7.99 (100700-223214910):8)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.ProtocolVersion" on path: DexPathList[[zip file "/data/user_de/0/com.google.android.gms/app_chimera/m/00000015/MapsDynamite.apk"],nativeLibraryDirectories=[/data/user_de/0/com.google.android.gms/app_chimera/m/00000015/MapsDynamite.apk!/lib/x86, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at ad.loadClass(:com.google.android.gms.dynamite_dynamiteloader#14799084#14.7.99 (100700-223214910):4)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at ez.b(:com.google.android.gms.dynamite_mapsdynamite#14799084#14.7.99 (100700-223214910):3)
at ey.a(:com.google.android.gms.dynamite_mapsdynamite#14799084#14.7.99 (100700-223214910):3)
at fa.a(:com.google.android.gms.dynamite_mapsdynamite#14799084#14.7.99 (100700-223214910):15)
at com.google.maps.api.android.lib6.drd.al.a(:com.google.android.gms.dynamite_mapsdynamite#14799084#14.7.99 (100700-223214910):6)
at ed.a(:com.google.android.gms.dynamite_mapsdynamite#14799084#14.7.99 (100700-223214910):21)
at ed.run(:com.google.android.gms.dynamite_mapsdynamite#14799084#14.7.99 (100700-223214910):8)
2018-12-19 16:13:03.338 17295-17295/com.example.nik7.locationapp E/SchedPolicy: set_timerslack_ns write failed: Operation not permitted
2018-12-19 16:13:03.379 17295-17319/com.example.nik7.locationapp I/Process: Sending signal. PID: 17295 SIG: 9
This is the compelte log.I have even tried by removing the restrictions but that didn't work. Whats the issue here. I have also seledted api 23 marshmallow. I have done nothing except entering the api key in its place
EDIT: I also included the key in the manifest but still the app is crashing
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_API_KEY"/>
EDIT:
Seems to be an issue in API 28
To fix it add this code under application in your manifest file:
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
Its probably because you dont have google play services installed. If you ran the app on your actual phone it would work just fine.
To fix it, you either add this line of code inside the in the manifest
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
Or
to upgrade your play-services-maps in build.gradle to
implementation 'com.google.android.gms:play-services-maps:16.1.0'
That worked for me