I am developing an app in which I am implementing google text recognition.
This is the link that I am following :
https://developers.google.com/ml-kit/vision/text-recognition/android
I have done everything described there but still I am getting error.
This is what I have in my gradle file:
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.0'
I have these lines too in my manifest file:
<uses-permission android:name="android.permission.INTERNET"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<meta-data
android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="ocr" />
I am performing a click on a button OCR and then I am calling below lines of code:
InputImage inputImage = InputImage.fromBitmap(bitmap, 0);
TextRecognition.getClient().process(inputImage).addOnSuccessListener(new OnSuccessListener<Text>() {
#Override
public void onSuccess(Text text) {
string = text.getText();
success = true;
}
}).addOnFailureListener(new OnFailureListener() {
#Override
public void onFailure(#NonNull Exception e) {
e.printStackTrace();
success = false;
}
});
Error is thrown as soon as I Click on OCR button.
Following is the stack trace:
W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite.ocr not found.
E/LibraryVersion: Failed to get app version for libraryName: text-recognition
I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite.ocr:0 and remote module com.google.android.gms.vision.dynamite.ocr:0
D/TextNativeHandle: Cannot load feature, fall back to load dynamite module.
W/scanner.camsca: Unsupported class loader
W/scanner.camsca: Skipping duplicate class check due to unsupported classloader
I/DynamiteModule: Considering local module com.google.android.gms.vision.ocr:0 and remote module com.google.android.gms.vision.ocr:1
Selected remote version of com.google.android.gms.vision.ocr, version >= 1
V/DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils
I/DynamiteLoaderV2: [71] VisionOcr.optional
W/scanner.camsca: Unsupported class loader
I/native: start_ocr_856638336_langid.cc:33 StartOcr with label: latin_script_gmvapi_android
jni_helper.cc:115 Loading model config /data/user/0/com.scanner.camscan/cache/vision/ocr/data/models/semanticlift_rpn_lstm_engine_tfmini.bincfg
I/native: region_proposal_text_detector.cc:1976 Compute manager Max in flight region detector: 1
common_util.h:39 Removing Thread Pool: ocr_region
tensor_detector_client.cc:1643 Compute manager Max in flight detector: 1
I/native: common_util.h:35 Resizing Thread Pool: ocr_det to 4
I/native: tfmini_model_interface.cc:124 Loaded weights from /data/user/0/com.scanner.camscan/cache/vision/ocr/data/models/tfmini_rpn_detector_space_to_depth_gray_quantized_v2_model.data
timer.cc:71 PhotoOcrEngine::Init (detector): 3.72583 ms (elapsed)
assist_recognizer.cc:94 Initializing nugget matcher with /data/user/0/com.scanner.camscan/cache/vision/ocr/data/models/nugget_stats_1.0.dat
I/native: timer.cc:71 PhotoOcrEngine::Init (assist recognizer): 0.262136 ms (elapsed)
I/native: timer.cc:71 LanguageIdMutator: 4.42141 ms (elapsed)
timer.cc:71 BeamSearch::Init (mutator): 4.58203 ms (elapsed)
I/native: common_util.h:35 Resizing Thread Pool: ocr_segm to 4
I/native: tfmini_model_interface.cc:102 Loaded fp16 weights from /data/user/0/com.scanner.camscan/cache/vision/ocr/data/models/tfmini_latin_conv_model.data_fp16
I/native: tfmini_model_interface.cc:102 Loaded fp16 weights from /data/user/0/com.scanner.camscan/cache/vision/ocr/data/models/tfmini_latin_lstm_model.data_fp16
timer.cc:71 PhotoOcrEngine::Init (recognizer): 8.83693 ms (elapsed)
timer.cc:71 Init: 13.0749 ms (elapsed)
I/native: start_ocr_856638336_langid.cc:42 StartOcr success
How can I rectify this error.
Thank you
I have faced a similar problem before.
These are not actual errors. They are just warnings and messages. You can ignore them.
What I guess is, you are putting true in the boolean variable success on onSuccess and false on onFailure and performing further actions based on its value.
Just directly call further methods from onSuccess after string = text.getText();
Related
I have a functional implementation of native (C++) WebRTC in Windows, which I'm trying to get working on every other platform now. Currently, I'm attacking Android.
When I call webrtc::CreatePeerConnectionFactory, it cannot create the java class org.webrtc.voiceengine.WebRtcAudioManager. I get the following result (followed by a crash!):
I audio_processing_impl.cc: (line 292): Injected APM submodules:
I audio_processing_impl.cc: Echo control factory: 0
I audio_processing_impl.cc: Echo detector: 0
I audio_processing_impl.cc: Capture analyzer: 0
I audio_processing_impl.cc: Capture post processor: 0
I audio_processing_impl.cc: Render pre processor: 0
I audio_processing_impl.cc: (line 301): Denormal disabler: supported
I webrtc_voice_engine.cc: (line 312): WebRtcVoiceEngine::WebRtcVoiceEngine
I webrtc_video_engine.cc: (line 648): WebRtcVideoEngine::WebRtcVideoEngine()
I webrtc_voice_engine.cc: (line 334): WebRtcVoiceEngine::Init
I audio_device_impl.cc: (line 76): Create
I audio_device_impl.cc: (line 84): CreateForTest
I audio_device_buffer.cc: (line 65): AudioDeviceBuffer::ctor
I audio_device_impl.cc: (line 121): AudioDeviceModuleImpl
I audio_device_impl.cc: (line 125): CheckPlatform
I audio_device_impl.cc: (line 133): current platform is Android
I audio_device_impl.cc: (line 155): CreatePlatformSpecificObjects
I audio_device_impl.cc: (line 947): PlatformAudioLayer
I jvm_android.cc: (line 72): JvmThreadConnector::ctor
I jvm_android.cc: (line 77): Attaching thread to JVM
I jvm_android.cc: (line 262): JVM::environment
I jvm_android.cc: (line 184): JNIEnvironment::ctor
I audio_manager.cc: (line 71): ctor
I jvm_android.cc: (line 196): JNIEnvironment::RegisterNatives: org/webrtc/voiceengine/WebRtcAudioManager
I jvm_android.cc: (line 134): NativeRegistration::ctor
I jvm_android.cc: (line 146): NativeRegistration::NewObject
I org.webrtc.Logging: WebRtcAudioManager: ctor#[name=Thread-15, id=21131]
W System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.content.Context.getSystemService(java.lang.String)' on a null object reference
W System.err: at org.webrtc.voiceengine.WebRtcAudioManager.<init>(WebRtcAudioManager.java:176)
E rtc : #
E rtc : # Fatal error in: ../../modules/utility/source/jvm_android.cc, line 151
E rtc : # last system error: 0
E rtc : # Check failed: !jni_->ExceptionCheck()
E rtc : # Error during NewObjectV
F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 28384 (Thread-15), pid 27615 (.qgroundcontrol)
This what that failing Java line looks like:
audioManager =
(AudioManager) ContextUtils.getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
I'm using WebRTC M103 (branch-heads/5060).
I've linked to libwebrtc.a, dynamically loaded libjingle_peerconnection_so.so, and bundled libwebrtc.jar. All of those seemed to be required dependencies, and advanced the ball for me one-by-one as I added them into the equation.
Fixed! This is what I was missing:
I was calling webrtc::JVM::Initialize prior to webrtc::CreatePeerConnectionFactory (which is one of many Droid specific requirements they don't bother mention in any docs...). But, I missed the fact there is an overload which takes the Droid app context (i.e. static void Initialize(JavaVM* jvm, jobject context);). That is to say, I was only passing the jvm pointer when initializing.
After a mini adventure (for which I'll omit the details) to get the context reference on C side, and not have it go "stale" (when the Java GC would delete it), I passed that along to the initialization. That, in turn, allowed that (original issue) of the Java invocation of ContextUtils.getApplicationContext() to work!
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 created an example project based on google maps,in android studio, but it crashed when I run it. I use my smartphone for test it because my CPU not support VT-x.
This is Activity:
package com.example.giuseppe.provamaps;
import android.content.Context;
import android.support.multidex.MultiDex;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
private GoogleMap mMap;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
#Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
// Add a marker in Sydney and move the camera
LatLng sydney = new LatLng(-34, 151);
mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
}
This is the Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.giuseppe.provamaps">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MapsActivity"
android:label="#string/title_activity_maps">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
</application>
and this is the logcat output:
INFO - tools.idea.ddms.adb.AdbService - Initializing adb using: C:\Users\Rosa\AppData\Local\Android\Sdk\platform-tools\adb.exe, client support = true
INFO - tools.idea.ddms.adb.AdbService - Successfully connected to adb
INFO - ditor.DeployTargetPickerDialog - Successfully obtained debug bridge
WARN - #InstantRun - Instant Run enabled, but not doing an instant run build since: LEGACY_MULTIDEX_REQUIRES_ART
INFO - a.gradle.invoker.GradleInvoker - About to execute Gradle tasks: [:app:assembleDebug]
INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre
INFO - a.gradle.invoker.GradleInvoker - Build command line options: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, -Pandroid.injected.build.api=19, -Pandroid.injected.build.density=hdpi, -Pandroid.injected.build.abi=armeabi-v7a,armeabi, -Pandroid.injected.coldswap.mode=MULTIDEX, --init-script, C:\Users\Rosa\AppData\Local\Temp\asLocalRepo376.gradle]
INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, -Pandroid.injected.build.api=19, -Pandroid.injected.build.density=hdpi, -Pandroid.injected.build.abi=armeabi-v7a,armeabi, -Pandroid.injected.coldswap.mode=MULTIDEX, --init-script, C:\Users\Rosa\AppData\Local\Temp\asLocalRepo376.gradle]
INFO - .diagnostic.PerformanceWatcher - High memory usage (free 129 of 1463 MB) while dumping threads to C:\Users\Rosa\.AndroidStudio2.2\system\log\threadDumps-20161211-205128-AI-145.3537739\20161211-213329\threadDump-20161211-213329.txt
INFO - .diagnostic.PerformanceWatcher - High memory usage (free 125 of 1463 MB) while dumping threads to C:\Users\Rosa\.AndroidStudio2.2\system\log\threadDumps-20161211-205128-AI-145.3537739\20161211-213329\threadDump-20161211-213335.txt
INFO - pl.ProjectRootManagerComponent - project roots have changed
INFO - .diagnostic.PerformanceWatcher - Pushing properties took 254ms; general responsiveness: ok; EDT responsiveness: ok
INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 3027ms; general responsiveness: 0/9 sluggish, 9/9 very slow; EDT responsiveness: 1/3 sluggish, 1/3 very slow
INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 7 files to update
INFO - .diagnostic.PerformanceWatcher - Unindexed files update took 15232ms; general responsiveness: 3/35 sluggish, 26/35 very slow; EDT responsiveness: ok
INFO - .diagnostic.PerformanceWatcher - High memory usage (free 163 of 1463 MB) while dumping threads to C:\Users\Rosa\.AndroidStudio2.2\system\log\threadDumps-20161211-205128-AI-145.3537739\20161211-213404\threadDump-20161211-213404.txt
INFO - pl.ProjectRootManagerComponent - project roots have changed
INFO - a.gradle.run.MakeBeforeRunTask - Gradle invocation complete, success = true
INFO - .diagnostic.PerformanceWatcher - Pushing properties took 15ms; general responsiveness: ok; EDT responsiveness: ok
INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 48ms; general responsiveness: ok; EDT responsiveness: ok
INFO - #InstantRun - Using legacy/main APK deploy task
INFO - .diagnostic.PerformanceWatcher - High memory usage (free 135 of 1463 MB) while dumping threads to C:\Users\Rosa\.AndroidStudio2.2\system\log\threadDumps-20161211-205128-AI-145.3537739\20161211-213616\threadDump-20161211-213616.txt
INFO - .diagnostic.PerformanceWatcher - High memory usage (free 119 of 1463 MB) while dumping threads to C:\Users\Rosa\.AndroidStudio2.2\system\log\threadDumps-20161211-205128-AI-145.3537739\20161211-213616\threadDump-20161211-213622.txt
INFO - .diagnostic.PerformanceWatcher - High memory usage (free 68 of 1463 MB) while dumping threads to C:\Users\Rosa\.AndroidStudio2.2\system\log\threadDumps-20161211-205128-AI-145.3537739\20161211-213616\threadDump-20161211-213627.txt
INFO - idea.run.AndroidProcessHandler - Adding device lge-lg_d505-ce1698dd to monitor for launched app: com.example.giuseppe.provamaps
INFO - #com.android.ddmlib - Opening a debugger listener at port 8600 for client with pid 21186
WARN - #com.android.ddmlib - IO Error while obtaining allocation status
WARN - #com.android.ddmlib - Adb rejected connection to client '21199': closed
WARN - #com.android.ddmlib - Adb rejected connection to client '21214': closed
INFO - #com.android.ddmlib - Opening a debugger listener at port 8602 for client with pid 21298
INFO - #com.android.ddmlib - Opening a debugger listener at port 8602 for client with pid 21312
INFO - #com.android.ddmlib - Opening a debugger listener at port 8602 for client with pid 21325
I tried to use adb kill-server, adb start-server, invalidate chache/restart, use another device, but nothing works
Also in adb logcat there is a loop (while the app is stopped):
D/WifiStateMachine: handleMessage: X
D/BubblePopupHelper: isShowingBubblePopup : false
D/BubblePopupHelper: isShowingBubblePopup : false
D/WifiStateMachine: handleMessage: E msg.what=131155
D/WifiStateMachine: processMsg: ConnectedState
D/WifiStateMachine: processMsg: L2ConnectedState
D/WifiNative-wlan0: doString: SIGNAL_POLL
D/wpa_supplicant: RX ctrl_iface - hexdump(len=11): 53 49 47 4e 41 4c 5f 50 4f 4c 4c
D/wpa_supplicant: wlan0: Control interface command 'SIGNAL_POLL'
D/wpa_supplicant: nl80211: survey data missing!
Sorry for my english, I hope someone can help me. Thanks to all
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.example.giuseppe.provamaps"
minSdkVersion 19
targetSdkVersion 25
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.google.android.gms:play-services:10.0.1'
testCompile 'junit:junit:4.12'
}
Another thing, if I try to start an HelloWorld example without google maps activity, it does work.
Change this dependency (in your build.gradle):
compile 'com.google.android.gms:play-services:10.0.1'
For this one:
compile 'com.google.android.gms:play-services-maps:10.0.1'
to depend only on the maps component instead of depending on the whole Play Services library.
I have implement firebase analytics in my app, but not show up any event or log in fire base console.
Add bellow code in each fragment in onCreateView() method.
private void addFragmentInFirebaseAnalytics() {
FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(getContext());
FragmentItem fragmentItem = new FragmentItem();
fragmentItem.setFragmentId(Constant.FM_ID_MOIST_AIR);
fragmentItem.setFragmentName(MoistAirActivity.class.getSimpleName());
Bundle bundle = new Bundle();
bundle.putInt(FirebaseAnalytics.Param.ITEM_ID, fragmentItem.getFragmentId());
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, fragmentItem.getFragmentName());
//Logs an app event.
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
Log.d(TAG,"bundle >>"+bundle);
}
Used dependency is :
compile 'com.google.firebase:firebase-core:9.4.0'
used plugin :
apply plugin: 'com.google.gms.google-services'
Its work fine and show log like this in debug console,
09-14 12:30:42.967 D/FA ( 8821): Logging event (FE): select_content, Bundle
[{_o=app, _ev=item_id, item_name=MoistAirActivity, content_type=Navigation Menu,
_err=4}]
09-14 12:30:42.977 V/FA ( 8821): Using measurement service
09-14 12:30:42.977 V/FA ( 8821): Connecting to remote service
09-14 12:30:43.217 D/FA ( 8821): Connected to remote service
09-14 12:30:43.217 V/FA ( 8821): Processing queued up service tasks: 1
09-14 12:30:43.217 E/FA ( 8821): Task exception on worker thread: java.lang
.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist. : com.goo
gle.android.gms.measurement.internal.zzt.zzEd(Unknown Source)
09-14 12:30:48.217 V/FA ( 8821): Inactivity, disconnecting from AppMeasurem
entService
but not show any uploading message in debug console and firebase console after 24 hours,
So, whats wrong here ? please help.
Finally i resolved this problem by replacing tools:node="replace" to tools:node="merge" and add tools:replace="android:label" in menifest file.
Reference : FirebaseApp with name [DEFAULT] doesn't exist
For me this worked:
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
in the AndroidManifest.xml.
I've not specified any tools attribute.
There are a few things that could be going on here. You will see more diagnostic messages if you run:
adb shell setprop log.tag.FA VERBOSE
and if your test device has Google Play Services installed, also run:
adb shell setprop log.tag.FA-SVC VERBOSE
Those commands will display more information in your logcat. Are there any errors from FA or FA-SVC on application startup?
I've recently upgraded my Nexus 4 to Android 4.4. Whilst debugging my app, I discovered message W/chromium(14962): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
What does it mean ?
Logcat
12-12 17:38:56.726: V/WebViewChromium(14962): Binding Chromium to the main looper Looper{41f91588}
12-12 17:38:56.736: I/chromium(14962): [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
12-12 17:38:56.736: I/BrowserProcessMain(14962): Initializing chromium process, renderers=0
12-12 17:38:56.746: W/chromium(14962): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
I think you can safely ignore this one. It is kinda hard-coded in Chromium Browser Engine.
If you check Chromium sources (https://chromium.googlesource.com/chromium/src.git/+/master/net/proxy/proxy_service.cc) and see ProxyService::CreateUsingSystemProxyResolver you will find
if (!ProxyResolverFactoryForSystem::IsSupported()) {
LOG(WARNING) << "PAC support disabled because there is no "
"system implementation";
return CreateWithoutProxyResolver(proxy_config_service, net_log);
}
where ProxyResolverFactoryForSystem::IsSupported() is just returning false if you're not on Windows or MacOS
class ProxyResolverFactoryForSystem : public ProxyResolverFactory {
//[...]
static bool IsSupported() {
#if defined(OS_WIN) || defined(OS_MACOSX)
return true;
#else
return false;
#endif
}
};