I'm attempting to get my PWA app working using the Google TWA guide here:
https://developers.google.com/web/updates/2019/02/using-twa
I've followed the guide completely from start to finish multiple times, but can't seem to get it to hide the URL bar at any point.
I have uploaded the apk(release) to Google Play Console, and allowed it to do the signing for me.
I've gone through basically all of the questions on SO, and none of the solutions seem to work for me, or I already have them set up correctly.
Things to note that I have tried and checked:
I've copied the SHA256 fingerprint to my assetlinks.json file that was provided to me by the Play Console. Didn't work.
I've used the manually generated SHA256 fingerprint that I set up in Android Studio in my assetlinks.json. Didn't work.
Under both of the above conditions, I have tried manually loading the generated apk onto my phone instead of the apk from the Play Console. Didn't work.
I've tried using Android Studio to install the app using developer mode with USB debugging on my phone (tried both release and debug flavours). Also didn't work.
Tried changing the namespace in the strings.xml to "android_app" to match the namespace in the assetlinks.json file as a bit of a long shot. Didn't work.
Confirmed that the assetlinks.json file works using the asset links generator: https://developers.google.com/digital-asset-links/tools/generator
My assetlinks.json path is /.well-known/assetlinks.json
My intents seem to work (clicking a link in Google search results will prompt to launch the app, and the association stays)
My build.gradle (Module)
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
defaultConfig {
applicationId "com.mypwadomain.www"
minSdkVersion 16
targetSdkVersion 29
versionCode 3
versionName "0.1.9"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.github.GoogleChrome.custom-tabs-client:customtabs:d08e93fce3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
My AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.mypwadomain.www">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="PWAAppName"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<meta-data
android:name="asset_statements"
android:resource="#string/asset_statements" />
<activity
android:name="android.support.customtabs.trusted.LauncherActivity">
<meta-data
android:name="android.support.customtabs.trusted.DEFAULT_URL"
android:value="https://www.mypwadomain.com/login" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="https"
android:host="www.mypwadomain.com"/>
</intent-filter>
</activity>
</application>
</manifest>
My strings.xml
<resources>
<string name="app_name">PWAAppName</string>
<string name="asset_statements">
[{
\"relation\": [\"delegate_permission/common.handle_all_urls\"],
\"target\": {
\"namespace\": \"web\",
\"site\": \"https://www.mypwadomain.com\"}
}]
</string>
</resources>
My assetlinks.json
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "web",
"site": "https://www.mypwadomain.com"
}
},{
"relation": ["delegate_permission/common.handle_all_urls"],
"target" : { "namespace": "android_app", "package_name": "com.mypwadomain.www",
"sha256_cert_fingerprints": ["...Google Signed Fingerprint..."] }
}]
The Audit in Lighthouse for the app itself comes back as 100 PWA compatibility, and adding to homescreen works well on both Android and iOS devices.
I'm pretty new to this. I'm primarily a PHP developer, and the actual app is working fine. I literally installed Android Studio for the first time a few days ago. On the plus side, I use PHPStorm, which is also made by JetBrains, so that part helped with the learning curve.
Any help or advice on what else I can check would be greatly appreciated.
EDIT:
I loaded logcat via android studio (I am working on Windows). I then ran the app in debug mode, and the resulting log is below. No instances of OriginVerifier or digital_asset_links
2019-06-20 11:18:12.440 12042-12042/? E/Zygote: accessInfo : 1
2019-06-20 11:18:12.444 12042-12042/? I/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c94,c257,c512,c768, pkgname=com.mypwaapp.www
2019-06-20 11:18:12.453 12042-12042/? I/m.mypwaapp.ww: Late-enabling -Xcheck:jni
2019-06-20 11:18:12.609 12042-12042/com.mypwaapp.www W/ActivityThread: Application com.mypwaapp.www is waiting for the debugger on port 8100...
2019-06-20 11:18:12.610 12042-12042/com.mypwaapp.www I/System.out: Sending WAIT chunk
2019-06-20 11:18:13.814 12042-12042/com.mypwaapp.www I/System.out: Debugger has connected
2019-06-20 11:18:13.815 12042-12042/com.mypwaapp.www I/System.out: waiting for debugger to settle...
2019-06-20 11:18:14.017 12042-12042/com.mypwaapp.www I/chatty: uid=10350(com.mypwaapp.www) identical 1 line
2019-06-20 11:18:14.220 12042-12042/com.mypwaapp.www I/System.out: waiting for debugger to settle...
2019-06-20 11:18:14.423 12042-12042/com.mypwaapp.www I/System.out: waiting for debugger to settle...
2019-06-20 11:18:14.625 12042-12042/com.mypwaapp.www I/System.out: waiting for debugger to settle...
2019-06-20 11:18:14.828 12042-12042/com.mypwaapp.www I/System.out: waiting for debugger to settle...
2019-06-20 11:18:15.032 12042-12042/com.mypwaapp.www I/chatty: uid=10350(com.mypwaapp.www) identical 1 line
2019-06-20 11:18:15.235 12042-12042/com.mypwaapp.www I/System.out: waiting for debugger to settle...
2019-06-20 11:18:15.440 12042-12042/com.mypwaapp.www I/System.out: debugger has settled (1500)
2019-06-20 11:18:15.457 12042-12042/com.mypwaapp.www D/ConnectivityManager_URSP: Ursp sIsUrsp=false, sIsCheckUrsp=false, uid=10350
2019-06-20 11:18:15.478 12042-12042/com.mypwaapp.www D/Proxy: urspP is null: 10350
2019-06-20 11:18:15.788 12042-12042/com.mypwaapp.www W/m.mypwaapp.ww: JIT profile information will not be recorded: profile file does not exits.
2019-06-20 11:18:15.831 12042-12042/com.mypwaapp.www I/chatty: uid=10350(com.mypwaapp.www) identical 10 lines
2019-06-20 11:18:15.835 12042-12042/com.mypwaapp.www W/m.mypwaapp.ww: JIT profile information will not be recorded: profile file does not exits.
2019-06-20 11:18:15.948 12042-12042/com.mypwaapp.www I/InstantRun: starting instant run server: is main process
2019-06-20 11:18:16.101 12042-12063/com.mypwaapp.www D/libEGL: loaded /vendor/lib64/egl/libGLES_mali.so
2019-06-20 11:18:16.403 12042-12042/com.mypwaapp.www D/TWAProviderPicker: Found Custom Tabs provider: com.sec.android.app.sbrowser
2019-06-20 11:18:16.404 12042-12042/com.mypwaapp.www D/TWAProviderPicker: Found no TWA providers, using first Custom Tabs provider: com.sec.android.app.sbrowser
2019-06-20 11:18:16.410 12042-12042/com.mypwaapp.www D/TWALauncherActivity: Using URL from Manifest (https://www.mypwaapp.com/login).
2019-06-20 11:18:17.330 12042-12042/com.mypwaapp.www W/m.mypwaapp.ww: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
2019-06-20 11:18:17.335 12042-12042/com.mypwaapp.www W/m.mypwaapp.ww: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
2019-06-20 11:18:17.506 12042-12042/com.mypwaapp.www D/OpenGLRenderer: Skia GL Pipeline
2019-06-20 11:18:17.528 12042-12042/com.mypwaapp.www D/EmergencyMode: [EmergencyManager] android createPackageContext successful
2019-06-20 11:18:17.678 12042-12042/com.mypwaapp.www D/InputTransport: Input channel constructed: fd=81
2019-06-20 11:18:17.686 12042-12042/com.mypwaapp.www D/ViewRootImpl#c9324c2[LauncherActivity]: setView = DecorView#fe5f2d3[LauncherActivity] TM=true MM=false
2019-06-20 11:18:17.717 12042-12042/com.mypwaapp.www D/ViewRootImpl#c9324c2[LauncherActivity]: Surface release. android.view.WindowManagerGlobal.setStoppedState:669 android.app.Activity.performStop:7646 android.app.ActivityThread.callActivityOnStop:4352 android.app.ActivityThread.performStopActivityInner:4330 android.app.ActivityThread.handleStopActivity:4405 android.app.servertransaction.StopActivityItem.execute:41 android.app.servertransaction.TransactionExecutor.executeLifecycleState:145 android.app.servertransaction.TransactionExecutor.execute:70
2019-06-20 11:18:17.779 12042-12042/com.mypwaapp.www D/ViewRootImpl#c9324c2[LauncherActivity]: dispatchAttachedToWindow
2019-06-20 11:18:17.839 12042-12042/com.mypwaapp.www D/ViewRootImpl#c9324c2[LauncherActivity]: Relayout returned: old=[0,0][1440,2960] new=[0,0][1440,2960] result=0x1 surface={valid=false 0} changed=false
EDIT 2:
I did find this in the logcat feed:
2019-06-20 12:23:56.772 6226-11769/? I/SingleHostAsyncVerifier: Verification result: checking for a statement with source a: # bpti#709f0232
w: 29
, relation delegate_permission/common.handle_all_urls, and target b <
a: "com.mypwaapp.www"
b: # bptg#e7d522a2
w: 118
>
w: 120
--> false.
Not sure if relevant or not.
My default browser must have reset to the Samsung browser when I cleared out settings on my phone (Samsung Note 9) when I was troubleshooting the problem. I set the default browser to Chrome. It's working fine.
Thanks to andreban :)
I had a similar case to #Incredibad, where I had both Chrome and Chrome Dev installed, with Chrome dev becoming the default browser.
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 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've been trying to use record espresso for a few hours now, but I just can't make it work on the project.
I've added:
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
And I press run Record Espresso Test, and the screen just freezes at the first screen. It doesn't finish the activity, because it is a Splash screen. Even if I set another screen as a first activity it just freezes, it makes a request but doesn't show any results, or changes screen. I have animations turned off.
03/18 08:29:20: Launching TestRecorderapp
$ adb push C:\ProjectsGit\somelink\app\build\outputs\apk\debug\app-debug.apk /data/local/tmp/com.company.someapp.debug
$ adb shell pm install -t -r "/data/local/tmp/com.company.someapp.debug"
Success
APK installed in 1 s 593 ms
$ adb shell pm clear com.company.someapp.debug
$ adb shell am start -n "com.company.someapp.debug/com.company.someapp.views.activities.SplashActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.company.someapp.debug | com.company.someapp.debug.test
Waiting for application to come online: com.company.someapp.debug | com.company.someapp.debug.test
Connecting to com.company.someapp.debug
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/tcar.someapp.debu: The ClassLoaderContext is a special shared library.
W/ActivityThread: Application com.company.someapp.debug is waiting for the debugger on port 8100...
I/System.out: Sending WAIT chunk
I/System.out: Debugger has connected
waiting for debugger to settle...
Connected to the target VM, address: 'localhost:8602', transport: 'socket'
I/System.out: waiting for debugger to settle...
I/chatty: uid=10222(com.company.someapp.debug) identical 5 lines
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1385)
I/tcar.someapp.debu: The ClassLoaderContext is a special shared library.
I/Perf: Connecting to perf service.
I/MultiDex: VM with version 2.1.0 has multidex support
Installing application
VM has multidex support, MultiDex support library is disabled.
V/FA: Registered activity lifecycle callback
D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
I/FirebaseInitProvider: FirebaseApp initialization successful
V/Font: Change font:2
W/zze: Application name is not set. Call Builder#setApplicationName.
V/FA: Collection enabled
V/FA: App package, google app id: com.company.someapp.debug, 1:820332358974:android:deb7661ca6fda492
I/FA: App measurement is starting up, version: 14711
To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.company.someapp.debug
D/FA: Debug-level message logging enabled
V/FA: Persisting first open: 1552894248164
I/CrashlyticsCore: Initializing Crashlytics 2.6.7.30
V/FA: Updating deferred analytics collection: false
W/com.company.someapp.debug: type=1400 audit(0.0:5835047): avc: denied { read } for comm=45474C20496E6974 name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=23336 scontext=u:r:untrusted_app:s0:c222,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
E/libc: Access denied finding property "vendor.debug.egl.profiler"
E/libc: Access denied finding property "vendor.debug.prerotation.disable"
V/FA: Checking service availability
V/FA: onActivityCreated
V/FA: Service available
Setting useService: true
V/FA: Connecting to remote service
V/FA: Connection attempt already in progress
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
W/tcar.someapp.debu: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (light greylist, reflection)
Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (light greylist, reflection)
Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (light greylist, reflection)
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy#6a839d6
V/FA: onActivityCreated
W/tcar.someapp.debu: Accessing hidden field Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; (light greylist, reflection)
W/tcar.someapp.debu: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
W/tcar.someapp.debu: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
I/FloatingActionButton: Setting a custom background is not supported.
I/chatty: uid=10222(com.company.someapp.debug) identical 1 line
I/FloatingActionButton: Setting a custom background is not supported.
W/tcar.someapp.debu: Accessing hidden field Lsun/misc/Unsafe;->theUnsafe:Lsun/misc/Unsafe; (light greylist, reflection)
D/OkHttp: --> GET https://api.somelink.com/api/settings
Accept-Language: en
x-client-type: android
x-api-version: 4.1.0
--> END GET
W/tcar.someapp.debu: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols([B)V (light greylist, reflection)
D/OkHttp: --> GET https://api.somelink.com/
D/OkHttp: Accept-Language: en
x-client-type: android
x-api-version: 4.1.0
--> END GET
W/MixpanelAPI.RsrcReader: Can't load names for Android view ids from 'com.company.someapp.debug.R$id', ids by name will not be available in the events editor.
W/MixpanelAPI.ConfigurationChecker: You can't have more than one service handling "com.google.firebase.MESSAGING_EVENT" intent filter. Android will only use the first one that is declared on your AndroidManifest.xml. If you have more than one push provider you need to crate your own FirebaseMessagingService class.
I/DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
W/tcar.someapp.debu: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->getAlpnSelectedProtocol()[B (light greylist, reflection)
I/FA: Tag Manager is not found and thus will not be used
D/OkHttp: <-- 401 Unauthorized https://api.somelink.com(392ms)
Date: Mon, 18 Mar 2019 07:30:46 GMT
Content-Type: text/plain; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,POST,PUT,DELETE,PATCH,OPTIONS
D/OkHttp: Access-Control-Allow-Headers: content-type,x-requested-with,authorization, accept, accept-language,x-client-type,x-client-build,x-api-version
Access-Control-Max-Age: 86400
Access-Control-Allow-Credentials: true
Vary: Origin
X-Request-ID: d7775f53-3ec9-4dae-ad96-0789e672ece9
X-Kong-Upstream-Latency: 29
X-Kong-Proxy-Latency: 0
Via: kong/0.9.8
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
D/OkHttp: Unauthorized
D/OkHttp: <-- END HTTP (12-byte body)
D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=ACCarSharingDrawerActivity, firebase_screen_id(_si)=2030554288779527060}]
E/SensorManager: registerListenerImpl sensorName:lsm6ds3c Accelerometer Non-wakeup,isWakeUpSensor:false,callingApp: com.company.someapp.debug,callingPid:7032,callingUid:10222
D/OkHttp: <-- 200 OK https://LINK.TO.API (545ms)
Date: Mon, 18 Mar 2019 07:30:46 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Origin: *
D/OkHttp: Access-Control-Allow-Methods: GET,POST,PUT,DELETE,PATCH,OPTIONS
Access-Control-Allow-Headers: content-type,x-requested-with,authorization, accept, accept-language,x-client-type,x-client-build,x-api-version
Access-Control-Max-Age: 86400
Access-Control-Allow-Credentials: true
ETag: "4e4-7xR+HT/mxMa+pp02AdQTyyq5xFM"
Vary: Origin
D/OkHttp: X-Request-ID: ae38af60-0eab-45a0-a63b-0a1ae4a8bc18
X-Kong-Upstream-Latency: 57
X-Kong-Proxy-Latency: 0
Via: kong/0.9.8
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
D/OkHttp: {"Some response"}
<-- END HTTP (1252-byte body)
V/FA: Connection attempt already in progress
V/FA: Connection attempt already in progress
V/FA: Activity resumed, time: 2325227289
D/OkHttp: --> GET https://link.to.api
D/OkHttp: Accept-Language: en
x-client-type: android
x-api-version: 4.1.0
--> END GET
D/OpenGLRenderer: Skia GL Pipeline
I/Choreographer: Skipped 61 frames! The application may be doing too much work on its main thread.
D/OkHttp: <-- 401 Unauthorized https://api.somelink.com/api(143ms)
Date: Mon, 18 Mar 2019 07:30:46 GMT
Content-Type: text/plain; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,POST,PUT,DELETE,PATCH,OPTIONS
Access-Control-Allow-Headers: content-type,x-requested-with,authorization, accept, accept-language,x-client-type,x-client-build,x-api-version
D/OkHttp: Access-Control-Max-Age: 86400
Access-Control-Allow-Credentials: true
Vary: Origin
X-Request-ID: c0112419-5fde-41b7-b940-c28a002e615a
X-Kong-Upstream-Latency: 77
X-Kong-Proxy-Latency: 0
Via: kong/0.9.8
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
D/OkHttp: Unauthorized
<-- END HTTP (12-byte body)
D/OkHttp: --> GET https://api.somelink.com/api
D/OkHttp: Accept-Language: en
x-client-type: android
x-api-version: 4.1.0
--> END GET
I/zzbz: Making Creator dynamically
D/OkHttp: <-- 200 OK https://api.somelink.com/api/ (138ms)
Date: Mon, 18 Mar 2019 07:30:47 GMT
Content-Type: application/json; charset=utf-8
D/OkHttp: Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,POST,PUT,DELETE,PATCH,OPTIONS
Access-Control-Allow-Headers: content-type,x-requested-with,authorization, accept, accept-language,x-client-type,x-client-build,x-api-version
Access-Control-Max-Age: 86400
Access-Control-Allow-Credentials: true
ETag: "2af9-wj9m57vexbsWcU5m7bfhEuhjvw4"
Vary: Origin
X-Request-ID: 668799cc-788b-43d4-96d7-eb8fd5614fc9
X-Kong-Upstream-Latency: 110
X-Kong-Proxy-Latency: 0
Via: kong/0.9.8
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
D/OkHttp: {CORRECT RESPONSE JSON} <-- END HTTP (11001-byte body)
W/tcar.someapp.debu: Unsupported class loader
W/tcar.someapp.debu: Skipping duplicate class check due to unsupported classloader
I/DynamiteModule: Considering local module com.google.android.gms.maps_dynamite:0 and remote module com.google.android.gms.maps_dynamite:221
Selected remote version of com.google.android.gms.maps_dynamite, version >= 221
V/DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils
W/tcar.someapp.debu: Unsupported class loader
W/tcar.someapp.debu: Skipping duplicate class check due to unsupported classloader
I/Google Maps Android API: Google Play services client version: 12451000
I/Google Maps Android API: Google Play services package version: 15090037
W/tcar.someapp.debu: Accessing hidden field Ljava/nio/Buffer;->address:J (light greylist, reflection)
I/Adreno: QUALCOMM build : f909f5a, Ida6448821d
Build Date : 11/12/18
OpenGL ES Shader Compiler Version: EV031.25.03.00
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.7.3.R1.08.00.00.423.039
Remote Branch : NONE
Reconstruct Branch : NOTHING
Build Config : S P 6.0.3 AArch64
W/RenderThread: type=1400 audit(0.0:5835049): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=23336 scontext=u:r:untrusted_app:s0:c222,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
E/libc: Access denied finding property "vendor.debug.prerotation.disable"
W/RenderThread: type=1400 audit(0.0:5835050): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=23336 scontext=u:r:untrusted_app:s0:c222,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
E/libc: Access denied finding property "ro.vendor.graphics.memory"
E/libc: Access denied finding property "vendor.debug.prerotation.disable"
E/libc: Access denied finding property "vendor.debug.prerotation.disable"
W/RenderThread: type=1400 audit(0.0:5835052): avc: denied { search } for name="proc" dev="debugfs" ino=3974 scontext=u:r:untrusted_app:s0:c222,c256,c512,c768 tcontext=u:object_r:qti_debugfs:s0 tclass=dir permissive=0
W/RenderThread: type=1400 audit(0.0:5835053): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=23336 scontext=u:r:untrusted_app:s0:c222,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
I/Adreno: PFP: 0x016ee170, ME: 0x00000000
E/libc: Access denied finding property "vendor.debug.prerotation.disable"
I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 1
android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 2
E/libc: Access denied finding property "vendor.debug.egl.changepixelformat"
W/RenderThread: type=1400 audit(0.0:5835055): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=23336 scontext=u:r:untrusted_app:s0:c222,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 4
I/Choreographer: Skipped 145 frames! The application may be doing too much work on its main thread.
E/libc: Access denied finding property "vendor.debug.egl.changepixelformat"
E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
D/: Successfully load libgui-plugin.so, this=0x76506f70c0
I/OpenGLRenderer: Davey! duration=2828ms; Flags=0, IntendedVsync=910300861918726, Vsync=910303278585296, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=910303285835193, AnimationStart=910303286168422, PerformTraversalsStart=910303290208266, DrawStart=910303309583109, SyncQueued=910303573194464, SyncStart=910303573524516, IssueDrawCommandsStart=910303574379828, SwapBuffers=910303689163213, FrameCompleted=910303691023943, DequeueBufferDuration=3761000, QueueBufferDuration=1051000,
E/SensorManager: unregisterListenerImpl callingApp: com.company.someapp.debug,callingPid:7032,callingUid:10222
V/FA: Recording user engagement, ms: 3449
Disconnected from the target VM, address: 'localhost:8602', transport: 'socket'
This are DEBUG Console logs. I tried it on another project and it was VERY VERY LAGGY. Am I missing something?
I had the same issue on Android Studio 4.1.1 using Pixel 3 API 29.
When the emulator is up, my application becomes stuck in blank screen (before the splashscreen)
Make sure that you had import Espresso dependencies:
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
ps: https://www.thedroidsonroids.com/blog/espresso-test-recording
I created a new sample project for displaying the Facebook audience network Banner ad at bottom of my activity.
My app is running in device but not displaying anything at bottom. I already added the hash for test device.
MainActivity.java
package liveradio.radioz.com.facebookads;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.facebook.ads.*;
import android.widget.LinearLayout;
public class MainActivity extends AppCompatActivity {
private AdView adView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
adView = new AdView(this, "PLACEMENT-ID", AdSize.BANNER_HEIGHT_50);
// Find the Ad Container
LinearLayout adContainer = (LinearLayout) findViewById(R.id.banner_container);
// Add the ad view to your activity layout
adContainer.addView(adView);
AdSettings.addTestDevice("DEVICE-ID");
// Request an ad
adView.loadAd();
}
#Override
protected void onDestroy() {
if (adView != null) {
adView.destroy();
}
super.onDestroy();
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="liveradio.radioz.com.facebookads.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="#+id/banner_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical"
/>
</android.support.constraint.ConstraintLayout>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="liveradio.radioz.com.facebookads">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
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">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Log :
01/12 12:13:01: Launching app
$ adb shell am start -n "liveradio.radioz.com.facebookads/liveradio.radioz.com.facebookads.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: liveradio.radioz.com.facebookads.test | liveradio.radioz.com.facebookads
Waiting for application to come online: liveradio.radioz.com.facebookads.test | liveradio.radioz.com.facebookads
Waiting for application to come online: liveradio.radioz.com.facebookads.test | liveradio.radioz.com.facebookads
Connecting to liveradio.radioz.com.facebookads
Waiting for application to start debug server
Waiting for application to come online: liveradio.radioz.com.facebookads.test | liveradio.radioz.com.facebookads
Connecting to liveradio.radioz.com.facebookads
Connected to the target VM, address: 'localhost:8645', transport: 'socket'
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/zygote: Not late-enabling -Xcheck:jni (already on)
W/zygote: Suspending all threads took: 83.944ms
W/zygote: Unexpected CPU variant for X86 using defaults: x86
I/zygote: Background concurrent copying GC freed 9752(4MB) AllocSpace objects, 0(0B) LOS objects, 61% free, 973KB/2MB, paused 48.188ms total 236.235ms
W/ActivityThread: Application liveradio.radioz.com.facebookads is waiting for the debugger on port 8100...
I/System.out: Sending WAIT chunk
I/zygote: Debugger is active
I/System.out: Debugger has connected
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1486)
I/InstantRun: starting instant run server: is main process
I/WebViewFactory: Loading com.android.chrome version 61.0.3163.98 (code 316409812)
I/zygote: The ClassLoaderContext is a special shared library.
I/cr_LibraryLoader: Time to load native libraries: 3 ms (timestamps 6510-6513)
I/chromium: [INFO:library_loader_hooks.cc(136)] Chromium logging enabled: level = 0, default verbosity = 0
I/cr_LibraryLoader: Expected native library version number "61.0.3163.98", actual native library version number "61.0.3163.98"
E/FBAudienceNetwork: You don't call AudienceNetworkAds.initialize(). Some functionality may not work properly.
D/IS_UNITY: false
D/AdInternalSettings: Test mode device hash: 877dd37b-fff7-4fa1-b83d-776592220359
D/AdInternalSettings: When testing your app with Facebook's ad units you must specify the device hashed ID to ensure the delivery of test ads, add the following code before loading an ad: AdSettings.addTestDevice("877dd37b-fff7-4fa1-b83d-776592220359");
D/IS_UNITY: false
E/ActivityThread: Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider
D/OpenGLRenderer: HWUI GL Pipeline
V/StudioProfiler: StudioProfilers agent attached.
V/StudioProfiler: Acquiring Application for Events
V/StudioProfiler: Transformed class: java/net/URL
W/zygote: Current dex file has more than one class in it. Calling RetransformClasses on this class might fail if no transformations are applied to it!
V/StudioProfiler: Memory control stream started.
[ 01-12 12:13:06.606 20774:20877 D/ ]
HostConnection::get() New Host Connection established 0xd1835a80, tid 20877
I/zygote: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
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: 0xe4b85540: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xe4b85540: ver 3 0 (tinfo 0xe4b83360)
D/EGL_emulation: eglMakeCurrent: 0xe4b85540: ver 3 0 (tinfo 0xe4b83360)
W/cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.android.chrome, sandboxed = true
I/cr_BrowserStartup: Initializing chromium process, singleProcess=false
[ 01-12 12:13:07.026 20774:20774 D/ ]
HostConnection::get() New Host Connection established 0xd1583c00, tid 20774
D/EGL_emulation: eglCreateContext: 0xcecec360: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xcecec360: ver 3 0 (tinfo 0xe21fff60)
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
W/cr_CrashFileManager: /data/user/0/liveradio.radioz.com.facebookads/cache/WebView/Crash Reports does not exist or is not a directory
W/com.facebookads: type=1400 audit(0.0:22): avc: denied { read } for name="vmstat" dev="proc" ino=4026532039 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc:s0 tclass=file permissive=0
D/IS_UNITY: false
I/zygote: Background concurrent copying GC freed 7886(1025KB) AllocSpace objects, 5(100KB) LOS objects, 50% free, 1746KB/3MB, paused 680us total 122.639ms
I/zygote: Do partial code cache collection, code=30KB, data=25KB
I/zygote: After code cache collection, code=30KB, data=25KB
I/zygote: Increasing code cache capacity to 128KB
V/StudioProfiler: Live memory tracking disabled.
V/StudioProfiler: Live memory tracking enabled.
V/StudioProfiler: JNIEnv not attached
V/StudioProfiler: Loaded classes: 6311
V/StudioProfiler: Tracking initialization took: 648527000ns
I/zygote: Do partial code cache collection, code=60KB, data=44KB
I/zygote: After code cache collection, code=56KB, data=43KB
I/zygote: Increasing code cache capacity to 256KB
Disconnected from the target VM, address: 'localhost:8645', transport: 'socket'
I'm getting the build successful and installed in my device. When I open the app I can't see any ads or test ads at bottom of my main activity.
If you've added Audience network libraries, you can add the code below to show test ads without worrying about adding a test device.
if (BuildConfig.DEBUG) {
AdSettings.setTestMode(true);
}
Add this code, preferably in your Application class.
First Implement this library:
implementation 'com.facebook.android:audience-network-sdk:4.99.1'
than use below code:
com.facebook.ads.AdView adView;
adView = new com.facebook.ads.AdView(this, "PLACEMENT-ID",
com.facebook.ads.AdSize.BANNER_HEIGHT_50);
((LinearLayout) adContainer).addView(adView);
adView.loadAd();
first, add this library to your grade file
implementation 'com.facebook.android:audience-network-sdk:6.12.0'
then paste this code in your xml file
<LinearLayout
android:id="#+id/banner_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical"
/>
In your Java code paste this code and also replace IMG_16_9_APP_INSTALL#YOUR_PLACEMENT_ID with your banner ad ID
adView = new AdView(this, "IMG_16_9_APP_INSTALL#YOUR_PLACEMENT_ID", AdSize.BANNER_HEIGHT_50);
LinearLayout adContainer = (LinearLayout) findViewById(R.id.banner_container);
adContainer.addView(adView);
adView.loadAd();
for more information you can follow official link of meta
https://developers.facebook.com/docs/audience-network/setting-up/ad-setup/android/banner
I am developing an Android Application and was looking into Google Places for some functionality within the application. Google has recently released the PlacePicker feature which is what I am using. I have followed the Google guidelines and quick start guides to the "T". The functionality was working amazing as of three hours ago and now when I go to test it, it launches and then immediately closes with no errors thrown in the stack trace. Here is how I am using the code:
This is within a fragment.
// The Location Selection from Google Place Picker
where.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
try {
launchPlace();
} catch (GooglePlayServicesNotAvailableException | GooglePlayServicesRepairableException e) {
e.printStackTrace();
}
}
});
This is within the fragments onCreateView.
The method launchPlace() is defined as follows.
// Start Google Place Picker Code **************************************************************
public void launchPlace() throws GooglePlayServicesNotAvailableException,
GooglePlayServicesRepairableException {
PLACE_PICKER_REQUEST = 1;
PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
Context context = getActivity().getApplicationContext();
startActivityForResult(builder.build(context), PLACE_PICKER_REQUEST);
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
String badLocation = "That location is not valid for this app, please select a valid location";
if (requestCode == PLACE_PICKER_REQUEST) {
if (resultCode == Activity.RESULT_OK) {
place = PlacePicker.getPlace(data, getActivity().getApplicationContext());
if (place.getPlaceTypes().contains(34)) {
if (place.getPlaceTypes().contains(9) || place.getPlaceTypes().contains(15) ||
place.getPlaceTypes().contains(38) ||
place.getPlaceTypes().contains(67) ||
place.getPlaceTypes().contains(79)) {
where.setText(place.getName());
loc = true;
} else {
Toast.makeText(getActivity().getApplicationContext(),
badLocation, Toast.LENGTH_LONG).show();
try {
launchPlace();
} catch (GooglePlayServicesNotAvailableException | GooglePlayServicesRepairableException e) {
e.printStackTrace();
}
}
}
}
}
}
This code worked previously (3 hours ago) and now does not. Here is what LogCat says: (Android Studio)
04-21 15:48:02.320 5045-5045/com.siliconmindtech.trofi D/ViewRootImpl﹕ ViewPostImeInputStage ACTION_DOWN
04-21 15:48:02.680 5045-5124/com.siliconmindtech.trofi D/OpenGLRenderer﹕ endAllStagingAnimators on 0xa1a55600 (InsetDrawable) with handle 0xa185dff0
04-21 15:48:05.000 5045-5121/com.siliconmindtech.trofi I/System.out﹕ (HTTPLog)-Static: isSBSettingEnabled false
04-21 15:48:05.060 5045-5045/com.siliconmindtech.trofi I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy#215c768a time:9757022
If anyone knows of a way to help with this that would be amazing, I know that Google PlacePicker is quite new but I am a novice Android Developer and feel like someone has a better understanding than I. Any and all help would be appreciated. If more information is required please let me know. We use GitHub so I have reverted all the way back to when it once worked, yet nothing changed, it still closes (the picker, not the app). I have enabled the Google Places API and Google Places API for Android in the developer console, no help there either. It gets to the "Updating your location" screen then stops.
EDIT: This is the entire LogCat, from launch (On a Samsung Galaxy S5) to the PlacePicker starting (One navigation prior to that action) then closing and returning to the app. Is this what you meant?
04-21 16:56:26.740 27318-27318/com.siliconmindtech.trofi D/ResourcesManager﹕ creating new AssetManager and set to /data/app/com.siliconmindtech.trofi-1/base.apk
04-21 16:56:26.910 27318-27318/com.siliconmindtech.trofi D/AbsListView﹕ Get MotionRecognitionManager
04-21 16:56:26.910 27318-27340/com.siliconmindtech.trofi I/System.out﹕ (HTTPLog)-Static: isSBSettingEnabled false
04-21 16:56:26.910 27318-27340/com.siliconmindtech.trofi I/System.out﹕ (HTTPLog)-Static: isShipBuild true
04-21 16:56:26.910 27318-27340/com.siliconmindtech.trofi I/System.out﹕ (HTTPLog)-Thread-13137-1066627414: SmartBonding Enabling is false, SHIP_BUILD is true, log to file is false, DBG is false
04-21 16:56:26.910 27318-27340/com.siliconmindtech.trofi I/System.out﹕ (HTTPLog)-Static: isSBSettingEnabled false
04-21 16:56:26.910 27318-27318/com.siliconmindtech.trofi D/AbsListView﹕ Get MotionRecognitionManager
04-21 16:56:26.940 27318-27318/com.siliconmindtech.trofi D/Activity﹕ performCreate Call secproduct feature valuefalse
04-21 16:56:26.940 27318-27318/com.siliconmindtech.trofi D/Activity﹕ performCreate Call debug elastic valuetrue
04-21 16:56:26.950 27318-27318/com.siliconmindtech.trofi D/AbsListView﹕ Get MotionRecognitionManager
04-21 16:56:26.970 27318-27350/com.siliconmindtech.trofi D/OpenGLRenderer﹕ Render dirty regions requested: true
04-21 16:56:27.030 27318-27350/com.siliconmindtech.trofi I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: ()
OpenGL ES Shader Compiler Version: E031.25.01.03
Build Date: 10/28/14 Tue
Local Branch: LA.BF.1.1_RB1_20141028_021_patches2
Remote Branch:
Local Patches:
Reconstruct Branch:
04-21 16:56:27.030 27318-27350/com.siliconmindtech.trofi I/OpenGLRenderer﹕ Initialized EGL, version 1.4
04-21 16:56:27.050 27318-27350/com.siliconmindtech.trofi I/OpenGLRenderer﹕ HWUI protection enabled for context , &this =0xa23090d8 ,&mEglDisplay = 1 , &mEglConfig = 8
04-21 16:56:27.050 27318-27350/com.siliconmindtech.trofi D/OpenGLRenderer﹕ Enabling debug mode 0
04-21 16:56:27.050 27318-27340/com.siliconmindtech.trofi I/System.out﹕ KnoxVpnUidStorageknoxVpnSupported API value returned is false
04-21 16:56:27.240 27318-27350/com.siliconmindtech.trofi V/RenderScript﹕ Application requested CPU execution
04-21 16:56:27.260 27318-27350/com.siliconmindtech.trofi V/RenderScript﹕ 0xa2377a00 Launching thread(s), CPUs 4
04-21 16:56:27.310 27318-27318/com.siliconmindtech.trofi I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy#344b9848 time:13859270
04-21 16:56:29.700 27318-27318/com.siliconmindtech.trofi D/ViewRootImpl﹕ ViewPostImeInputStage ACTION_DOWN
04-21 16:56:31.850 27318-27318/com.siliconmindtech.trofi D/ViewRootImpl﹕ ViewPostImeInputStage ACTION_DOWN
04-21 16:56:31.970 27318-27318/com.siliconmindtech.trofi I/Places﹕ Got here!
04-21 16:56:32.300 27318-27350/com.siliconmindtech.trofi D/OpenGLRenderer﹕ endAllStagingAnimators on 0xa196d600 (InsetDrawable) with handle 0xaf7fc350
04-21 16:56:32.740 27318-27318/com.siliconmindtech.trofi I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy#344b9848 time:13864703
The above LogCat is Verbose.
Solution: Don't be a newbie like me, I had forgotten to add my Google API Key to my android_manifest.xml... I apologize.
Just enable Google Places API for Android in your Google Developer Console.
Don't forget to specify your API key at AndroidManifest:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="ADD_YOUR_API_KEY_HERE" />
I believe that when Google made changes to their API's on 04/20/2015 they modified the places API that the PlacePicker inherently uses. The solution that worked for me is as follows:
Go to your Google Developer Console (https://console.developers.google.com/project)
Navigate to your project if you have made one. If not go here: https://developers.google.com/console/help/
Navigate to "APIs & auth" then to "Credentials" on the left side of the console. I don't have enough rep to post a picture for guidance...
Create a new Key, this appears under Public API access in your Credentials window. You will need your SHA1 Fingerprint to receive the key. Directions that I used are here: How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?
The location that you input your SHA1 Fingerprint should be in this format:
(Your Key, 20 Hex values separated by ":");com.yourpackage.yourapp
Copy your API Key that is generated. You will need to add the fingerprint of each developer in the same format above for it to work for other developers.
Add your key to your AndroidManifest.xml
<application ...
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_api_key" />
... </application>
Where the "#string/google_api_key" /> is the key that you just generated. Place it in your strings.xml file as such:
<string name="google_api_key">yourkeyhere</string>
Clean and Rebuild your project. Should be working now. I don't think I left any steps out... Please comment if I have.
I have the same issue. I add Google map key
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_maps_key"/>` in manifest file.
The Place Picker closes immediately. Then, i also add
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_api_key" />
The Place Picker shows, but when i open map, my app was force close, and log like below.
RuntimeException: The API key can only be specified once. It is recommended that you use the meta-data tag with the name: com.google.android.maps.v2.API_KEY in the <application> element of AndroidManifest.xml
at com.google.maps.api.android.lib6.d.fb.a(Unknown Source)
at com.google.maps.api.android.lib6.a.g.a(Unknown Source)
at com.google.android.gms.maps.internal.CreatorImpl.b(Unknown Source)
at com.google.android.gms.maps.internal.CreatorImpl.b(Unknown Source)
at com.google.android.gms.maps.internal.i.onTransact(SourceFile:62)
at android.os.Binder.transact(Binder.java:364)
at com.google.android.gms.maps.internal.zzc$zza$zza.zzj(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment$zzb.zzqs(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment$zzb.zza(Unknown Source)
at com.google.android.gms.dynamic.zza.zza(Unknown Source)
at com.google.android.gms.dynamic.zza.onCreate(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment.onCreate(Unknown Source)
at android.support.v4.app.Fragment.performCreate(Fragment.java:1763)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:915)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1136)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:739)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1499)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:456)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:606)
at dalvik.system.NativeStart.main(Native Method)
I try to remove
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/google_maps_key"/>`
but keep
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_api_key" />
And It's working well, now, and I don't know why.
replace your meta data tag in the mainfeast .. it works for me ..
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="YOUR ANDROID KEY" />
with
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR ANDROID KEY" />
good luck
I had the same problems using the Places API. At the end, I figured out that there are different Google Places APIs especially for Android. Consequently, the API-Key that I was using was simply for the non-Android version.
Generate your key using this link:
https://developers.google.com/places/android-api/signup
in my case GO to Google COnsole then Enabled API for Android Google Places, then Go to Manifest.xml and put this code under
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
and dont forget to put Google API key
How i fixed this error was when getting an API key (On Google Developers Page) , the location where you enter your package name enter your complete package name. This is available in your android manifest!