I am trying to show a simple test ad in an android app. I was using this github project to test
https://github.com/googleads/googleads-mobile-android-examples/tree/master/admob/BannerExample
I have also gone through this example https://developers.google.com/admob/android/quick-start#configure_gradle
Im using IntelliJ and not Android Studio so havent been able to follow it exactly.
My problem is that the ads dont seem to be appearing. The logs are below and Ive added a couple of ** next to the lines that I think may be problematic. I have also added my code. I have not added anything to the manifest file (I havent seen any example where I have to)
I am using the emulator. Are there certain constraints on what emulator I can use? At the moment I never see any ad or any placeholder where the ad should be.
Any help greatly appreciated.
Thanks
CODE
Layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent" android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin"
tools:context=".EntryPoint">
<TextView android:text="#string/hello_world" android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<com.google.android.gms.ads.AdView
android:id="#+id/ad_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="#string/banner_ad_unit_id">
</com.google.android.gms.ads.AdView>
</RelativeLayout>
Code
private AdView mAdView;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
mAdView = (AdView) findViewById(R.id.ad_view);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.build();
mAdView.loadAd(adRequest);
}
/** Called when leaving the activity */
#Override
public void onPause() {
if (mAdView != null) {
mAdView.pause();
}
super.onPause();
}
/** Called when returning to the activity */
#Override
public void onResume() {
super.onResume();
if (mAdView != null) {
mAdView.resume();
}
}
/** Called before the activity is destroyed */
#Override
public void onDestroy() {
if (mAdView != null) {
mAdView.destroy();
}
super.onDestroy();
}
LOGS
5222-5222/? I/art﹕ Not late-enabling -Xcheck:jni (already on)
5222-5222/? I/art﹕ Late-enabling JIT
5222-5222/? I/art﹕ JIT created with code_cache_capacity=2MB compile_threshold=1000
** 5222-5222/my.app W/System﹕ ClassLoader referenced unknown path: /data/app/my.app-2/lib/arm
** 5222-5222/my.app W/GooglePlayServicesUtil﹕ Google Play services is missing.
5222-5222/my.app I/WebViewFactory﹕ Loading com.android.webview version 44.0.2403.119 (code 246011900)
5222-5222/my.app W/System﹕ ClassLoader referenced unknown path: /system/app/webview/lib/arm
5222-5222/my.app I/LibraryLoader﹕ Time to load native libraries: 44 ms (timestamps 1048-1092)
5222-5222/my.app I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
5222-5250/my.app W/art﹕ Long monitor contention event with owner method=void java.lang.Thread.nativeCreate(java.lang.Thread, long, boolean) from Thread.java:4294967294 waiters=0 for 206ms
5222-5231/my.app W/art﹕ Suspending all threads took: 91.755ms
5222-5222/my.app V/WebViewChromiumFactoryProvider﹕ Binding Chromium to main looper Looper (main, tid 1) {84fa4d0}
5222-5222/my.app I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
5222-5222/my.app I/chromium﹕ [INFO:library_loader_hooks.cc(120)] Chromium logging enabled: level = 0, default verbosity = 0
5222-5222/my.app I/BrowserStartupController﹕ Initializing chromium process, singleProcess=true
5222-5222/my.app W/art﹕ Attempt to remove non-JNI local reference, dumping thread
5222-5222/my.app E/SysUtils﹕ ApplicationContext is null in ApplicationStatus
5222-5222/my.app W/chromium﹕ [WARNING:resource_bundle.cc(285)] locale_file_path.empty()
** 5222-5222/my.app E/libEGL﹕ validate_display:255 error 3008 (EGL_BAD_DISPLAY)
** 5222-5222/my.app E/libEGL﹕ validate_display:255 error 3008 (EGL_BAD_DISPLAY)
** 5222-5222/my.app E/chromium﹕ [ERROR:gl_surface_egl.cc(327)] No suitable EGL configs found.
** 5222-5222/my.app E/chromium﹕ [ERROR:gl_surface_android.cc(23)] GLSurfaceEGL::InitializeOneOff failed.
5222-5222/my.app E/chromium﹕ [ERROR:browser_main_loop.cc(698)] GLSurface::InitializeOneOff failed
5222-5250/my.app W/art﹕ Long monitor contention event with owner method=void android.app.SharedPreferencesImpl$1.run() from SharedPreferencesImpl.java:90 waiters=1 for 280ms
5222-5247/my.app W/art﹕ Long monitor contention event with owner method=void java.lang.Thread.nativeCreate(java.lang.Thread, long, boolean) from Thread.java:4294967294 waiters=3 for 441ms
5222-5231/my.app W/art﹕ Suspending all threads took: 16.275ms
5222-5222/my.app E/DataReductionProxySettingListener﹕ No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
5222-5269/my.app W/AudioManagerAndroid﹕ Requires BLUETOOTH permission
** 5222-5222/my.app I/Ads﹕ Starting ad request.
5222-5231/my.app W/art﹕ Suspending all threads took: 9.629ms
5222-5222/my.app I/Choreographer﹕ Skipped 41 frames! The application may be doing too much work on its main thread.
5222-5222/my.app D/gralloc_goldfish﹕ Emulator without GPU emulation detected.
5222-5231/my.app W/art﹕ Suspending all threads took: 140.144ms
** 5222-5246/my.app W/GooglePlayServicesUtil﹕ Google Play services is missing.
** 5222-5246/my.app W/GooglePlayServicesUtil﹕ Google Play services is missing.
5222-5267/my.app W/chromium﹕ [WARNING:data_reduction_proxy_config.cc(423)] SPDY proxy OFF at startup
5222-5222/my.app W/art﹕ Attempt to remove non-JNI local reference, dumping thread
5222-5222/my.app W/AwContents﹕ onDetachedFromWindow called when already detached. Ignoring
5222-5222/my.app W/art﹕ Attempt to remove non-JNI local reference, dumping thread
5222-5222/my.app W/art﹕ Attempt to remove non-JNI local reference, dumping thread
5222-5303/my.app A/chromium﹕ [FATAL:gl_surface_android.cc(58)] Check failed: kGLImplementationNone != GetGLImplementation() (0 vs. 0)
5222-5303/my.app W/google-breakpad﹕ ### ### ### ### ### ### ### ### ### ### ### ### ###
5222-5303/my.app W/google-breakpad﹕ Chrome build fingerprint:
5222-5303/my.app W/google-breakpad﹕ 1.04
5222-5303/my.app W/google-breakpad﹕ 5
5222-5303/my.app W/google-breakpad﹕ 023f32a1-4862-425f-a49b-e5b1792614ed
5222-5303/my.app W/google-breakpad﹕ ### ### ### ### ### ### ### ### ### ### ### ### ###
5222-5303/my.app E/chromium﹕ ### WebView Version 44.0.2403.119 (code 246011900)
5222-5303/my.app A/libc﹕ Fatal signal 6 (SIGABRT), code -6 in tid 5303 (GpuThread)
Thanks
Create emulator that is targeted to Google APIs, not to android.
Related
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 need to write the output file in external storage with applied effects but don't know how to do this. Any help will be highly appreciated to make audio output mp3 or mp4 file with effects. I have successfully done the pitch change of real time, I have used some code of write file to external storage but the file generated is only 0 bytes and corrupted.I have used below code
const char *output1 = "/storage/emulated/0/Music/123456.mp3";
const char *openError = decoder->open(input, false, 0, 0, 0);
if (openError) {
delete decoder;
return false;
};
FILE *fd = createWAV(output1, decoder->samplerate, 2);
if (!fd) {
delete decoder;
return false;
};
float effectMix = 0.5f;
SuperpoweredFX *effect = NULL;
if (effectId == 0) {
player->setPitchShift(10);
effect = new SuperpoweredEcho(decoder->samplerate);
((SuperpoweredEcho *) effect)->setMix(effectMix);
} else if (effectId == 1) {
effect = new SuperpoweredReverb(decoder->samplerate);
((SuperpoweredReverb *) effect)->setMix(effectMix);
}
if (effect == NULL) {
delete decoder;
return false;
}
effect->enable(true);
short int *intBuffer = (short int *) malloc(
decoder->samplesPerFrame * 2 * sizeof(short int) + 16384);
float *floatBuffer = (float *) malloc(decoder->samplesPerFrame * 2 * sizeof(float) + 1024);
unsigned int samplesDecoded;
while (true) {
samplesDecoded = decoder->samplesPerFrame;
if (decoder->decode(intBuffer, &samplesDecoded) == SUPERPOWEREDDECODER_ERROR) {
break;
}
if (samplesDecoded < 1) {
break;
}
SuperpoweredShortIntToFloat(intBuffer, floatBuffer, samplesDecoded);
effect->process(floatBuffer, floatBuffer, samplesDecoded);
// Convert the PCM samples from 32-bit floating point to 16-bit integer.
SuperpoweredFloatToShortInt(floatBuffer, intBuffer, samplesDecoded);
}
fwrite(intBuffer, 1, samplesDecoded * 4, fd);
closeWAV(fd);
delete decoder;
delete effect;
free(intBuffer);
free(floatBuffer);
return true;
Please help with this code.
I have error like below.
11-14 14:48:35.447 10065-10065/? I/art: Late-enabling -Xcheck:jni
VMHOOK: rlim_cur : 0 pid:10065
11-14 14:48:35.497 10065-10070/? E/art: Failed sending reply to debugger: Broken pipe
11-14 14:48:35.507 10065-10070/? I/art: Debugger is no longer active
11-14 14:48:35.537 10065-10065/? I/MultiDex: VM with version 2.1.0 has multidex support
Installing application
VM has multidex support, MultiDex support library is disabled.
11-14 14:48:35.627 10065-10065/? V/FA: Registered activity lifecycle callback
11-14 14:48:35.647 10065-10065/? D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
11-14 14:48:35.647 10065-10065/? I/FirebaseInitProvider: FirebaseApp initialization successful
11-14 14:48:35.847 10065-10080/? V/FA: Collection enabled
App package, google app id: com.korakoepitchchanger, 1:872304933700:android:c6dbb37cfd23f040
11-14 14:48:35.847 10065-10080/? I/FA: App measurement is starting up, version: 13001
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.korakoepitchchanger
11-14 14:48:35.847 10065-10080/? D/FA: Debug-level message logging enabled
11-14 14:48:35.947 10065-10080/? V/FA: Connecting to remote service
11-14 14:48:36.127 10065-10080/? V/FA: Connection attempt already in progress
11-14 14:48:36.497 10065-10065/? V/FA: onActivityCreated
11-14 14:48:36.557 10065-10080/com.korakoepitchchanger I/FA: Tag Manager is not found and thus will not be used
11-14 14:48:36.587 10065-10080/com.korakoepitchchanger D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=SplashActivity, firebase_screen_id(_si)=2861861576925568549}]
11-14 14:48:36.657 10065-10080/com.korakoepitchchanger V/FA: Connection attempt already in progress
Connection attempt already in progress
Activity resumed, time: 187857395
11-14 14:48:36.707 10065-10080/com.korakoepitchchanger D/FA: Connected to remote service
11-14 14:48:36.707 10065-10080/com.korakoepitchchanger V/FA: Processing queued up service tasks: 4
11-14 14:48:37.077 10065-10080/com.korakoepitchchanger V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 530
Activity paused, time: 187857925
11-14 14:48:37.217 10065-10065/com.korakoepitchchanger V/FA: onActivityCreated
11-14 14:48:37.377 10065-10065/com.korakoepitchchanger I/CrashlyticsCore: Initializing Crashlytics 2.6.3.25
11-14 14:48:37.437 10065-10164/com.korakoepitchchanger D/libc: [NET] android_getaddrinfofornetcontext+,hn 24(0x73657474696e67),sn(),hints(known),family 0,flags 1024, proc=com.korakoepitchchanger
[NET] android_getaddrinfo_proxy get netid:0
11-14 14:48:37.457 10065-10164/com.korakoepitchchanger D/libc: [NET] android_getaddrinfo_proxy-, success
11-14 14:48:37.997 10065-10065/com.korakoepitchchanger I/DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:10900
Selected remote version of com.google.android.gms.ads.dynamite, version >= 10900
11-14 14:48:38.097 10065-10065/com.korakoepitchchanger W/System: ClassLoader referenced unknown path: /data/data/com.google.android.gms/app_chimera/m/00000034/n/arm64-v8a
11-14 14:48:38.167 10065-10065/com.korakoepitchchanger D/DynamitePackage: Instantiated singleton DynamitePackage.
Instantiating com.google.android.gms.ads.ChimeraMobileAdsSettingManagerCreatorImpl
11-14 14:48:38.797 10065-10065/com.korakoepitchchanger I/WebViewFactory: Loading com.google.android.webview version 70.0.3538.80 (code 353808050)
11-14 14:48:39.077 10065-10164/com.korakoepitchchanger D/libc: [NET] android_getaddrinfofornetcontext+,hn 19(0x6170692e637261),sn(),hints(known),family 0,flags 1024, proc=com.korakoepitchchanger
11-14 14:48:39.087 10065-10164/com.korakoepitchchanger D/libc: [NET] android_getaddrinfo_proxy get netid:0
11-14 14:48:39.107 10065-10164/com.korakoepitchchanger D/libc: [NET] android_getaddrinfo_proxy-, success
11-14 14:48:39.317 10065-10075/com.korakoepitchchanger I/art: Background sticky concurrent mark sweep GC freed 8353(1299KB) AllocSpace objects, 5(100KB) LOS objects, 1% free, 101MB/102MB, paused 1.796ms total 102.918ms
11-14 14:48:39.327 10065-10065/com.korakoepitchchanger I/art: Rejecting re-init on previously-failed class java.lang.Class<hs>
Rejecting re-init on previously-failed class java.lang.Class<hs>
11-14 14:48:39.387 10065-10065/com.korakoepitchchanger I/cr_LibraryLoader: Time to load native libraries: 2 ms (timestamps 1635-1637)
11-14 14:48:39.647 10065-10065/com.korakoepitchchanger I/chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
11-14 14:48:39.657 10065-10065/com.korakoepitchchanger I/cr_LibraryLoader: Expected native library version number "70.0.3538.80", actual native library version number "70.0.3538.80"
11-14 14:48:39.807 10065-10065/com.korakoepitchchanger I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
11-14 14:48:39.867 10065-10075/com.korakoepitchchanger W/art: Suspending all threads took: 54.598ms
11-14 14:48:39.877 10065-10075/com.korakoepitchchanger I/art: Background sticky concurrent mark sweep GC freed 10288(811KB) AllocSpace objects, 2(40KB) LOS objects, 0% free, 101MB/102MB, paused 57.343ms total 82.106ms
11-14 14:48:40.657 10065-10164/com.korakoepitchchanger W/CrashlyticsCore: Expected method missing: registerOnMeasurementEventListener
java.lang.NoSuchMethodException: parameter type is null
at java.lang.Class.getMethod(Class.java:616)
at java.lang.Class.getDeclaredMethod(Class.java:586)
at com.crashlytics.android.c.u.a(Unknown Source)
at com.crashlytics.android.c.u.a(Unknown Source)
at com.crashlytics.android.c.k.a(Unknown Source)
at com.crashlytics.android.c.l.d(Unknown Source)
at com.crashlytics.android.c.l.f(Unknown Source)
at b.a.a.a.h.a(Unknown Source)
at b.a.a.a.h.a(Unknown Source)
at b.a.a.a.a.c.a$2.call(Unknown Source)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
11-14 14:48:41.177 10065-10317/com.korakoepitchchanger W/cr_media: Requires BLUETOOTH permission
11-14 14:48:41.207 10065-10337/com.korakoepitchchanger E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
11-14 14:48:41.207 10065-10337/com.korakoepitchchanger I/Adreno: QUALCOMM build : 8249e7b, Iacb76f3f7d
Build Date : 03/22/16
OpenGL ES Shader Compiler Version: XE031.06.00.05
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.BR.1.2.6_RB1.06.00.01.179.016
Remote Branch : NONE
Reconstruct Branch : NOTHING
11-14 14:48:41.427 10065-10065/com.korakoepitchchanger D/DynamitePackage: Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
11-14 14:48:41.437 10065-10313/com.korakoepitchchanger D/libc: [NET] android_getaddrinfofornetcontext+,hn 27(0x676f6f676c6561),sn(),hints(known),family 0,flags 1024, proc=com.korakoepitchchanger
[NET] android_getaddrinfo_proxy get netid:0
11-14 14:48:41.457 10065-10313/com.korakoepitchchanger D/libc: [NET] android_getaddrinfo_proxy-, success
11-14 14:48:41.497 10065-10337/com.korakoepitchchanger W/VideoCapabilities: Unrecognized profile 2130706433 for video/avc
11-14 14:48:41.577 10065-10337/com.korakoepitchchanger W/VideoCapabilities: Unsupported mime video/x-ms-wmv
11-14 14:48:41.597 10065-10337/com.korakoepitchchanger W/AudioCapabilities: Unsupported mime audio/qcelp
11-14 14:48:41.607 10065-10337/com.korakoepitchchanger W/AudioCapabilities: Unsupported mime audio/x-ms-wma
Unsupported mime audio/qcelp
11-14 14:48:41.607 10065-10337/com.korakoepitchchanger W/VideoCapabilities: Unsupported mime video/x-ms-wmv
11-14 14:48:41.617 10065-10337/com.korakoepitchchanger W/AudioCapabilities: Unsupported mime audio/ac3
11-14 14:48:41.637 10065-10065/com.korakoepitchchanger I/Ads: Updating ad debug logging enablement.
11-14 14:48:41.677 10065-10075/com.korakoepitchchanger W/art: Suspending all threads took: 8.034ms
11-14 14:48:41.687 10065-10075/com.korakoepitchchanger I/art: Background sticky concurrent mark sweep GC freed 3313(196KB) AllocSpace objects, 0(0B) LOS objects, 0% free, 102MB/102MB, paused 12.936ms total 70.241ms
11-14 14:48:41.747 10065-10075/com.korakoepitchchanger W/art: Suspending all threads took: 8.534ms
11-14 14:48:41.757 10065-10075/com.korakoepitchchanger I/art: Background partial concurrent mark sweep GC freed 12066(895KB) AllocSpace objects, 2(120KB) LOS objects, 13% free, 102MB/118MB, paused 11.969ms total 73.844ms
11-14 14:48:41.777 10065-10065/com.korakoepitchchanger I/Ads: Starting ad request.
SDK version: afma-sdk-a-v14574021.12451000.1
Use AdRequest.Builder.addTestDevice("8884694ABCF6A031A5CA1B31EF06F481") to get test ads on this device.
11-14 14:48:41.777 10065-10065/com.korakoepitchchanger W/Ads: Not retrying to fetch app settings
11-14 14:48:41.797 10065-10337/com.korakoepitchchanger I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
11-14 14:48:41.957 10065-10080/com.korakoepitchchanger D/FA: Logging event (FE): _vs, Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=SplashActivity, firebase_previous_id(_pi)=2861861576925568549, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=2861861576925568551}]
11-14 14:48:42.047 10065-10236/com.korakoepitchchanger W/Ads: Update ad debug logging enablement as false
11-14 14:48:42.067 10065-10080/com.korakoepitchchanger V/FA: Activity resumed, time: 187862712
11-14 14:48:42.847 10065-10077/com.korakoepitchchanger W/Ads: There was a problem getting an ad response. ErrorCode: 0
11-14 14:48:42.877 10065-10080/com.korakoepitchchanger D/FA: Logging event (FE): ad_query(_aq), Bundle[{firebase_event_origin(_o)=am, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=2861861576925568551, ad_event_id(_aeid)=2861861576925568550}]
11-14 14:48:42.927 10065-10065/com.korakoepitchchanger W/Ads: Failed to load ad: 0
11-14 14:48:43.237 10065-10065/com.korakoepitchchanger E/=>>>: Visible
11-14 14:48:47.897 10065-10080/com.korakoepitchchanger V/FA: Activity paused, time: 187868740
11-14 14:48:47.897 10065-10080/com.korakoepitchchanger D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=6028, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=2861861576925568551}]
11-14 14:48:51.817 10065-10080/com.korakoepitchchanger V/FA: Activity resumed, time: 187872663
Screen exposed for less than 1000 ms. Event not sent. time: 7
11-14 14:48:51.827 10065-10080/com.korakoepitchchanger V/FA: Activity paused, time: 187872669
11-14 14:48:52.017 10065-10065/com.korakoepitchchanger V/FA: onActivityCreated
11-14 14:48:52.087 10065-10065/com.korakoepitchchanger I/>>>: applied
11-14 14:48:52.097 10065-10065/com.korakoepitchchanger I/>>>: applied
11-14 14:48:52.097 10065-10065/com.korakoepitchchanger E/>>>: /storage/emulated/0/Music/123.mp3
11-14 14:48:52.187 10065-10065/com.korakoepitchchanger I/>>>: applied
11-14 14:48:52.207 10065-10065/com.korakoepitchchanger E/>>>>: 30
11-14 14:48:52.257 10065-10080/com.korakoepitchchanger D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=MainActivity, firebase_previous_id(_pi)=2861861576925568551, firebase_screen_class(_sc)=Temp2Activity, firebase_screen_id(_si)=2861861576925568552}]
11-14 14:48:52.377 10065-10080/com.korakoepitchchanger V/FA: Activity resumed, time: 187873057
11-14 14:48:53.137 10065-10065/com.korakoepitchchanger W/MediaPlayer: Couldn't open file on client side; trying server side: java.io.FileNotFoundException: No content provider: /storage/emulated/0/Music/123.mp3
11-14 14:48:53.137 10065-10065/com.korakoepitchchanger V/MediaPlayer: network type=wifi
11-14 14:48:53.167 10065-10065/com.korakoepitchchanger I/MediaPlayer: It's not a proxy project.
11-14 14:48:53.167 10065-10065/com.korakoepitchchanger D/MediaPlayer: ANDROID_HTC_INVOKE_GET_CALLING_PROCESS packageName: com.korakoepitchchanger
11-14 14:48:53.247 10065-10065/com.korakoepitchchanger D/MediaPlayer: setSubtitleAnchor in MediaPlayer
11-14 14:48:53.307 10065-10065/com.korakoepitchchanger E/>>>>: 30
11-14 14:48:54.307 10065-10065/com.korakoepitchchanger E/>>>>: 30
11-14 14:48:54.577 10065-10761/com.korakoepitchchanger A/libc: invalid address or address of corrupt block 0x5570b17e30 passed to dlfree
11-14 14:48:54.777 10065-10761/com.korakoepitchchanger W/google-breakpad: Failed to generate minidump.
11-14 14:48:54.877 10065-10761/com.korakoepitchchanger W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
Chrome build fingerprint:
70.0.3538.80
353808050
### ### ### ### ### ### ### ### ### ### ### ### ###
11-14 14:48:54.877 10065-10761/com.korakoepitchchanger A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xdeadbaad in tid 10761 (AsyncTask #1)
11-14 14:48:56.687 10065-10759/com.korakoepitchchanger W/AudioTrack: releaseBuffer() track 0x5570bad4f0 disabled due to previous underrun, restarting
error log shows some firebase issues but one major issue found in the code is you have put
fwrite(intBuffer, 1, samplesDecoded * 4, fd);
outside the while loop.
It should be inside it as the intBuffer gets filled with chunk of audio data in each iteration.
I found here Android Studio - SDK is out of date or is missing templates I need to update in my SDK tools.
I see no option for Firebase.
I followed the AdMob instructions. A 403 "unable to show ad" error showed, then I switched my ad unit type to "Banner" and used the test banner unit id "ca-app-pub-3940256099942544/6300978111".
My onCreate in main activity:
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MobileAds.initialize(this, "my addmob id ");
mAdView = findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
initialiseView();
}
My layout:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
<com.google.android.gms.ads.AdView
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-3940256099942544/6300978111"
android:layout_below="#+id/linearLayout">
</com.google.android.gms.ads.AdView>
</RelativeLayout>
and my logs:
W/GooglePlayServicesUtil: Google Play Store is missing.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
W/GooglePlayServicesUtil: Google Play Store is missing.
W/GooglePlayServicesUtil: Google Play Store is missing.
W/GooglePlayServicesUtil: Google Play services is missing.
W/GooglePlayServicesUtil: Google Play Store is missing.
W/GooglePlayServicesUtil: Google Play Store is missing.
I/Ads: Starting ad request.
I/Ads: Use AdRequest.Builder.addTestDevice("C8DCA36186E6C4138C4E71BB102F78D2") to get test ads on this device.
W/GooglePlayServicesUtil: Google Play Store is missing.
W/GooglePlayServicesUtil: Google Play Store is missing.
W/Ads: Invoke Firebase method getInstance error.
W/Ads: The Google Mobile Ads SDK will not integrate with Firebase. Admob/Firebase integration requires the latest Firebase SDK jar, but Firebase SDK is either missing or out of date
W/GooglePlayServicesUtil: Google Play Store is missing.
W/GooglePlayServicesUtil: Google Play Store is missing.
W/System: ClassLoader referenced unknown path: /system/app/webview/lib/x86
W/art: Before Android 4.1, method double java.util.concurrent.ThreadLocalRandom.internalNextDouble(double, double) would have incorrectly overridden the package-private method in java.util.Random
W/art: Before Android 4.1, method int java.util.concurrent.ThreadLocalRandom.internalNextInt(int, int) would have incorrectly overridden the package-private method in java.util.Random
W/art: Before Android 4.1, method long java.util.concurrent.ThreadLocalRandom.internalNextLong(long, long) would have incorrectly overridden the package-private method in java.util.Random
I/WebViewFactory: Loading com.android.webview version 51.0.2704.91 (code 275509110)
I/cr_LibraryLoader: Time to load native libraries: 6 ms (timestamps 8593-8599)
I/cr_LibraryLoader: Expected native library version number "51.0.2704.91", actual native library version number "51.0.2704.91"
D/MediaPlayer: setSubtitleAnchor in MediaPlayer
D/MediaPlayer: setSubtitleAnchor in MediaPlayer
D/MediaPlayer: setSubtitleAnchor in MediaPlayer
I/art: Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.internal.zzflm>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/customtabs/CustomTabsServiceConnection;
I/art: at boolean com.google.android.gms.internal.zznn.zzi(android.content.Context) ((null):-1)
I/art: at void com.google.android.gms.internal.zzabv.<init>(android.content.Context, com.google.android.gms.internal.zzabu) ((null):-1)
I/art: at java.lang.Object com.google.android.gms.internal.zzabx.call() ((null):-1)
I/art: at void com.google.android.gms.internal.zzago.run() ((null):-1)
I/art: at java.lang.Object java.util.concurrent.Executors$RunnableAdapter.call() (Executors.java:428)
I/art: at void java.util.concurrent.FutureTask.run() (FutureTask.java:237)
I/art: at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1133)
I/art: at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:607)
I/art: at void java.lang.Thread.run() (Thread.java:761)
I/art: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.customtabs.CustomTabsServiceConnection" on path: DexPathList[[zip file "/data/app/zapbear.quantumproductions.com.zappybear-2/base.apk"],nativeLibraryDirectories=[/data/app/zapbear.quantumproductions.com.zappybear-2/lib/x86, /system/lib, /vendor/lib]]
I/art: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
I/art: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
I/art: at boolean com.google.android.gms.internal.zznn.zzi(android.content.Context) ((null):-1)
I/art: at void com.google.android.gms.internal.zzabv.<init>(android.content.Context, com.google.android.gms.internal.zzabu) ((null):-1)
I/art: at java.lang.Object com.google.android.gms.internal.zzabx.call() ((null):-1)
I/art: at void com.google.android.gms.internal.zzago.run() ((null):-1)
I/art: at java.lang.Object java.util.concurrent.Executors$RunnableAdapter.call() (Executors.java:428)
I/art: at void java.util.concurrent.FutureTask.run() (FutureTask.java:237)
I/art: at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1133)
I/art: at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:607)
I/art: at void java.lang.Thread.run() (Thread.java:761)
I/art: [ 11-20 01:41:39.886 2681: 2681 D/ ]
HostConnection::get() New Host Connection established 0xd9e15090, tid 2681
V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {f36c082}
I/cr_LibraryLoader: Expected native library version number "51.0.2704.91", actual native library version number "51.0.2704.91"
I/chromium: [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0
I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
E/ApkAssets: Error while loading asset assets/natives_blob_64.bin: java.io.FileNotFoundException: assets/natives_blob_64.bin
E/ApkAssets: Error while loading asset assets/snapshot_blob_64.bin: java.io.FileNotFoundException: assets/snapshot_blob_64.bin
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
E/libEGL: load_driver(/system/lib/egl/libGLES_emulation.so): dlopen failed: library "/system/lib/egl/libGLES_emulation.so" not found
D/libEGL: loaded /system/lib/egl/libEGL_emulation.so
D/libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008d57
W/cr_media: Requires BLUETOOTH permission
I/cr_DRP: No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
D/cr_Ime: [InputMethodManagerWrapper.java:30] Constructor
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
I/cr_Ime: ImeThread is not enabled.
E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
[ 11-20 01:41:40.059 2681: 2747 D/ ]
HostConnection::get() New Host Connection established 0xf2e305a0, tid 2747
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
[ 11-20 01:41:40.076 2681: 2779 D/ ]
HostConnection::get() New Host Connection established 0xd54ee1b0, tid 2779
W/EGL_emulation: eglSurfaceAttrib not implemented
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xd9ee1e80, error=EGL_SUCCESS
V/assigned screenW: 1080.0
V/The jump force is: 21.637500000000003
E/chromium: [ERROR:gles2_cmd_decoder.cc(2167)] [GroupMarkerNotSet(crbug.com/242999)!:54DB7FD8]GL ERROR :GL_INVALID_OPERATION : BackFramebuffer::Create: <- error from previous GL command
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 2681
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
I/chromium: [INFO:CONSOLE(0)] "Document was loaded from Application Cache with manifest https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.appcache", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
I/chromium: [INFO:CONSOLE(0)] "Application Cache Checking event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
I/chromium: [INFO:CONSOLE(0)] "Application Cache NoUpdate event", source: https://googleads.g.doubleclick.net/mads/static/mad/sdk/native/sdk-core-v40.html (0)
W/GooglePlayServicesUtil: Google Play services is missing.
D/cr_Ime: [InputMethodManagerWrapper.java:30] Constructor
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
W/Ads: Not enough space to show ad. Needs 320x49 dp, but only has 320x0 dp.
E/chromium: [ERROR:gles2_cmd_decoder.cc(2167)] [GroupMarkerNotSet(crbug.com/242999)!:5420DED3]GL ERROR :GL_INVALID_OPERATION : BackFramebuffer::Create: <- error from previous GL command
I/cr_Ime: ImeThread is not enabled.
W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 2681
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
W/Ads: Not enough space to show ad. Needs 320x49 dp, but only has 320x0 dp.
I/Ads: Scheduling ad refresh 60000 milliseconds from now.
D/cr_Ime: [InputMethodManagerWrapper.java:30] Constructor
W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
I/cr_Ime: ImeThread is not enabled.
I/Ads: Ad finished loading.
but I see no ad, just my app as usual.
I created a website which is not published yet, so I am not gonna share it now. But it's a website build with PHP Framework Nette and Twitter Bootstrap as a Frontend framework.
And I wanted to create simple Android and iOS app. Both apps with webview. It works fine on iOS, however, I cannot make work on Android. I browsed tons of similar issues, but none of them helped me.
So, what do I actually need?
Geolocation Access
Showing my website in webview
My code:
package com.URL.URL;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.Window;
import android.webkit.GeolocationPermissions;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.webkit.WebChromeClient;
import com.google.android.gms.appindexing.Action;
import com.google.android.gms.appindexing.AppIndex;
import com.google.android.gms.common.api.GoogleApiClient;
public class MainActivity extends Activity {
/**
* ATTENTION: This was auto-generated to implement the App Indexing API.
* See https://g.co/AppIndexing/AndroidStudio for more information.
*/
private GoogleApiClient client;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
WebView view = (WebView) this.findViewById(R.id.webView);
view.getSettings().setDomStorageEnabled(true);
view.getSettings().setJavaScriptEnabled(true);
view.getSettings().setGeolocationEnabled(true);
view.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
view.getSettings().setAppCacheEnabled(true);
view.getSettings().setDatabaseEnabled(true);
//view.getSettings().setUserAgentString("Mozilla/5.0 (Linux; U;`Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17");
view.setWebViewClient(new MyBrowser());
view.setWebChromeClient(new WebChromeClient() {
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
callback.invoke(origin, true, false);
}
});
view.loadUrl("https://www.URL.com");
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
}
private class MyBrowser extends WebViewClient {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
#Override
public void onStart() {
super.onStart();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
client.connect();
Action viewAction = Action.newAction(
Action.TYPE_VIEW, // TODO: choose an action type.
"Main Page", // TODO: Define a title for the content shown.
// TODO: If you have web page content that matches this app activity's content,
// make sure this auto-generated web page URL is correct.
// Otherwise, set the URL to null.
Uri.parse("http://host/path"),
// TODO: Make sure this auto-generated app URL is correct.
Uri.parse("android-app://com.URL.URL/http/host/path")
);
AppIndex.AppIndexApi.start(client, viewAction);
}
#Override
public void onStop() {
super.onStop();
// ATTENTION: This was auto-generated to implement the App Indexing API.
// See https://g.co/AppIndexing/AndroidStudio for more information.
Action viewAction = Action.newAction(
Action.TYPE_VIEW, // TODO: choose an action type.
"Main Page", // TODO: Define a title for the content shown.
// TODO: If you have web page content that matches this app activity's content,
// make sure this auto-generated web page URL is correct.
// Otherwise, set the URL to null.
Uri.parse("http://host/path"),
// TODO: Make sure this auto-generated app URL is correct.
Uri.parse("android-app://com.URL.URL/http/host/path")
);
AppIndex.AppIndexApi.end(client, viewAction);
client.disconnect();
}
}
This did not work when I tried it in android emulators (4.4, 5.1, 6, 7) but it worked when I downloaded it on my old Samsung where is android version 4.4.4.
I don't know if there is not something wrong with my website, because when I tried to load google.com it works fine..But even when I entered just the string "aaa" to my menu and tried to open it in webview, it did not work.
Screenshots of my website in Webview and in browser:
WebView
Web Browser
I also wanted to add geolocation access popup window.
All of that works on iOS, but I really do not know how to do that on Android. I am primarily Web Developer, so please, forgive me any messy Android code, it's actually for the first time I am working with Android Studio. Thank you for any help!
PS: I wanna open it in the app not as a new browser tab.
Errors:
09-16 15:01:01.578 2390-2512/com.URL.URL E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)
09-16 15:01:01.972 2390-2512/com.URL.URL E/chromium: [ERROR:gles2_cmd_decoder.cc(2167)] [GroupMarkerNotSet(crbug.com/242999)!:A08E32ECFE7F0000]GL ERROR :GL_INVALID_OPERATION : BackFramebuffer::Create: <- error from previous GL command
09-16 15:01:06.059 2390-2390/com.URL.URL E/cr_LocationProvider: Caught security exception while registering for location updates from the system. The application does not have sufficient geolocation permissions.
Warnings:
09-16 15:01:00.562 2390-2390/com.URL.URL W/System: ClassLoader referenced unknown path: /system/app/webview/lib/x86_64
09-16 15:01:00.951 2390-2468/com.URL.URL W/cr_media: Requires BLUETOOTH permission
09-16 15:01:01.116 2390-2390/com.URL.URL W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
09-16 15:01:01.353 2390-2390/com.URL.URL W/gralloc_ranchu: Gralloc pipe failed
09-16 15:01:01.526 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:01.540 2390-2397/com.URL.URL W/art: Suspending all threads took: 9.484ms
09-16 15:01:02.184 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:02.770 2390-2390/com.URL.URL W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 2390
09-16 15:01:02.933 2390-2390/com.URL.URL W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 2390
09-16 15:01:03.059 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:03.597 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:03.980 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:04.058 2390-2397/com.URL.URL W/art: Suspending all threads took: 26.284ms
09-16 15:01:05.010 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:05.346 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:05.704 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:06.044 2390-2397/com.URL.URL W/art: Suspending all threads took: 10.006ms
09-16 15:01:06.182 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:06.216 2390-2401/com.URL.URL W/art: Suspending all threads took: 8.273ms
09-16 15:01:06.485 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:06.729 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:07.035 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:07.277 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
09-16 15:01:10.719 2390-2390/com.URL.URL W/art: Attempt to remove non-JNI local reference, dumping thread
Manifest:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
seems related to hardware draw of chromium
emulator is creating with gpu off by default
Try setting "gpu=on" option in emulator
and add "android:hardwareAccelerated="true" in your manifest
I try to use cordova in windows for create a simple android app. I create the first project using command cordova create hello com.example.hello HelloWorld
I add the Android platform, I try to build and build success, but when I emulate the app don't start and receive the error on screen:
Unfortunaly, HelloWorld has stopped.
logcat:
03-16 16:44:19.073 2442-2442/com.example.hello W/System﹕ ClassLoader referenced unknown path: /data/app/com.example.hello-1/lib/x86
03-16 16:44:19.266 2442-2442/com.example.hello I/WebViewFactory﹕ Loading com.android.webview version 44.0.2403.119 (code 246011910)
03-16 16:44:19.310 2442-2442/com.example.hello W/System﹕ ClassLoader referenced unknown path: /system/app/webview/lib/x86
03-16 16:44:19.377 2442-2442/com.example.hello I/LibraryLoader﹕ Time to load native libraries: 62 ms (timestamps 9389-9451)
03-16 16:44:19.377 2442-2442/com.example.hello I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
03-16 16:44:19.392 2442-2442/com.example.hello I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
03-16 16:44:19.392 2442-2442/com.example.hello I/chromium﹕ [INFO:library_loader_hooks.cc(120)] Chromium logging enabled: level = 0, default verbosity = 0
03-16 16:44:19.483 2442-2442/com.example.hello I/BrowserStartupController﹕ Initializing chromium process, singleProcess=true
03-16 16:44:19.484 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:19.486 2442-2442/com.example.hello E/SysUtils﹕ ApplicationContext is null in ApplicationStatus
03-16 16:44:19.568 2442-2442/com.example.hello W/chromium﹕ [WARNING:resource_bundle.cc(285)] locale_file_path.empty()
03-16 16:44:19.571 2442-2442/com.example.hello E/libEGL﹕ validate_display:255 error 3008 (EGL_BAD_DISPLAY)
03-16 16:44:19.571 2442-2442/com.example.hello E/libEGL﹕ validate_display:255 error 3008 (EGL_BAD_DISPLAY)
03-16 16:44:19.571 2442-2442/com.example.hello E/chromium﹕ [ERROR:gl_surface_egl.cc(327)] No suitable EGL configs found.
03-16 16:44:19.571 2442-2442/com.example.hello E/chromium﹕ [ERROR:gl_surface_android.cc(23)] GLSurfaceEGL::InitializeOneOff failed.
03-16 16:44:19.571 2442-2442/com.example.hello E/chromium﹕ [ERROR:browser_main_loop.cc(698)] GLSurface::InitializeOneOff failed
03-16 16:44:19.628 2442-2468/com.example.hello W/AudioManagerAndroid﹕ Requires BLUETOOTH permission
03-16 16:44:19.667 2442-2442/com.example.hello E/DataReductionProxySettingListener﹕ No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
03-16 16:44:19.757 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:19.762 2442-2442/com.example.hello W/AwContents﹕ onDetachedFromWindow called when already detached. Ignoring
03-16 16:44:20.182 2442-2442/com.example.hello D/SystemWebViewEngine﹕ CordovaWebView is running on device made by: unknown
03-16 16:44:20.188 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:20.188 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:20.246 2442-2452/com.example.hello I/art﹕ Background sticky concurrent mark sweep GC freed 7609(505KB) AllocSpace objects, 3(60KB) LOS objects, 64% free, 861KB/2MB, paused 1.373ms total 448.240ms
03-16 16:44:20.310 2442-2466/com.example.hello W/chromium﹕ [WARNING:data_reduction_proxy_config.cc(423)] SPDY proxy OFF at startup
03-16 16:44:20.368 2442-2442/com.example.hello D/gralloc_goldfish﹕ Emulator without host-side GPU emulation detected.
03-16 16:44:20.376 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:20.410 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:20.586 2442-2452/com.example.hello I/art﹕ Background partial concurrent mark sweep GC freed 1447(97KB) AllocSpace objects, 2(2MB) LOS objects, 35% free, 926KB/1438KB, paused 2.668ms total 209.255ms
03-16 16:44:20.587 2442-2480/com.example.hello A/chromium﹕ [FATAL:gl_surface_android.cc(58)] Check failed: kGLImplementationNone != GetGLImplementation() (0 vs. 0)
03-16 16:44:20.587 2442-2480/com.example.hello A/libc﹕ Fatal signal 6 (SIGABRT), code -6 in tid 2480 (GpuThread)
This is almost exactly the same error as Error in Android Programming while connecting to Phonegap. It seems to be related to this bug from ionic.
According to them, "switching from Snapshot to Host GPU solved this problem."
This makes sense as three of the last errors are related to opengl.
Note to various moderators: I tried to close one as a duplicate of the other, but that can't be done because there's no answer. Tried looking on meta for 'duplicate unanswered' but they simply say not to do it. I figure I'll post a possible answer and if either one is accepted, I'll close the other as a dup.